-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: Fix resolution of crate
-relative paths in doc links
#95337
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this refactoring! It looks very good overall; I just have a few questions.
Updated. |
This comment was marked as resolved.
This comment was marked as resolved.
ping @camelid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, I got busy.
@bors r+ rollup=never (may affect perf) |
📌 Commit f5ee822 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (949b98c): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
@petrochenkov @camelid this broke one of the perf benchmarks. You can see the error if you click of the perf comparison url and look at the "Newly broken benchmarks" section. I've pasted the error below. Looks like the this PR caused this unreachable code to be reached.
```
expected success, got exit status: 101
stderr= Documenting hyper v0.14.18 (/tmp/.tmpR27TDg) thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_resolve/src/lib.rs:3302:67 error: internal compiler error: unexpected panic note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md note: rustc 1.62.0-nightly (949b98c 2022-04-05) running on x86_64-unknown-linux-gnu note: compiler flags: --crate-type lib -Z incremental -Z self-profile=/tmp/.tmpR27TDg/self-profile-output note: some of the compiler flags provided by cargo are hidden query stack during panic: Caused by: stdout=6460071822;;instructions:u;1249486087;100.00;1.44;insn per cycle;;
|
@rylev |
Fixed in #95681. |
resolve: Fix resolution of empty paths passed from rustdoc Fixes rust-lang#95337 (comment)
resolve: Fix resolution of empty paths passed from rustdoc Fixes rust-lang#95337 (comment)
Resolve
crate::foo
paths transparently to rustdoc, so their resolution no longer affects diagnostics and modules used for determining traits in scope.The proper solution is to account for the current
module_id
/parent_scope
infn resolve_crate_root
, but it's a slightly larger compiler changes. This PR moves the code closer to it, but keeps it rustdoc-specific.Fixes #78696
Fixes #94924