Skip to content

Commit 32b9494

Browse files
committed
Fix fallout in tests
1 parent 0b8decf commit 32b9494

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// error-pattern: requires at least a format string argument
12+
// error-pattern: bad-format-args.rs:19:5: 19:15 note: in this expansion
13+
14+
// error-pattern: expected token: `,`
15+
// error-pattern: bad-format-args.rs:20:5: 20:19 note: in this expansion
16+
// error-pattern: bad-format-args.rs:21:5: 21:22 note: in this expansion
17+
18+
fn main() {
19+
format!();
20+
format!("" 1);
21+
format!("", 1 1);
22+
}

src/test/compile-fail/ifmt-bad-arg.rs

-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,4 @@ fn main() {
5050

5151
format!("foo } bar"); //~ ERROR: unmatched `}` found
5252
format!("foo }"); //~ ERROR: unmatched `}` found
53-
54-
format!(); //~ ERROR: requires at least a format string argument
55-
format!("" 1); //~ ERROR: expected token: `,`
56-
format!("", 1 1); //~ ERROR: expected token: `,`
5753
}

src/test/compile-fail/macro-backtrace-println.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ macro_rules! myprint {
2121
}
2222

2323
macro_rules! myprintln {
24-
($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ NOTE in this expansion of myprint!
25-
//~^ NOTE in this expansion of concat!
24+
($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ ERROR invalid reference to argument `0`
25+
//~| NOTE in this expansion of concat!
26+
//~| NOTE in this expansion of myprint!
2627
}
2728

2829
fn main() {
29-
myprintln!("{}"); //~ ERROR invalid reference to argument `0`
30-
//~^ NOTE in this expansion of
30+
myprintln!("{}"); //~ NOTE in this expansion of
3131
}

src/test/compile-fail/macros-nonfatal-errors.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ fn main() {
3232

3333
foo::blah!(); //~ ERROR
3434

35-
format!(); //~ ERROR
3635
format!(invalid); //~ ERROR
3736

3837
include!(invalid); //~ ERROR

src/test/compile-fail/trace_macros-gate.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ fn main() {
2323
// of the below being caught.
2424

2525
macro_rules! expando {
26-
($x: ident) => { trace_macros!($x) }
26+
($x: ident) => { trace_macros!($x) } //~ ERROR `trace_macros` is not stable
2727
}
2828

29-
expando!(true); //~ ERROR `trace_macros` is not stable
29+
expando!(true); //~ NOTE in this expansion
30+
//~^ NOTE in this expansion
3031
}

0 commit comments

Comments
 (0)