-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`fn resolve_legacy_scope` can now resolve only to `macro_rules!` items, `fn resolve_lexical_macro_path_segment` is for everything else - modularized macros, preludes
- Loading branch information
1 parent
23e9a1d
commit c2788a8
Showing
9 changed files
with
160 additions
and
116 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 @@ | ||
// Copyright 2018 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. | ||
|
||
// Ambiguity between a `macro_rules` macro and a non-existent import recovered as `Def::Err` | ||
|
||
macro_rules! mac { () => () } | ||
|
||
mod m { | ||
use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module` | ||
|
||
mac!(); //~ ERROR `mac` is ambiguous | ||
} | ||
|
||
fn main() {} |
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[E0432]: unresolved import `nonexistent_module` | ||
--> $DIR/issue-53269.rs:16:9 | ||
| | ||
LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module` | ||
| ^^^^^^^^^^^^^^^^^^ Maybe a missing `extern crate nonexistent_module;`? | ||
|
||
error: `mac` is ambiguous | ||
--> $DIR/issue-53269.rs:18:5 | ||
| | ||
LL | mac!(); //~ ERROR `mac` is ambiguous | ||
| ^^^ | ||
| | ||
note: `mac` could refer to the macro defined here | ||
--> $DIR/issue-53269.rs:13:1 | ||
| | ||
LL | macro_rules! mac { () => () } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: `mac` could also refer to the macro imported here | ||
--> $DIR/issue-53269.rs:16:9 | ||
| | ||
LL | use nonexistent_module::mac; //~ ERROR unresolved import `nonexistent_module` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0432`. |
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 2018 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. | ||
|
||
// Macro from prelude is shadowed by non-existent import recovered as `Def::Err`. | ||
|
||
use std::assert; //~ ERROR unresolved import `std::assert` | ||
|
||
fn main() { | ||
assert!(true); | ||
} |
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,9 @@ | ||
error[E0432]: unresolved import `std::assert` | ||
--> $DIR/issue-53512.rs:13:5 | ||
| | ||
LL | use std::assert; //~ ERROR unresolved import `std::assert` | ||
| ^^^^^^^^^^^ no `assert` in the root | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0432`. |
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