-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve -Z crate-attr
diagnostics
#138336
base: master
Are you sure you want to change the base?
Conversation
5e4599d
to
2d05a27
Compare
7fc52b8
to
74e6e2d
Compare
This comment has been minimized.
This comment has been minimized.
74e6e2d
to
4b25b06
Compare
All kind of code injected by rustc consistently lives in |
This comment has been minimized.
This comment has been minimized.
4b25b06
to
86072ff
Compare
ok, done. fortunately |
- Show the `#![ ... ]` in the span (to make it clear that it should not be included in the CLI argument) - Show more detailed errors when the crate has valid token trees but invalid syntax. Previously, `crate-attr=feature(foo),feature(bar)` would just say "invalid crate attribute" and point at the comma. Now, it explicitly says that the comma was unexpected, which is useful when using `--error-format=short`. It also fixes the column to show the correct span. - Recover from parse errors. Previously we would abort immediately on syntax errors; now we go on to try and type-check the rest of the crate. The new diagnostic code also happens to be slightly shorter.
86072ff
to
42b890b
Compare
42b890b
to
4a301c7
Compare
#![ ... ]
in the span (to make it clear that it should notbe included in the CLI argument)
invalid syntax.
Previously,
crate-attr=feature(foo),feature(bar)
would just say"invalid crate attribute" and point at the comma. Now, it explicitly
says that the comma was unexpected, which is useful when using
--error-format=short
. It also fixes the column to show the correctspan.
syntax errors; now we go on to try and type-check the rest of the
crate.
The new diagnostic code also happens to be slightly shorter.
r? diagnostics