-
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
Add explanatory note to 'expected item' error #115473
Conversation
r? @nnethercote (rustbot has picked a reviewer for you, use r? to override) |
@rustbot label -S-waiting-on-review +S-waiting-on-author |
This comment has been minimized.
This comment has been minimized.
17fd171
to
70e22f4
Compare
This comment has been minimized.
This comment has been minimized.
70e22f4
to
c32c6a1
Compare
This comment has been minimized.
This comment has been minimized.
c32c6a1
to
6913628
Compare
@rustbot review |
📌 Commit 691362831f96dc14213e95f420a625d2dcd4a35a has been approved by It is now in the queue for this repository. |
actually wait i'm not totally satisfied with the phrasing @bors r- |
} else { | ||
"expected item" | ||
err.span_label(span, "expected item") | ||
.note("items are things that can appear at the root of a module") |
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.
.note("items are things that can appear at the root of a module") | |
.note("items are declarations that can appear at the root of a module") |
.note("items are things that can appear at the root of a module") | ||
.note("for a full list see https://doc.rust-lang.org/reference/items.html"); |
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.
or maybe we should just consolidate this into one note:
.note("items are things that can appear at the root of a module") | |
.note("for a full list see https://doc.rust-lang.org/reference/items.html"); | |
.note("for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>"); |
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.
Let me make this change, update tests and push.
6913628
to
6a286e7
Compare
@rustbot review |
@bors r+ rollup |
…iler-errors Add explanatory note to 'expected item' error Fixes rust-lang#113110 It changes the diagnostic from this: ``` error: expected item, found `5` --> ../test.rs:1:1 | 1 | 5 | ^ expected item ``` to this: ``` error: expected item, found `5` --> ../test.rs:1:1 | 1 | 5 | ^ expected item | = note: items are things that can appear at the root of a module = note: for a full list see https://doc.rust-lang.org/reference/items.html ```
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#114511 (Remove the unhelpful let binding diag comes from FormatArguments) - rust-lang#115473 (Add explanatory note to 'expected item' error) - rust-lang#115574 (Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`) - rust-lang#115578 (Clarify cryptic comments) - rust-lang#115587 (fix rust-lang#115348) - rust-lang#115596 (A small change) - rust-lang#115598 (Fix log formatting in bootstrap) - rust-lang#115605 (Better Debug for `Ty` in smir) - rust-lang#115614 (Fix minor grammar typo) r? `@ghost` `@rustbot` modify labels: rollup
Fixes #113110
It changes the diagnostic from this:
to this: