diff options
| author | bors <bors@rust-lang.org> | 2013-09-15 01:50:50 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-15 01:50:50 -0700 |
| commit | 4ecb0a372d4b246f694bf780d50809dc0fb32018 (patch) | |
| tree | 187f30d8b9ae662bc385558473e1c9c1fa5b6424 /src/test | |
| parent | 36872e4180331e4a7f00329abe7972488ce216cf (diff) | |
| parent | 640613892fc5ab055853b48934b6e4ecf895c2dd (diff) | |
| download | rust-4ecb0a372d4b246f694bf780d50809dc0fb32018.tar.gz rust-4ecb0a372d4b246f694bf780d50809dc0fb32018.zip | |
auto merge of #9153 : alexcrichton/rust/simplify-format, r=huonw
This follows from the discussion in #9012. * All macros are now defined in terms of `format_args!` allowing for removal of a good bit of code in the syntax extension * The syntax extension is now in a more aptly-named file, `format.rs` * Documentation was added for the `format!`-related macros.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/ifmt-bad-arg.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/compile-fail/ifmt-bad-arg.rs b/src/test/compile-fail/ifmt-bad-arg.rs index 5da73a495f6..f9552725af3 100644 --- a/src/test/compile-fail/ifmt-bad-arg.rs +++ b/src/test/compile-fail/ifmt-bad-arg.rs @@ -11,7 +11,6 @@ fn main() { // bad arguments to the format! call - format!(); //~ ERROR: requires at least a format string format!("{}"); //~ ERROR: invalid reference to argument format!("{1}", 1); //~ ERROR: invalid reference to argument `1` @@ -30,8 +29,6 @@ fn main() { format!("{foo}", foo=1, foo=2); //~ ERROR: duplicate argument format!("#"); //~ ERROR: `#` reference used format!("", foo=1, 2); //~ ERROR: positional arguments cannot follow - format!("" 1); //~ ERROR: expected token: `,` - format!("", 1 1); //~ ERROR: expected token: `,` format!("{0, select, a{} a{} other{}}", "a"); //~ ERROR: duplicate selector format!("{0, plural, =1{} =1{} other{}}", 1u); //~ ERROR: duplicate selector @@ -74,4 +71,8 @@ fn main() { format!("foo } bar"); //~ ERROR: unmatched `}` found format!("foo }"); //~ ERROR: unmatched `}` found + + format!(); //~ ERROR: requires at least a format string argument + format!("" 1); //~ ERROR: expected token: `,` + format!("", 1 1); //~ ERROR: expected token: `,` } |
