-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the glob binding in resolve_rustdoc_path process #117936
Conversation
This change hides some deeper issue, |
cc @bvanjoi |
reduced: // edition: 2021
// compile-flags: --crate-type=lib
use super::A;
mod b {
pub trait A {}
pub trait B {}
}
/// [`A`]
pub use b::*;
fn main() {} This issue arises when the dummy binding for Before invoking Therefore, the initial solution for this issue is to delete the following code: if res == Res::Err && old_binding.res() != Res::Err {
return Ok(())
} I believe this solution could work, yet it might not be worth implementing for invalid code. This pertains to core logic and may introduce unexpected behavior. Another solution is to ensure that the glob binding is used when resolving this.update_resolution(import.parent_scope.module, key, false, |_, resolution| {
resolution.single_imports.remove(&import);
}) I think this is a more robust method. |
Another point worth investigating is why the following code doesn't trigger a panic: // edition: 2021
// compile-flags: --crate-type=lib
use super::A;
mod b {
pub trait A {}
// pub trait B {}
}
/// [`A`]
pub use b::*;
fn main() {} edit: this case doesn't trigger a panic because it returns early in resolve_doc_links due to it doesn't re-export anything. |
bd4d695
to
84503ad
Compare
@rustbot ready |
None
instead of unreachable!()
This comment has been minimized.
This comment has been minimized.
@petrochenkov hi, I think this PR is ready for now ;) |
@mu001999 |
@bors r+ |
Use the glob binding in resolve_rustdoc_path process Fixes rust-lang#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`
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1fdfe12): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Warning ⚠: The following benchmark(s) failed to build:
cc @rust-lang/wg-compiler-performance Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 677.588s -> 676.286s (-0.19%) |
All regressions appear to be have been spurious, resolving themselves on the next merge (#118687). Removing perf-regression label. |
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 intotests/ui/...
and then compiling it usingrustc +stage1 /path/to/test.rs
orx.py test
:r? @petrochenkov