mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
fix ICE on inconsistent import resolution with macro-attributed extern crate
This commit is contained in:
@@ -989,7 +989,7 @@ fn finalize_import(&mut self, import: Import<'ra>) -> Option<UnresolvedImportErr
|
||||
PathResult::Module(module) => {
|
||||
// Consistency checks, analogous to `finalize_macro_resolutions`.
|
||||
if let Some(initial_module) = import.imported_module.get() {
|
||||
if module != initial_module && no_ambiguity {
|
||||
if module != initial_module && no_ambiguity && !self.issue_145575_hack_applied {
|
||||
span_bug!(import.span, "inconsistent resolution for an import");
|
||||
}
|
||||
} else if self.privacy_errors.is_empty() {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//@ edition: 2024
|
||||
|
||||
#[attr]
|
||||
//~^ ERROR cannot find attribute `attr` in this scope
|
||||
extern crate core as std;
|
||||
//~^ ERROR macro-expanded `extern crate` items cannot shadow names passed with `--extern`
|
||||
|
||||
mod inner {
|
||||
use std::str;
|
||||
|
||||
use crate::*;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,14 @@
|
||||
error: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
|
||||
--> $DIR/ice-inconsistent-resolution-151213.rs:5:1
|
||||
|
|
||||
LL | extern crate core as std;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: cannot find attribute `attr` in this scope
|
||||
--> $DIR/ice-inconsistent-resolution-151213.rs:3:3
|
||||
|
|
||||
LL | #[attr]
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Reference in New Issue
Block a user