Skip to content

Commit 1fdfe12

Browse files
committed
Auto merge of #117936 - mu001999:master, r=petrochenkov
Use the glob binding in resolve_rustdoc_path process Fixes #117920 Returning `None` seems enough. I reproduces and tests this locally by `cargo +stage1 build`, but I cannot reproduce this ICE by putting [the following code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8b3ca8f4a7676eb90baf30437ba041a2) into `tests/ui/...` and then compiling it using `rustc +stage1 /path/to/test.rs` or `x.py test`: ```rust #![crate_type = "lib"] use super::Hasher; /// [`Hasher`] pub use core::hash::*; ``` r? `@petrochenkov`
2 parents 7a34091 + 940473a commit 1fdfe12

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

compiler/rustc_resolve/src/imports.rs

+3
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
477477
self.per_ns(|this, ns| {
478478
let key = BindingKey::new(target, ns);
479479
let _ = this.try_define(import.parent_scope.module, key, dummy_binding, false);
480+
this.update_resolution(import.parent_scope.module, key, false, |_, resolution| {
481+
resolution.single_imports.remove(&import);
482+
})
480483
});
481484
self.record_use(target, dummy_binding, false);
482485
} else if import.imported_module.get().is_none() {

tests/ui/resolve/issue-117920.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#![crate_type = "lib"]
2+
3+
use super::A; //~ ERROR failed to resolve
4+
5+
mod b {
6+
pub trait A {}
7+
pub trait B {}
8+
}
9+
10+
/// [`A`]
11+
pub use b::*;

tests/ui/resolve/issue-117920.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0433]: failed to resolve: there are too many leading `super` keywords
2+
--> $DIR/issue-117920.rs:3:5
3+
|
4+
LL | use super::A;
5+
| ^^^^^ there are too many leading `super` keywords
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0433`.

0 commit comments

Comments
 (0)