Open Rageking8 opened 2 years ago
Did not bisect, but this is probably caused by #100334.
LOL at the new suggestion
anyway, yes confirmed the bisection points to a rollup merge with contains #100334 cc @TaKO8Ki
searched nightlies: from nightly-2022-07-13 to nightly-2022-09-06 regressed nightly: nightly-2022-08-11 searched commit range: https://github.com/rust-lang/rust/compare/34a6cae28e7013ff0e640026a8e46f315426829d...29e4a9ee0253cd39e552a77f51f11f9a5f1c41e6 regressed commit: https://github.com/rust-lang/rust/commit/1603a70f82240ba2d27f72f964e36614d7620ad3
I'll try to dig further back in time to find where we lost the correct diagnostic message
EDIT: the diagnostic we had previously was introduced in Rust 1.18 so basically I think we never really suggested the right thing ("adding the !
when invoking the vec macro incorrectly as with other macros.")
The regression that causes the compiler to emit the invalid help suggestion is fixed by #101502 Hence, the current output error message is:
Compiling playground v0.0.1 (/playground)
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> src/main.rs:2:19
|
2 | let _x = vec[1, 2, 3];
| ^ expected one of `.`, `?`, `]`, or an operator
error: could not compile `playground` due to previous error
However, as mentioned in the top of this issue, it is still not ideal.
Therefore, "suggest adding the !
when invoking the vec
macro incorrectly as with other macros." this part still needs to get implemented.
Doing the "correct" thing and emitting an always correct "add !
here" suggestion will require delaying a parse error until resolution is available, which is quite hard to do. Alternatively, we could customize the check to tentatively mention macros when encountering ident[<parse error>
not dissimilar to how we treat ident{<parse error>
.
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-low +regression-from-stable-to-stable -regression-from-stable-to-nightly
The current output is back to what it originally was
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> src/main.rs:2:19
|
2 | let _x = vec[1, 2, 3];
| ^ expected one of `.`, `?`, `]`, or an operator
I don't think it qualifies as a regression anymore, but it would be great still to make the output be the following instead
error: missing `!` in macro invokation
--> src/main.rs:2:19
|
2 | let _x = vec[1, 2, 3];
| ^ expected a `!` here
Given the following code: link
The current output is:
Just for some context this is the current error message for the stable and beta versions:
Which is also not ideal as for the other std macros AFAIK (only checked a few), incorrect usage (i.e. without the
!
) will lead to a help suggestion informing the user to include a!
to invoke a macro (e.g.print
,println
).Hence, the ideal output is to suggest adding the
!
when invoking thevec
macro incorrectly as with other macros.@rustbot label +regression-from-stable-to-nightly +D-invalid-suggestion
May need a bisect.