-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"help: }
may belong here" no longer reported
#108608
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
Comments
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-low |
Yes, it is a know issue for last PR(we have UI test for it).
Given an unclosed delimiter issue, for example, this code: use std::{mem;
fn main() {
assert_eq!(4, mem::size_of::<i32>());
} Stable version will also give the help to add another error: expected one of `,`, `::`, `as`, or `}`, found `;`
--> src/main.rs:1:10
|
1 | use std::{mem;
| ^ ^
| | |
| | expected one of `,`, `::`, `as`, or `}`
| | help: `}` may belong here
| unclosed delimiter while the better way to fix it is removing the And the output from your description is much more confusing, since user didn't input a error: expected item, found `}`
--> src/main.rs:1:20
|
1 | use std::{mem, ptr;
| ^ expected item |
Another case that mismatch delimiter can not be handled well: fn bar() -> [u8; 2] {
foo()
[1, 3)
}
fn main() {} The stable compiler output: error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> src/main.rs:4:5
|
4 | [1, 3)
| ^ ^ help: `]` may belong here
| |
| unclosed delimiter |
Our diagnostics are unstable. Changes in them are not automatically considered regressions (at least, not without some other detail). As this was an intentional change which yields an improvement in other ways, I am inclined to class this as a non-issue. |
Closing this as it was an intentional change and cannot be considered a regression. |
After #108297, the help message for inserting closing delims is no longer emitted. (cc @chenyukang)
Code
I tried this code:
old output:
new output
While noisy, the old output contains a concrete fix (
}
may belong here) and the new one doesn't.Version it worked on
It most recently worked on: rustc 1.69.0-nightly (31f858d 2023-02-28)
Version with regression
master at 64165aa, which will be in nightly 2023-03-01
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged +A-parser +A-diagnostics
The text was updated successfully, but these errors were encountered: