mejrs
c2916be8d7
Permit {This} in diagnostic attribute format literals
2026-04-24 19:59:32 +02:00
yukang
8d75f0cbfc
add on_unmatch_args
2026-04-22 19:28:44 +08:00
mejrs
80fb0aa44e
Move diagnostic::do_not_recommend target checking
2026-04-21 11:30:00 +02:00
bors
12f35ad39e
Auto merge of #155209 - JonathanBrouwer:attr_cleanup2, r=jdonszelmann
...
Post-attribute ports cleanup pt. 1 (again)
This is a re-implementation of most (but not all) of https://github.com/rust-lang/rust/pull/154808
The code is the same as in that PR, other than a few changes, I'll leave comments where I changed things.
I did re-implement most of the commits rather than cherry-picking, so it's probably good to check the entire diff regardless
r? @jdonszelmann
2026-04-14 08:59:40 +00:00
Jonathan Brouwer
da8cf97e64
Remove AttributeDuplicates from BUILTIN_ATTRIBUTES
2026-04-13 20:51:24 +02:00
bors
17584a1819
Auto merge of #155253 - JonathanBrouwer:rollup-lERdTAB, r=JonathanBrouwer
...
Rollup of 19 pull requests
Successful merges:
- rust-lang/rust#155162 (relnotes for 1.95)
- rust-lang/rust#140763 (Change codegen of LLVM intrinsics to be name-based, and add llvm linkage support for `bf16(xN)` and `i1xN`)
- rust-lang/rust#153604 (Fix thread::available_parallelism on WASI targets with threads)
- rust-lang/rust#154193 (Implement EII for statics)
- rust-lang/rust#154389 (Add more robust handling of nested query cycles)
- rust-lang/rust#154435 (resolve: Some import resolution cleanups)
- rust-lang/rust#155236 (Normalize individual predicate of `InstantiatedPredicates` inside `predicates_for_generics`)
- rust-lang/rust#155243 (cg_ssa: transmute between scalable vectors)
- rust-lang/rust#153941 (tests/debuginfo/basic-stepping.rs: Explain why all lines are not steppable)
- rust-lang/rust#154587 (Add --verbose-run-make-subprocess-output flag to suppress verbose run-make output for passing tests)
- rust-lang/rust#154624 (Make `DerefPure` dyn-incompatible)
- rust-lang/rust#154929 (Add `const Default` impls for `LazyCell` and `LazyLock`)
- rust-lang/rust#154944 (Small refactor of `arena_cache` query values)
- rust-lang/rust#155055 (UI automation)
- rust-lang/rust#155062 (Move tests from `tests/ui/issues/` to appropriate directories)
- rust-lang/rust#155131 (Stabilize feature `uint_bit_width`)
- rust-lang/rust#155147 (Stabilize feature `int_lowest_highest_one`)
- rust-lang/rust#155174 (Improve emission of `UnknownDiagnosticAttribute` lint)
- rust-lang/rust#155194 (Fix manpage version replacement and use verbose version)
2026-04-13 18:32:47 +00:00
Oscar Bray
25a92d208d
Add #![unstable_removed(..)] attribute to track removed features
...
Move concat_idents to use the unstable_removed attribute
2026-04-12 11:18:10 +01:00
Jonathan Brouwer
607b0620e2
Analysis for externally implementable statics
2026-04-11 10:17:42 +02:00
León Orell Valerian Liehr
357f670fde
Rename #[rustc_layout] to #[rustc_dump_layout]
2026-04-10 12:13:48 +02:00
Jonathan Brouwer
65745a1b95
Revert #152369 because of multiple regressions
...
The regressions are documented in the PR comments.
This reverts commit 2972b5e , reversing changes made to f908263 .
2026-04-09 18:53:59 +02:00
Jonathan Brouwer
30107e89e6
Revert #154808 because it is based on #152369
...
This reverts commit 0c94559d48 , reversing
changes made to 33528612ba .
2026-04-09 18:32:49 +02:00
Jonathan Brouwer
eecf63c125
Remove AttributeDuplicates from BUILTIN_ATTRIBUTES
2026-04-05 11:57:05 +02:00
Edvin Bryntesson
345a3eb08b
Port #[allow], #[deny], #[expect], #[forbid], #[warn] to attr parser
...
also changes method `parse_limited_all` to take Iterator as an input,
to avoid needing to do expensive allocation
2026-04-03 11:08:10 +02:00
Sasha Pourcelot
1c6a8feef8
check earlier for attributes that are placed in where predicate
2026-03-22 07:51:23 +00:00
Sasha Pourcelot
5491c3529b
check earlier for misused crate-level attributes
2026-03-22 07:51:23 +00:00
Jose
c614e3d216
linting, moving error to session diagnostics
2026-03-20 14:03:12 -04:00
Jonathan Brouwer
e106b584bd
Rollup merge of #154126 - JayanAXHF:refactor/custom_mir_parser, r=JonathanBrouwer
...
refactor(attribute parser): move check_custom_mir to attribute parser
Part of rust-lang/rust#153101
r? @JonathanBrouwer
2026-03-20 13:24:27 +01:00
JayanAXHF
5aeb2a6c45
refactor(attribute parser): move check_custom_mir to attribute parser
2026-03-20 17:28:01 +05:30
Stuart Cook
734cca0053
Rollup merge of #150935 - rperier:provide_diagnostic_on_move_for_smart_pointers, r=JonathanBrouwer
...
Introduce #[diagnostic::on_move(message)]
cc rust-lang/rust#149862
This is a first proposal. I have deliberately kept it simpler than `diagnostic::on_unimplemented`.
Few questions/remarks:
- Do I need to move the OnMoveDirective logic into a dedicated module perhaps ? let's say into compiler/rustc_borrowck/src/diagnostics/on_move.rs
- No problems to depend on crates like `rustc_ast` from the borrowck ?
- Notes are not supported yet. While message and label are very static , in the sense that they are emitted in the same way from the same place in the borrowck, it is not the case for the notes. It would make the code more complex. But, I can add support for notes if it does make sense.
Suggestions are welcomed !
2026-03-20 15:33:05 +11:00
Romain Perier
965f1e7681
Introduce #[diagnostic::on_move]
...
This might be helpful for smart pointers to explains why they aren't Copy
and what to do instead or just to let the user know that .clone() is very
cheap and can be called without a performance penalty.
2026-03-11 16:56:19 +01:00
Jynn Nelson
f1f0b4504a
downgrade duplicate features from hard-error -> deny-by-default
2026-03-10 11:56:29 +01:00
Jonathan Brouwer
783c9d3de0
Rollup merge of #149937 - jyn514:linker-info, r=mati865
...
spliit out `linker-info` from `linker-messages`
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/149937 )*
Helps with https://github.com/rust-lang/rust/issues/136096 .
2026-03-07 01:42:35 +01:00
Jonathan Brouwer
56c8de6364
Rollup merge of #153189 - JayanAXHF:refactor/check_attrs_reftor_1, r=JonathanBrouwer
...
refactor: move `check_align` to `parse_alignment`
Part of rust-lang/rust#153101
r? @JonathanBrouwer
PS: jonathan i'm not sure about what to do with `check_align` now
2026-03-06 18:49:49 +01:00
Jynn Nelson
20404bf4a6
Split out linker-info from linker-messages
...
- Hide common linker output behind `linker-info`
- Add tests
- Account for different capitalization on windows-gnu when removing
"warning" prefix
- Add some more comments
- Add macOS deployment-target test
- Ignore linker warnings from trying to statically link glibc
I don't know what's going on in `nofile-limit.rs` but I want no part
of it.
- Use a fake linker so tests are platform-independent
2026-03-06 10:38:21 +01:00
JayanAXHF
2093158de7
refactor: move check_align to parse_alignment
...
* refactor: move `check_align` from check_attrs.rs to `parse_alignment`
rel: attribute parser rework
* fix: fix error messages
* test: fix test
* fix: fix invalid error message
* ops(test): Fix CI
2026-03-05 18:46:00 +00:00
León Orell Valerian Liehr
722fcbb72e
Rename #[rustc_object_lifetime_default] to #[rustc_dump_object_lifetime_defaults]
2026-03-02 19:31:15 +01:00
Jonathan Brouwer
5cd5b90a38
Port rustc_autodiff to the attribute parsers
2026-02-26 09:50:36 +01:00
Guillaume Gomez
1c6c0f7316
Migrate rustc_trait_selection to use TyCtxt::emit_diag_node_span_lint
2026-02-24 20:25:22 +01:00
Guillaume Gomez
8f63c00038
Migrate rustc_passes to use TyCtxt::emit_diag_node_span_lint
2026-02-24 20:12:43 +01:00
mejrs
01192eb170
use raw string literal
2026-02-24 10:50:39 +01:00
mejrs
cfc2468969
Port rustc_on_unimplemented attribute
2026-02-24 10:50:38 +01:00
Jonathan Brouwer
018a5efcf7
Rename inline_fluent! to msg!
2026-02-14 13:47:52 +01:00
Jacob Pratt
22f973db34
Rollup merge of #152568 - JonathanBrouwer:port_lang, r=jdonszelmann
...
Port `#[lang]` and `#[panic_handler]` to the new attribute parsers
For https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163
r? @jdonszelmann
2026-02-13 22:26:35 -05:00
Jonathan Brouwer
c61c2603cf
Port #[lang] to the new attribute parsers
2026-02-13 16:04:19 +00:00
Jonathan Brouwer
6eb2a8fa9e
Reformat existing error messages
2026-02-09 19:12:22 +01:00
Jonathan Brouwer
99c6009c45
Reformat existing messages
2026-02-08 23:07:58 +01:00
Jonathan Brouwer
ea43035654
Convert to inline diagnostics in rustc_passes
2026-02-06 13:31:54 +01:00
Jamie Hill-Daniel
522778e348
Move query-dep-graph opt check to attr parsing
2026-02-04 21:00:37 +00:00
Jamie Hill-Daniel
94a0ba50e1
Port rustc_clean to attribute parser
...
Also remove mentions of removed `rustc_dirty`
2026-02-04 20:58:02 +00:00
Jamie Hill-Daniel
72338fafb2
Port rustc_layout to attribute parser
2026-01-29 22:23:58 +00:00
mejrs
a1e2cea685
Port do_not_recommend to new attr parsing
2026-01-13 20:43:37 +01:00
Jonathan Brouwer
a2994063d4
Rollup merge of #150943 - port_must_not_suspend, r=jdonszelmann,JonathanBrouwer
...
Port `#[must_not_suspend]` to attribute parser
Tracking issue: rust-lang/rust#131229
r? @JonathanBrouwer
2026-01-13 09:01:31 +01:00
Jonathan Brouwer
e33f5aa634
Rollup merge of #150934 - move-doc-attr-checks, r=JonathanBrouwer
...
Move some checks from `check_doc_attrs` directly into `rustc_attr_parsing`
Part of https://github.com/rust-lang/rust/issues/149865 .
I also used this opportunity to remove the `id_is_crate_root` method.
Once this is merged, I think I'll try to see if we can remove `target_id` as well.
r? @JonathanBrouwer
2026-01-13 09:01:31 +01:00
Edvin Bryntesson
418cff3ec0
Port #[must_not_suspend] to attribute parser
2026-01-12 18:16:37 +01:00
Matthias Krüger
d6621f07ae
Rollup merge of #150938 - collapse_debuginfo, r=jdonszelmann
...
Port `#[collapse_debuginfo]` to the new attribute parsing system
Tracking issue: https://github.com/rust-lang/rust/issues/131229
Felt like doing one again, has been a while :3
r? @jdonszelmann
2026-01-12 00:02:54 +01:00
Guillaume Gomez
ef1e4e65b7
Move checks from check_doc_attrs directly into rustc_attr_parsing
2026-01-11 18:36:03 +01:00
Jonathan Brouwer
b5dd72d292
Port #[collapse_debuginfo] to the new attribute parsing system
2026-01-11 10:54:45 +01:00
Edvin Bryntesson
76fcac2371
Port #[rustc_has_incoherent_inherent_impls] to attribute parser
2026-01-10 23:58:03 +01:00
Edvin Bryntesson
94e16291e0
Port #[rustc_must_implement_one_of] to attribute parser
2025-12-26 19:08:21 +01:00
Edvin Bryntesson
120f0d4f07
Port #[thread_local] to attribute parser
2025-12-20 15:38:42 +01:00