about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorWang Xuerui <idontknw.wang@gmail.com>2016-07-29 16:40:10 +0800
committerWang Xuerui <idontknw.wang@gmail.com>2016-07-29 16:40:10 +0800
commit2a41b31a88356d5a772cb644ab8d29af0bf44742 (patch)
tree9a54f52e40d90eb3eefcfd0730637eb1b85daee7 /src/test
parentd9a911d236cbecb47775276ba51a5f9111bdbc9c (diff)
downloadrust-2a41b31a88356d5a772cb644ab8d29af0bf44742.tar.gz
rust-2a41b31a88356d5a772cb644ab8d29af0bf44742.zip
syntax_ext: format: fix ICE with bad named arguments
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/ifmt-bad-arg.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/compile-fail/ifmt-bad-arg.rs b/src/test/compile-fail/ifmt-bad-arg.rs
index 272ad980feb..59c61a42e07 100644
--- a/src/test/compile-fail/ifmt-bad-arg.rs
+++ b/src/test/compile-fail/ifmt-bad-arg.rs
@@ -41,6 +41,12 @@ fn main() {
     //~^ ERROR invalid reference to argument `0` (no arguments given)
     //~^^ ERROR invalid reference to argument `1` (no arguments given)
 
+    // bad named arguments, #35082
+
+    format!("{valuea} {valueb}", valuea=5, valuec=7);
+    //~^ ERROR there is no argument named `valueb`
+    //~^^ ERROR named argument never used
+
     // bad syntax of the format string
 
     format!("{"); //~ ERROR: expected `'}'` but string was terminated