Skip to content

Commit 12706c9

Browse files
committed
fixed up the tests.
1 parent 976f290 commit 12706c9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/test/compile-fail/issue-22932-ensure-helper-unstable.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
// up in the expanded output) without the appropriate feature.
1414

1515
pub fn f0() {
16-
println!(panic!("this should work"));
16+
panic!("this should work");
1717
}
1818

1919
pub 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
}

src/test/compile-fail/issue-22932.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
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

5455
pub 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

6162
pub 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

6566
pub 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

0 commit comments

Comments
 (0)