Add explanatory note to 'expected item' error#115473
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 6, 2023
Merged
Conversation
Collaborator
|
r? @nnethercote (rustbot has picked a reviewer for you, use r? to override) |
Contributor
Author
|
@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
Contributor
Author
Contributor
Author
|
@rustbot review |
sam0x17
approved these changes
Sep 3, 2023
Contributor
Author
Contributor
Collaborator
|
📌 Commit 691362831f96dc14213e95f420a625d2dcd4a35a has been approved by It is now in the queue for this repository. |
Contributor
|
actually wait i'm not totally satisfied with the phrasing @bors r- |
Contributor
There was a problem hiding this comment.
Suggested change
| .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") |
Comment on lines
84
to
85
Contributor
There was a problem hiding this comment.
or maybe we should just consolidate this into one note:
Suggested change
| .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>"); |
Contributor
Author
There was a problem hiding this comment.
Let me make this change, update tests and push.
Contributor
Author
6913628 to
6a286e7
Compare
Contributor
Author
|
@rustbot review |
Contributor
|
@bors r+ rollup |
Collaborator
fmease
added a commit
to fmease/rust
that referenced
this pull request
Sep 6, 2023
…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 ```
sam0x17
approved these changes
Sep 6, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 6, 2023
…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
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 #113110
It changes the diagnostic from this:
to this: