diff options
| author | Jonathan Turner <jturner@mozilla.com> | 2016-08-17 07:20:04 -0700 |
|---|---|---|
| committer | Jonathan Turner <jturner@mozilla.com> | 2016-08-17 14:26:14 -0700 |
| commit | 61865384b8fa6d79d2b36cbd7c899eaf15f4aeea (patch) | |
| tree | 136502c033d49ba3e6e28f9460129586a381e92a /src/test/compile-fail | |
| parent | d0a272b797fd538c4b4230bdefea534af8c1ffde (diff) | |
| download | rust-61865384b8fa6d79d2b36cbd7c899eaf15f4aeea.tar.gz rust-61865384b8fa6d79d2b36cbd7c899eaf15f4aeea.zip | |
Replace local backtrace with def-use, repair std macro spans
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/bad-format-args.rs | 22 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-28308.rs | 17 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-backtrace-invalid-internals.rs | 57 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-backtrace-nested.rs | 30 | ||||
| -rw-r--r-- | src/test/compile-fail/macro-backtrace-println.rs | 31 |
5 files changed, 0 insertions, 157 deletions
diff --git a/src/test/compile-fail/bad-format-args.rs b/src/test/compile-fail/bad-format-args.rs deleted file mode 100644 index 8c58c8c6062..00000000000 --- a/src/test/compile-fail/bad-format-args.rs +++ /dev/null @@ -1,22 +0,0 @@ -// 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: in this expansion - -// error-pattern: expected token: `,` -// error-pattern: in this expansion -// error-pattern: in this expansion - -fn main() { - format!(); - format!("" 1); - format!("", 1 1); -} diff --git a/src/test/compile-fail/issue-28308.rs b/src/test/compile-fail/issue-28308.rs deleted file mode 100644 index b0c44b5f33a..00000000000 --- a/src/test/compile-fail/issue-28308.rs +++ /dev/null @@ -1,17 +0,0 @@ -// 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. - -// this error is dispayed in `<std macros>` -// error-pattern:cannot apply unary operator `!` to type `&'static str` -// error-pattern:in this expansion of assert! - -fn main() { - assert!("foo"); -} diff --git a/src/test/compile-fail/macro-backtrace-invalid-internals.rs b/src/test/compile-fail/macro-backtrace-invalid-internals.rs deleted file mode 100644 index ebec204184d..00000000000 --- a/src/test/compile-fail/macro-backtrace-invalid-internals.rs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 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. - -// Macros in statement vs expression position handle backtraces differently. - -macro_rules! fake_method_stmt { - () => { - 1.fake() //~ ERROR no method named `fake` found - } -} - -macro_rules! fake_field_stmt { - () => { - 1.fake //~ ERROR no field with that name - } -} - -macro_rules! fake_anon_field_stmt { - () => { - (1).0 //~ ERROR type was not a tuple - } -} - -macro_rules! fake_method_expr { - () => { - 1.fake() //~ ERROR no method named `fake` found - } -} - -macro_rules! fake_field_expr { - () => { - 1.fake //~ ERROR no field with that name - } -} - -macro_rules! fake_anon_field_expr { - () => { - (1).0 //~ ERROR type was not a tuple - } -} - -fn main() { - fake_method_stmt!(); //~ NOTE in this expansion of - fake_field_stmt!(); //~ NOTE in this expansion of - fake_anon_field_stmt!(); //~ NOTE in this expansion of - - let _ = fake_method_expr!(); //~ NOTE in this expansion of - let _ = fake_field_expr!(); //~ NOTE in this expansion of - let _ = fake_anon_field_expr!(); //~ NOTE in this expansion of -} diff --git a/src/test/compile-fail/macro-backtrace-nested.rs b/src/test/compile-fail/macro-backtrace-nested.rs deleted file mode 100644 index c2a270ea9f5..00000000000 --- a/src/test/compile-fail/macro-backtrace-nested.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 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. - -// In expression position, but not statement position, when we expand a macro, -// we replace the span of the expanded expression with that of the call site. - -macro_rules! nested_expr { - () => (fake) //~ ERROR unresolved name - //~^ ERROR unresolved name -} - -macro_rules! call_nested_expr { - () => (nested_expr!()) //~ NOTE in this expansion of nested_expr! -} - -macro_rules! call_nested_expr_sum { - () => { 1 + nested_expr!(); } //~ NOTE in this expansion of nested_expr! -} - -fn main() { - 1 + call_nested_expr!(); //~ NOTE in this expansion of call_nested_expr! - call_nested_expr_sum!(); //~ NOTE in this expansion of -} diff --git a/src/test/compile-fail/macro-backtrace-println.rs b/src/test/compile-fail/macro-backtrace-println.rs deleted file mode 100644 index 9d6da2a53a2..00000000000 --- a/src/test/compile-fail/macro-backtrace-println.rs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 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. - -// The `format_args!` syntax extension issues errors before code expansion -// has completed, but we still need a backtrace. - -// This test includes stripped-down versions of `print!` and `println!`, -// because we can't otherwise verify the lines of the backtrace. - -fn print(_args: std::fmt::Arguments) {} - -macro_rules! myprint { - ($($arg:tt)*) => (print(format_args!($($arg)*))); //~ NOTE in this expansion of -} - -macro_rules! myprintln { - ($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!("{}"); //~ NOTE in this expansion of -} |
