about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-13 21:07:30 -0700
committerGitHub <noreply@github.com>2016-06-13 21:07:30 -0700
commitbf84f4e171fa0169af59881bc5d87ecc84d61523 (patch)
treed8b761d077e741723110a4d5d945748fb17cac57 /src/test
parent6551acc8e560d242f317f4fe4324be0962c5db75 (diff)
parent2477341d057aff05a8a009a7eb7a1168ccd4e277 (diff)
downloadrust-bf84f4e171fa0169af59881bc5d87ecc84d61523.tar.gz
rust-bf84f4e171fa0169af59881bc5d87ecc84d61523.zip
Auto merge of #33749 - jseyfried:fix_call_site_span, r=nrc
Fix macro call site spans

Fix macro call site spans.
r? @nrc
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/bad-format-args.rs22
-rw-r--r--src/test/compile-fail/ifmt-bad-arg.rs4
-rw-r--r--src/test/compile-fail/macro-backtrace-println.rs8
-rw-r--r--src/test/compile-fail/macros-nonfatal-errors.rs1
-rw-r--r--src/test/compile-fail/trace_macros-gate.rs5
-rw-r--r--src/test/debuginfo/function-arg-initialization.rs8
6 files changed, 34 insertions, 14 deletions
diff --git a/src/test/compile-fail/bad-format-args.rs b/src/test/compile-fail/bad-format-args.rs
new file mode 100644
index 00000000000..816c696a895
--- /dev/null
+++ b/src/test/compile-fail/bad-format-args.rs
@@ -0,0 +1,22 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// error-pattern: requires at least a format string argument
+// error-pattern: bad-format-args.rs:19:5: 19:15 note: in this expansion
+
+// error-pattern: expected token: `,`
+// error-pattern: bad-format-args.rs:20:5: 20:19 note: in this expansion
+// error-pattern: bad-format-args.rs:21:5: 21:22 note: in this expansion
+
+fn main() {
+    format!();
+    format!("" 1);
+    format!("", 1 1);
+}
diff --git a/src/test/compile-fail/ifmt-bad-arg.rs b/src/test/compile-fail/ifmt-bad-arg.rs
index 7c929d2db16..1368702b160 100644
--- a/src/test/compile-fail/ifmt-bad-arg.rs
+++ b/src/test/compile-fail/ifmt-bad-arg.rs
@@ -50,8 +50,4 @@ 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: `,`
 }
diff --git a/src/test/compile-fail/macro-backtrace-println.rs b/src/test/compile-fail/macro-backtrace-println.rs
index c2277c3e6d8..9d6da2a53a2 100644
--- a/src/test/compile-fail/macro-backtrace-println.rs
+++ b/src/test/compile-fail/macro-backtrace-println.rs
@@ -21,11 +21,11 @@ macro_rules! myprint {
 }
 
 macro_rules! myprintln {
-    ($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ NOTE in this expansion of myprint!
-                                                    //~^ NOTE in this expansion of concat!
+    ($fmt:expr) => (myprint!(concat!($fmt, "\n"))); //~ ERROR invalid reference to argument `0`
+                                                    //~| NOTE in this expansion of concat!
+                                                    //~| NOTE in this expansion of myprint!
 }
 
 fn main() {
-    myprintln!("{}"); //~ ERROR invalid reference to argument `0`
-                      //~^ NOTE in this expansion of
+    myprintln!("{}"); //~ NOTE in this expansion of
 }
diff --git a/src/test/compile-fail/macros-nonfatal-errors.rs b/src/test/compile-fail/macros-nonfatal-errors.rs
index 42a0f41dd97..723e936212a 100644
--- a/src/test/compile-fail/macros-nonfatal-errors.rs
+++ b/src/test/compile-fail/macros-nonfatal-errors.rs
@@ -32,7 +32,6 @@ fn main() {
 
     foo::blah!(); //~ ERROR
 
-    format!(); //~ ERROR
     format!(invalid); //~ ERROR
 
     include!(invalid); //~ ERROR
diff --git a/src/test/compile-fail/trace_macros-gate.rs b/src/test/compile-fail/trace_macros-gate.rs
index d627de24d67..e9b7ddf6d1c 100644
--- a/src/test/compile-fail/trace_macros-gate.rs
+++ b/src/test/compile-fail/trace_macros-gate.rs
@@ -23,8 +23,9 @@ fn main() {
     // of the below being caught.
 
     macro_rules! expando {
-        ($x: ident) => { trace_macros!($x) }
+        ($x: ident) => { trace_macros!($x) } //~ ERROR `trace_macros` is not stable
     }
 
-    expando!(true); //~ ERROR `trace_macros` is not stable
+    expando!(true); //~ NOTE in this expansion
+                    //~^ NOTE in this expansion
 }
diff --git a/src/test/debuginfo/function-arg-initialization.rs b/src/test/debuginfo/function-arg-initialization.rs
index d007b507556..add09384094 100644
--- a/src/test/debuginfo/function-arg-initialization.rs
+++ b/src/test/debuginfo/function-arg-initialization.rs
@@ -228,7 +228,7 @@
 #![omit_gdb_pretty_printer_section]
 
 fn immediate_args(a: isize, b: bool, c: f64) {
-    println!("") // #break
+    zzz(); // #break
 }
 
 struct BigStruct {
@@ -243,7 +243,7 @@ struct BigStruct {
 }
 
 fn non_immediate_args(a: BigStruct, b: BigStruct) {
-    println!("") // #break
+    zzz(); // #break
 }
 
 fn binding(a: i64, b: u64, c: f64) {
@@ -257,7 +257,7 @@ fn assignment(mut a: u64, b: u64, c: f64) {
 }
 
 fn function_call(x: u64, y: u64, z: f64) {
-    println!("Hi!") // #break
+    zzz(); // #break
 }
 
 fn identifier(x: u64, y: u64, z: f64) -> u64 {
@@ -333,3 +333,5 @@ fn main() {
     while_expr(40, 41, 42);
     loop_expr(43, 44, 45);
 }
+
+fn zzz() {()}