summaryrefslogtreecommitdiffstats
path: root/tests/ui/unpretty
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/unpretty/box.rs9
-rw-r--r--tests/ui/unpretty/box.stdout14
-rw-r--r--tests/ui/unpretty/flattened-format-args.rs8
-rw-r--r--tests/ui/unpretty/flattened-format-args.stdout16
-rw-r--r--tests/ui/unpretty/mir-unpretty.rs (renamed from tests/ui/mir-unpretty.rs)0
-rw-r--r--tests/ui/unpretty/mir-unpretty.stderr (renamed from tests/ui/mir-unpretty.stderr)0
-rw-r--r--tests/ui/unpretty/unpretty-expr-fn-arg.rs (renamed from tests/ui/unpretty-expr-fn-arg.rs)0
-rw-r--r--tests/ui/unpretty/unpretty-expr-fn-arg.stdout (renamed from tests/ui/unpretty-expr-fn-arg.stdout)0
8 files changed, 47 insertions, 0 deletions
diff --git a/tests/ui/unpretty/box.rs b/tests/ui/unpretty/box.rs
new file mode 100644
index 000000000..81f5c88d7
--- /dev/null
+++ b/tests/ui/unpretty/box.rs
@@ -0,0 +1,9 @@
+// compile-flags: -Zunpretty=hir
+// check-pass
+
+#![feature(stmt_expr_attributes, rustc_attrs)]
+
+fn main() {
+ let _ = #[rustc_box]
+ Box::new(1);
+}
diff --git a/tests/ui/unpretty/box.stdout b/tests/ui/unpretty/box.stdout
new file mode 100644
index 000000000..0c6e012e6
--- /dev/null
+++ b/tests/ui/unpretty/box.stdout
@@ -0,0 +1,14 @@
+// compile-flags: -Zunpretty=hir
+// check-pass
+
+#![feature(stmt_expr_attributes, rustc_attrs)]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+
+fn main() {
+ let _ =
+ #[rustc_box]
+ Box::new(1);
+ }
diff --git a/tests/ui/unpretty/flattened-format-args.rs b/tests/ui/unpretty/flattened-format-args.rs
new file mode 100644
index 000000000..705dded16
--- /dev/null
+++ b/tests/ui/unpretty/flattened-format-args.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
+// check-pass
+
+fn main() {
+ let x = 1;
+ // Should flatten to println!("a 123 b {x} xyz\n"):
+ println!("a {} {}", format_args!("{} b {x}", 123), "xyz");
+}
diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout
new file mode 100644
index 000000000..a8fe8da00
--- /dev/null
+++ b/tests/ui/unpretty/flattened-format-args.stdout
@@ -0,0 +1,16 @@
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// compile-flags: -Zunpretty=hir -Zflatten-format-args=yes
+// check-pass
+
+fn main() {
+ let x = 1;
+ // Should flatten to println!("a 123 b {x} xyz\n"):
+ {
+ ::std::io::_print(<#[lang = "format_arguments"]>::new_v1(&["a 123 b ",
+ " xyz\n"],
+ &[<#[lang = "format_argument"]>::new_display(&x)]));
+ };
+ }
diff --git a/tests/ui/mir-unpretty.rs b/tests/ui/unpretty/mir-unpretty.rs
index 30620c69f..30620c69f 100644
--- a/tests/ui/mir-unpretty.rs
+++ b/tests/ui/unpretty/mir-unpretty.rs
diff --git a/tests/ui/mir-unpretty.stderr b/tests/ui/unpretty/mir-unpretty.stderr
index 3808f8583..3808f8583 100644
--- a/tests/ui/mir-unpretty.stderr
+++ b/tests/ui/unpretty/mir-unpretty.stderr
diff --git a/tests/ui/unpretty-expr-fn-arg.rs b/tests/ui/unpretty/unpretty-expr-fn-arg.rs
index 6e1132a33..6e1132a33 100644
--- a/tests/ui/unpretty-expr-fn-arg.rs
+++ b/tests/ui/unpretty/unpretty-expr-fn-arg.rs
diff --git a/tests/ui/unpretty-expr-fn-arg.stdout b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout
index b745b9886..b745b9886 100644
--- a/tests/ui/unpretty-expr-fn-arg.stdout
+++ b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout