-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve -Z crate-attr
diagnostics
#138336
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
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 |
86072ff
to
42b890b
Compare
42b890b
to
4a301c7
Compare
👋 @estebank do you know when you'll get a chance to look at this? would you like me to assign a different reviewer? |
☔ The latest upstream changes (presumably #139137) made this pull request unmergeable. Please resolve the merge conflicts. |
r? diagnostics |
Needs a rebase, but otherwise r=me @rustbot author |
Reminder, once the PR becomes ready for a review, use |
4a301c7
to
18cdd59
Compare
This comment has been minimized.
This comment has been minimized.
- 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.
18cdd59
to
d50a8d5
Compare
@bors r+ rollup |
Rollup of 9 pull requests Successful merges: - rust-lang#138336 (Improve `-Z crate-attr` diagnostics) - rust-lang#139636 (Encode dep node edge count as u32 instead of usize) - rust-lang#139666 (cleanup `mir_borrowck`) - rust-lang#139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout) - rust-lang#139699 (Proactively update coroutine drop shim's phase to account for later passes applied during shim query) - rust-lang#139718 (enforce unsafe attributes in pre-2024 editions by default) - rust-lang#139722 (Move some things to rustc_type_ir) - rust-lang#139760 (UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible) - rust-lang#139776 (Switch attrs to `diagnostic::on_unimplemented`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138336 - jyn514:crate-attr-diagnostics, r=compiler-errors Improve `-Z crate-attr` diagnostics - 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. r? diagnostics
#![ ... ]
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