-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #65140 - petrochenkov:disapp, r=nikomatsakis
resolve: Remove an incorrect assert Fixes #64803.
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Regression test for issue #64803 (initial attribute resolution can disappear later). | ||
|
||
// aux-build:test-macros.rs | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
mod m { | ||
use test_macros::Empty; | ||
} | ||
use m::Empty; //~ ERROR derive macro `Empty` is private | ||
|
||
// To resolve `empty_helper` we need to resolve `Empty`. | ||
// During initial resolution `use m::Empty` introduces no entries, so we proceed to `macro_use`, | ||
// successfully resolve `Empty` from there, and then resolve `empty_helper` as its helper. | ||
// During validation `use m::Empty` introduces a `Res::Err` stub, so `Empty` resolves to it, | ||
// and `empty_helper` can no longer be resolved. | ||
#[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope | ||
#[derive(Empty)] | ||
struct S; | ||
|
||
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,15 @@ | ||
error: cannot find attribute `empty_helper` in this scope | ||
--> $DIR/disappearing-resolution.rs:18:3 | ||
| | ||
LL | #[empty_helper] | ||
| ^^^^^^^^^^^^ | ||
|
||
error[E0603]: derive macro `Empty` is private | ||
--> $DIR/disappearing-resolution.rs:11:8 | ||
| | ||
LL | use m::Empty; | ||
| ^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0603`. |