Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
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() {
Expand Down
14 changes: 14 additions & 0 deletions tests/ui/resolve/ice-inconsistent-resolution-151213.rs
Original file line number Diff line number Diff line change
@@ -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() {}
14 changes: 14 additions & 0 deletions tests/ui/resolve/ice-inconsistent-resolution-151213.stderr
Original file line number Diff line number Diff line change
@@ -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

Loading