Add test for -Zflatten-format-args=yes.
This commit is contained in:
parent
653124ac44
commit
4d840223b0
8
tests/ui/unpretty/flattened-format-args.rs
Normal file
8
tests/ui/unpretty/flattened-format-args.rs
Normal file
@ -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");
|
||||
}
|
16
tests/ui/unpretty/flattened-format-args.stdout
Normal file
16
tests/ui/unpretty/flattened-format-args.stdout
Normal file
@ -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)]));
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user