Fix stray notes when the source code is not available#87088
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 11, 2021
Merged
Fix stray notes when the source code is not available#87088bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
Collaborator
|
☔ The latest upstream changes (presumably #80522) made this pull request unmergeable. Please resolve the merge conflicts. |
Member
|
Any way to write a test for this? |
estebank
approved these changes
Sep 9, 2021
Comment on lines
195
to
203
Contributor
There was a problem hiding this comment.
It would be nice if we could add something akin to span_note_with_alternative so that we could provide a fallback span.
8a9a78f to
57fcb2e
Compare
Member
|
@bors r=estebank |
Collaborator
|
📌 Commit 57fcb2e has been approved by |
Collaborator
|
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
Contributor
It would likely require a |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 11, 2021
…arth Rollup of 15 pull requests Successful merges: - rust-lang#85200 (Ignore derived Clone and Debug implementations during dead code analysis) - rust-lang#86165 (Add proc_macro::Span::{before, after}.) - rust-lang#87088 (Fix stray notes when the source code is not available) - rust-lang#87441 (Emit suggestion when passing byte literal to format macro) - rust-lang#88546 (Emit proper errors when on missing closure braces) - rust-lang#88578 (fix(rustc): suggest `items` be borrowed in `for i in items[x..]`) - rust-lang#88632 (Fix issues with Markdown summary options) - rust-lang#88639 (rustdoc: Fix ICE with `doc(hidden)` on tuple variant fields) - rust-lang#88667 (Tweak `write_fmt` doc.) - rust-lang#88720 (Rustdoc coverage fields count) - rust-lang#88732 (RustWrapper: avoid deleted unclear attribute methods) - rust-lang#88742 (Fix table in docblocks) - rust-lang#88776 (Workaround blink/chromium grid layout limitation of 1000 rows) - rust-lang#88807 (Fix typo in docs for iterators) - rust-lang#88812 (Fix typo `option` -> `options`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Sep 28, 2021
Hide `<...> defined here` note if the source is not available Fixes rust-lang#89159. Similar to rust-lang#87088. r? `@estebank`
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Sep 28, 2021
Hide `<...> defined here` note if the source is not available Fixes rust-lang#89159. Similar to rust-lang#87088. r? ``@estebank``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 1, 2021
…l, r=cjgillot Improve error message for `E0659` if the source is not available Fixes rust-lang#91028. The fix is similar to those in rust-lang#89233 and rust-lang#87088. With this change, instead of the dangling ``` note: `Option` could also refer to the enum defined here ``` I get ``` note: `Option` could also refer to an enum from prelude ``` If the standard library source code _is_ available, the output does not change.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 1, 2021
…l, r=cjgillot Improve error message for `E0659` if the source is not available Fixes rust-lang#91028. The fix is similar to those in rust-lang#89233 and rust-lang#87088. With this change, instead of the dangling ``` note: `Option` could also refer to the enum defined here ``` I get ``` note: `Option` could also refer to an enum from prelude ``` If the standard library source code _is_ available, the output does not change.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Dec 1, 2021
…l, r=cjgillot Improve error message for `E0659` if the source is not available Fixes rust-lang#91028. The fix is similar to those in rust-lang#89233 and rust-lang#87088. With this change, instead of the dangling ``` note: `Option` could also refer to the enum defined here ``` I get ``` note: `Option` could also refer to an enum from prelude ``` If the standard library source code _is_ available, the output does not change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #87060. To reproduce it with a local build of rustc, you have to copy the compiler (e.g.
build/x86_64-unknown-linux-gnu/stage1/) somewhere and then rename the compiler source directory (maybe there is a smarter way as well). Then, rustc won't find the standard library sources and report stray notes such aswith no location for "here". Another example I've found is this:
where, again, the note is supposed to point somewhere but doesn't. I have fixed this by checking whether the corresponding source code is actually available before emitting the note.