File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 1313// up in the expanded output) without the appropriate feature.
1414
1515pub fn f0 ( ) {
16- println ! ( panic!( "this should work" ) ) ;
16+ panic ! ( "this should work" ) ;
1717}
1818
1919pub fn main ( ) {
20- println ! ( __unstable_rustc_ensure_not_fmt_string_literal!(
21- "`main`" , "this should work, but its unstable" ) ) ;
20+ __unstable_rustc_ensure_not_fmt_string_literal ! (
21+ "`main`" , "this should work, but its unstable" ) ;
22+ //~^^ ERROR use of unstable library feature 'ensure_not_fmt_string_literal'
23+ //~| HELP add #![feature(ensure_not_fmt_string_literal)] to the crate attributes to enable
2224 f0 ( ) ;
2325}
Original file line number Diff line number Diff line change 99// except according to those terms.
1010
1111#![ feature( rustc_attrs) ]
12+ #![ feature( ensure_not_fmt_string_literal) ]
1213
1314// Issue 22932: `panic!("{}");` should not compile.
1415
@@ -52,19 +53,18 @@ pub fn f5() { panic!("nor this }}");
5253}
5354
5455pub fn f0_a ( ) {
55- ensure_not_fmt_string_literal ! ( "`f0_a`" , "this does not work {}" ) ;
56+ __unstable_rustc_ensure_not_fmt_string_literal ! ( "`f0_a`" , "this does not work {}" ) ;
5657 //~^ WARN `f0_a` literal argument contains `{`
5758 //~| NOTE Is it meant to be a `format!` string?
5859 //~| HELP You can wrap the argument in parentheses to sidestep this warning
5960}
6061
6162pub fn f0_b ( ) {
62- println ! ( ensure_not_fmt_string_literal! ( "`f0_b`" , "this does work" ) ) ;
63+ __unstable_rustc_ensure_not_fmt_string_literal ! ( "`f0_b`" , "this does work" ) ;
6364}
6465
6566pub fn f0_c ( ) {
66- println ! ( "{}" ,
67- ensure_not_fmt_string_literal!( "`f0_c`" , ( "so does this {}" ) ) ) ;
67+ __unstable_rustc_ensure_not_fmt_string_literal ! ( "`f0_c`" , ( "so does this {}" ) ) ;
6868}
6969
7070// This test is just checking that we get all the right warnings; none
You can’t perform that action at this time.
0 commit comments