-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace local backtrace with def-use, repair std macro spans
- Loading branch information
Jonathan Turner
committed
Aug 17, 2016
1 parent
d0a272b
commit 6186538
Showing
20 changed files
with
362 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: requires at least a format string argument | ||
--> $DIR/bad-format-args.rs:12:5 | ||
| | ||
12 | format!(); | ||
| ^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro from the standard library | ||
|
||
error: expected token: `,` | ||
--> $DIR/bad-format-args.rs:13:5 | ||
| | ||
13 | format!("" 1); | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro from the standard library | ||
|
||
error: expected token: `,` | ||
--> $DIR/bad-format-args.rs:14:5 | ||
| | ||
14 | format!("", 1 1); | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro from the standard library | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: cannot apply unary operator `!` to type `&'static str` | ||
--> $DIR/issue-28308.rs:12:5 | ||
| | ||
12 | assert!("foo"); | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro from the standard library | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// 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. | ||
|
||
fn main() { | ||
let x = vec![]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0282]: unable to infer enough type information about `_` | ||
--> $DIR/repair_span_std_macros.rs:12:13 | ||
| | ||
12 | let x = vec![]; | ||
| ^^^^^^ cannot infer type for `_` | ||
| | ||
= note: type annotations or generic parameter binding required | ||
= note: this error originates in a macro from the standard library | ||
|
||
error: aborting due to previous error | ||
|
23 changes: 23 additions & 0 deletions
23
src/test/ui/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// 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. | ||
|
||
#![crate_type = "dylib"] | ||
|
||
pub fn print(_args: std::fmt::Arguments) {} | ||
|
||
#[macro_export] | ||
macro_rules! myprint { | ||
($($arg:tt)*) => (print(format_args!($($arg)*))); | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! myprintln { | ||
($fmt:expr) => (myprint!(concat!($fmt, "\n"))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2012 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. | ||
|
||
// aux-build:extern_macro_crate.rs | ||
#[macro_use(myprintln, myprint)] | ||
extern crate extern_macro_crate; | ||
|
||
fn main() { | ||
myprintln!("{}"); //~ ERROR in this macro | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: invalid reference to argument `0` (no arguments given) | ||
--> $DIR/main.rs:16:5 | ||
| | ||
16 | myprintln!("{}"); //~ ERROR in this macro | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro from the standard library | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// 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. | ||
|
||
fn main() { | ||
println!(3 + 4); | ||
} |
Oops, something went wrong.