Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
1d2dbb6
impl
asukaminato0721 Dec 20, 2025
e0abac4
feat: folding ranges for chained expressions
roife Jun 30, 2025
d2634dc
refactor: enhance folding range handling for statements and tail expr…
roife Jun 30, 2025
b6b3ebd
Bump perf-event from 0.4.7. to 0.4.8
robertoaloi Jan 21, 2026
8655e5c
Publish no-server to Code Marketplace and OpenVSX
Master-Hash Jan 24, 2026
ab001b9
Fix extract function invalid self param
A4-Tacks Mar 2, 2026
b5739f1
Add a fixme
A4-Tacks Mar 2, 2026
f225909
fix: Stale diagnostics when a custom check command is configured
Wilfred Mar 3, 2026
9dfb3ac
make matching brace almost always proc
bend-n Mar 10, 2026
c387003
test
bend-n Mar 10, 2026
381e582
fix: Improve inserted order for trait_impl_redundant_assoc_item
A4-Tacks Feb 22, 2026
0793033
add path_from_idents and token_tree_from_node in SyntaxFactory
Shourya742 Mar 26, 2026
e646424
remove usage of make with SyntaxFactory in utils/gen_trait_fn_body
Shourya742 Mar 26, 2026
ec99ccb
add generate_trait_impl_with_item in utils
Shourya742 Mar 26, 2026
2a894c9
make changes to replace_derive_with_manual_impl to update changes to …
Shourya742 Mar 26, 2026
d7aada6
make changes to add_missing_impl_members to update changes to utils
Shourya742 Mar 26, 2026
ce4bc58
Extract trait_name out of analyze_container
A4-Tacks Mar 28, 2026
5d9a476
Change to lazy for make_this_param
A4-Tacks Mar 28, 2026
d3868dd
feat: add expected name on simple enum variant
A4-Tacks Mar 28, 2026
e38074e
fix: complete envs in nested `env!()`
A4-Tacks Mar 28, 2026
064cbfd
Remove redundant fallback state in include_references
A4-Tacks Mar 29, 2026
9eb2c67
fix: postfix completions include nots prefix-expr
A4-Tacks Mar 29, 2026
c2886b2
Allow disabling all fixture support
ChayimFriedman2 Mar 29, 2026
fbec93c
Merge pull request #21909 from ChayimFriedman2/disable-fixtures
ShoyuVanilla Mar 30, 2026
12439cb
Prepare for merging from rust-lang/rust
invalid-email-address Mar 30, 2026
f8b362a
Merge ref '80ad55752e5a' from rust-lang/rust
invalid-email-address Mar 30, 2026
fea223f
Merge pull request #21911 from rust-lang/rustc-pull
lnicola Mar 30, 2026
e82a380
fix: Correct missing-args messages for sched_getaffinity and getenv s…
cuiweixie Mar 26, 2026
183d948
Merge pull request #21881 from cuiweixie/fix/shim-libc-missing-args-m…
lnicola Mar 30, 2026
d29df23
feat: offer with else-branch on tail-expr
A4-Tacks Mar 30, 2026
e45ac4b
accept make::ext:path_from_indents for Syntaxfactory constructor and …
Shourya742 Mar 30, 2026
b56bca0
Merge pull request #21886 from Shourya742/2026-03-26-migrate-gen-trai…
A4-Tacks Mar 30, 2026
5e21b17
fix doc link
Shourya742 Mar 30, 2026
e291ef0
Merge pull request #21913 from Shourya742/2026-03-30-fix-doc-ci
ChayimFriedman2 Mar 30, 2026
a17645a
Merge pull request #21902 from A4-Tacks/nested-env-macro
ChayimFriedman2 Mar 30, 2026
a30ceb8
Merge pull request #21903 from A4-Tacks/postfix-include-nots
ChayimFriedman2 Mar 30, 2026
f8c9427
Fix a cycle in bounds lowering
ChayimFriedman2 Mar 30, 2026
1c0f4cd
Merge pull request #21695 from A4-Tacks/redundant-item-order
ChayimFriedman2 Mar 31, 2026
4e44f51
Merge pull request #21322 from asukaminato0721/4318
ChayimFriedman2 Mar 31, 2026
d08892e
implement `feature(more_qualified_paths)`
WaffleLapkin Mar 31, 2026
0640f1e
Merge pull request #19956 from WaffleLapkin/more_qualified_paths
ChayimFriedman2 Mar 31, 2026
422b7d2
Merge pull request #21892 from A4-Tacks/enum-variant-expect-name
ChayimFriedman2 Mar 31, 2026
eec50b9
Add a test for convert tail-expr to continue
A4-Tacks Mar 31, 2026
8f48f98
Merge pull request #20864 from A4-Tacks/extract-method-in-trait
ChayimFriedman2 Mar 31, 2026
d10682b
Merge pull request #19659 from roife/fold-chained-expr
ChayimFriedman2 Mar 31, 2026
5d6e0df
Merge pull request #21912 from A4-Tacks/conv-guarded-tail-expr-else
ChayimFriedman2 Mar 31, 2026
5e1b388
Bump @vscode/vsce and ovsx
lnicola Mar 31, 2026
7018cfd
Merge pull request #21916 from lnicola/bump-vsce-ovsx
lnicola Mar 31, 2026
96f289b
Merge pull request #21516 from Master-Hash/fix-18578
lnicola Mar 31, 2026
57ef70f
internal: Document when crate cycles can occur
Wilfred Mar 12, 2026
3afed9e
feat: support labeled block for convert_to_guarded_return
A4-Tacks Mar 31, 2026
2dea90f
fix: Set VS Code extension kind explicitly
Wilfred Mar 31, 2026
f28056f
fix: Use the correct project root when there are multiple workspaces
Wilfred Feb 19, 2026
c987835
internal: Split absolute path collection from reading files
Wilfred Mar 19, 2026
76e7fb9
fix: Support filesystems that don't send Create events
Wilfred Mar 19, 2026
f3dcff6
Update neovim LSP instructions for neovim 0.11+
erfanio Mar 31, 2026
d64a1b2
Merge pull request #21844 from Wilfred/watch_fuse_files
ChayimFriedman2 Apr 1, 2026
4a58c0f
Merge pull request #21806 from Wilfred/dont_warn_on_cyclic_deps
ChayimFriedman2 Apr 1, 2026
d3d3c5f
Merge pull request #21915 from ChayimFriedman2/hang
ShoyuVanilla Apr 1, 2026
8f892ec
Merge pull request #21924 from erfanio/master
ShoyuVanilla Apr 1, 2026
76d4fb2
fix: Not suggest name in nested type in variant
A4-Tacks Apr 1, 2026
789fc4a
Merge pull request #21923 from Wilfred/vscode_extension_kind
lnicola Apr 1, 2026
a73252f
feat: support macro expansion in `#[doc = ...]` attributes
so1ve Apr 1, 2026
4c22d0d
update tests
so1ve Apr 1, 2026
2ca6c7d
chore: fix clippy
so1ve Apr 1, 2026
74fa516
tests: add `include_str` test
so1ve Apr 1, 2026
0f9a616
fix: handle `ParenExpr` correctly
so1ve Apr 1, 2026
99d0c35
Fix rustc-pull CI workflow
Kobzol Apr 1, 2026
a34da5b
Merge pull request #21929 from Kobzol/ci-pr-author
lnicola Apr 1, 2026
6fc3880
hwaddress: automatically add -Ctarget-feature=tagged-globals
Darksonn Apr 1, 2026
3dab2d3
use factory variant of add_trait_assoc_items_to_impl in generate_impl
Shourya742 Apr 1, 2026
0764340
replace factory variant of add_trait_assoc_items_to_impl, as the main…
Shourya742 Apr 1, 2026
5325fe3
Merge pull request #21930 from Shourya742/2026-04-01-replace-add_trai…
A4-Tacks Apr 2, 2026
985ec34
Merge pull request #21922 from Wilfred/proper_workspace_root
Veykril Apr 2, 2026
23fe3af
internal: Ensure tracing is configured in slow tests
Wilfred Apr 2, 2026
a21d450
Merge pull request #21933 from Wilfred/logging_in_slow_tests
ShoyuVanilla Apr 2, 2026
2aefa3c
Support cfg-ing array elements
ChayimFriedman2 Apr 2, 2026
1676a45
Merge pull request #21935 from ChayimFriedman2/array-elem-cfg
ShoyuVanilla Apr 3, 2026
440655d
Merge pull request #21927 from A4-Tacks/no-expect-name-nested
ChayimFriedman2 Apr 3, 2026
2102983
make deep clones of insertion/replacement nodes in edit flow itself
Shourya742 Apr 2, 2026
5057a44
remove clone_for_update from iniline_type_alias
Shourya742 Apr 2, 2026
0366323
fix: Fix extract variable on arg with comma
A4-Tacks Apr 3, 2026
4b42f62
fix: wrap parentheses on guard for replace_if_let_with_match
A4-Tacks Apr 3, 2026
8461456
fix: Fix indent for convert_let_else_to_match
A4-Tacks Apr 3, 2026
b484164
Merge pull request #21937 from A4-Tacks/wrap-paren-if-let-with-match
ChayimFriedman2 Apr 3, 2026
81bb240
Merge pull request #21938 from A4-Tacks/indent-let-else-to-match
ChayimFriedman2 Apr 3, 2026
ad5baa4
refactor: remove TestAttr and pass --include-ignored to test runnables
Amit5601 Apr 3, 2026
b2c6beb
Add ArgList::args_maybe_empty to node_ext
A4-Tacks Apr 3, 2026
fcd9c36
fix: Fix param inlayHints on empty expr and comma
A4-Tacks Apr 1, 2026
f3a108a
test: update hover test to include multiple lines of documentation
so1ve Apr 3, 2026
4e023db
Merge pull request #21921 from Amit5601/fix-test-ignored-flag
ChayimFriedman2 Apr 3, 2026
166f219
Merge pull request #21926 from A4-Tacks/inlayhint-empty-arg
ChayimFriedman2 Apr 3, 2026
77d9613
fix: support multiple snippet placeholders in VS Code extension
Amit5601 Apr 3, 2026
1e90d90
update rowan from 0.15.17 to 0.15.18
Shourya742 Apr 3, 2026
acb162e
fix: silence type mismatch diagnostic when type is unknown
Amit5601 Apr 3, 2026
9f5def0
use is_mutable to check and update node accordingly
Shourya742 Apr 3, 2026
256ea68
fix: adjust review comments
so1ve Apr 3, 2026
a7790ba
fix clippy
so1ve Apr 3, 2026
f1300e6
update
so1ve Apr 3, 2026
1617d73
Update crates/hir-def/src/attrs.rs
so1ve Apr 3, 2026
c7963af
apply suggestions
so1ve Apr 3, 2026
9fb980e
Port parse query to newstyle
Veykril Apr 3, 2026
bd8cb7b
Remove `RootQueryDb`
Veykril Apr 3, 2026
964481b
Update fixtures
Veykril Apr 3, 2026
3d38654
align with rustc behavior
so1ve Apr 3, 2026
f44ca84
chore: fmt
so1ve Apr 3, 2026
b9acba6
Merge pull request #21928 from so1ve/feat/doc-macros
ChayimFriedman2 Apr 3, 2026
7ec9d2f
Merge pull request #21931 from Shourya742/2026-04-02-deep-clone-durin…
ChayimFriedman2 Apr 3, 2026
bb3cb70
Merge pull request #21942 from Amit5601/fix-unknown-mismatch
ChayimFriedman2 Apr 3, 2026
65c27e2
chore(deps): bump lodash from 4.17.23 to 4.18.1 in /editors/code
dependabot[bot] Apr 3, 2026
a846922
Merge pull request #21946 from rust-lang/dependabot/npm_and_yarn/edit…
Veykril Apr 3, 2026
119a409
Merge pull request #21944 from Veykril/push-spxqtymwtzvk
Veykril Apr 3, 2026
221c39a
Add myself as co-maintainer for hexagon-unknown-linux-musl
Apr 3, 2026
44c7139
fix: report `expected type, found {` in parser
Amit5601 Apr 4, 2026
7a66176
fix: offer 'type_mismatch' some fixes inside macro
A4-Tacks Apr 4, 2026
0aee25f
fix: offer on empty else block for 'convert_let_else_to_match'
A4-Tacks Apr 4, 2026
72f00dd
fix: add semicolon for postfix format unit like snippets
A4-Tacks Apr 4, 2026
ddea726
update syntaxEditor constructor to make sure caller doesn't need to t…
Shourya742 Apr 5, 2026
cb130c7
update utils with new syntaxEditor constructor
Shourya742 Apr 5, 2026
43f966a
update all assist with new constructor semantics
Shourya742 Apr 5, 2026
65157a2
update ide-db with new syntaxEditor
Shourya742 Apr 5, 2026
3dd6020
update syntax with new syntaxeditor
Shourya742 Apr 5, 2026
3233027
Merge pull request #21940 from Amit5601/fix-vscode-snippets
ChayimFriedman2 Apr 5, 2026
7f8e75a
Merge pull request #21954 from A4-Tacks/letelse-with-match-empty-else
ChayimFriedman2 Apr 5, 2026
fe2428e
Merge pull request #21951 from Amit5601/fix-parser-return-type
ChayimFriedman2 Apr 5, 2026
e915358
Merge pull request #21936 from A4-Tacks/extract-arg-with-comma
ChayimFriedman2 Apr 5, 2026
0bf25e6
Merge pull request #21919 from A4-Tacks/label-block-guarded
ChayimFriedman2 Apr 5, 2026
e83c0e7
Merge pull request #21792 from bend-n/make-matching-brace-almost-alwa…
ChayimFriedman2 Apr 5, 2026
cface56
Merge pull request #21502 from robertoaloi/ra-bump-perf-event
ChayimFriedman2 Apr 5, 2026
fc2f177
Fix SyntaxEditor upmapping of nodes with mapped ancestor that aren't …
ChayimFriedman2 Apr 6, 2026
8158fb0
impl part of the pattern
asukaminato0721 Apr 1, 2026
15a5b39
Merge pull request #21957 from asukaminato0721/1665
ChayimFriedman2 Apr 6, 2026
0f328eb
Renames a constant variable name
A4-Tacks Apr 6, 2026
b00e640
Merge pull request #21955 from A4-Tacks/postfix-format-semi
A4-Tacks Apr 6, 2026
f170efd
fix: load rust-analyzer.toml for virtual workspaces
Madoshakalaka Apr 6, 2026
ca2043b
Merge pull request #21704 from Madoshakalaka/fix/ratoml-virtual-works…
ChayimFriedman2 Apr 6, 2026
f5913b4
add typed syntax editor constructor API
Shourya742 Apr 6, 2026
3021aec
Improve TypeScript code
ChayimFriedman2 Apr 6, 2026
9347844
start using typed syntaxEditor constructor
Shourya742 Apr 6, 2026
efee881
rename from new_typed to with_ast_node
Shourya742 Apr 6, 2026
04499e5
Merge pull request #21738 from Wilfred/custom_check_command_stale_dia…
Veykril Apr 6, 2026
1b7332d
call new method directly from with_ast_node and improve comments
Shourya742 Apr 6, 2026
d1e8584
Merge pull request #21963 from ChayimFriedman2/ts-improve
lnicola Apr 6, 2026
f4b0e75
Merge pull request #21962 from ChayimFriedman2/fix-syntaxeditor
ChayimFriedman2 Apr 6, 2026
20d5d3a
Merge pull request #21960 from Shourya742/2026-04-04-move-syntax-tree…
ChayimFriedman2 Apr 6, 2026
2e54741
vfs::ChangeKind is Clone, Copy, Hash
BenjaminBrienen Apr 6, 2026
bd51cd1
add md into vfs
asukaminato0721 Apr 6, 2026
0006c4d
Merge pull request #21967 from BenjaminBrienen/ChangeKind
ChayimFriedman2 Apr 6, 2026
b432149
Merge pull request #21968 from asukaminato0721/21928
lnicola Apr 6, 2026
4c79065
fix: Reload when documentation changes
PRO-2684 Apr 6, 2026
7918ea0
Add optional thin-arrow ret-type for fn-item
A4-Tacks Nov 10, 2025
c2818e8
Add `adds_text` to completion item builder
A4-Tacks Apr 6, 2026
bfc9030
Implement thin-arrow completion in fn return position
A4-Tacks Nov 10, 2025
551cf63
Remove a ide-typing test
A4-Tacks Nov 10, 2025
592311d
Merge pull request #21012 from A4-Tacks/comp-ret-type-arrow
ChayimFriedman2 Apr 6, 2026
ad0d066
Check coercion, not unification, in "Fill struct fields", as the crit…
ChayimFriedman2 Apr 6, 2026
5e903ea
fix: Resolve
PRO-2684 Apr 6, 2026
d910984
Merge pull request #21970 from PRO-2684/patch-1
ChayimFriedman2 Apr 6, 2026
712755b
Merge pull request #21952 from A4-Tacks/macro-call-ty-mismatch-fixes
A4-Tacks Apr 6, 2026
87c3b44
remove redundant clone_subtree
Shourya742 Apr 6, 2026
f6772e1
Consider the context of the path for `ImportAssets`
ChayimFriedman2 Apr 6, 2026
99e7ace
Merge pull request #21972 from Shourya742/2026-04-06-remove-redundant…
ChayimFriedman2 Apr 6, 2026
dfc2fdf
edit_algo only handled the node mutability scenario earlier, this com…
Shourya742 Apr 6, 2026
3457b5e
remove redundant clone_for_update in assign as well
Shourya742 Apr 6, 2026
619a328
feat: cargo metadata takes extra args
pratham-srivastava-07 Apr 6, 2026
b2a3e5f
Merge pull request #21964 from pratham-srivastava-07/pratham/cargo-meta
ChayimFriedman2 Apr 6, 2026
8609572
feat: add ${exact} and ${include_ignored} placeholders to overrideCom…
shorwood Apr 6, 2026
c0a3fd5
changes to Cargo config should always refresh
BenjaminBrienen Apr 7, 2026
4fc8ded
Diagnose cfged-out crate
ChayimFriedman2 Apr 7, 2026
3350dae
fix: Improve add some on block like expression
A4-Tacks Apr 4, 2026
c963c13
Merge pull request #21953 from A4-Tacks/add-some-instead-wrap-some
ChayimFriedman2 Apr 7, 2026
fe134ed
minor: Fix self kw is snippet in type location
A4-Tacks Apr 7, 2026
70e0429
acquire parent directly via Some()
Shourya742 Apr 7, 2026
91acc5f
Merge pull request #21975 from Shourya742/2026-04-06-handle-token-mut…
ChayimFriedman2 Apr 7, 2026
efe858a
fix: Use the official npm mirror for all VS Code dependencies
Wilfred Apr 7, 2026
eb708d6
internal: Fix lsp_ext field name for RecursiveMemoryLayoutNode
A4-Tacks Apr 7, 2026
bcfd032
fix: Improve label on add_missing_match_arms assist
Wilfred Mar 31, 2026
772d962
fix: update exact and include_ignored flags
shorwood Apr 7, 2026
15251b5
unwrap unnecessary result return type
BenjaminBrienen Apr 7, 2026
7fc9fb9
Merge pull request #21985 from Wilfred/npm_mirror
lnicola Apr 7, 2026
abe5495
migrate generate_trait_from_impl
Shourya742 Apr 8, 2026
da404e4
add whitespace heuristics same as ted to SyntaxEditor via insert_with…
Shourya742 Apr 8, 2026
8c79284
update insert_use_with_editor_ to make use of whitespace heuristics
Shourya742 Apr 8, 2026
c42deab
migrate extract_struct_from_enum_variant to SyntaxEditor and SyntaxFa…
Shourya742 Apr 8, 2026
dc8535b
lets use syntaxFactory in migration as well
Shourya742 Apr 8, 2026
6cff92d
Use RA_TEST_ prefix in env test to avoid collisions with process env
smihica Apr 8, 2026
f573369
Fix [env] in .cargo/config.toml overriding process environment variables
smihica Apr 8, 2026
a5ba106
Add test for process env variable precedence over config.toml [env]
smihica Apr 8, 2026
0e52dc3
add get_or_create_assoc_item_list editor variant
Shourya742 Apr 8, 2026
7303772
replace make with SyntaxEditor in generate_single_field_struct_from
Shourya742 Apr 8, 2026
2f167f5
Merge pull request #21997 from Shourya742/2026-04-08-remove-make-from…
A4-Tacks Apr 8, 2026
e6f36c9
internal: add workflow to handle generating lints
dybucc Apr 3, 2026
eaeca72
Merge pull request #21988 from dybucc/ci-generated-lints
lnicola Apr 8, 2026
690d193
Break a single query cycle in the deadlock handler
Zoxc Mar 14, 2026
210a5d2
Merge pull request #21995 from smihica/fix/cargo-config-env-override
ChayimFriedman2 Apr 9, 2026
5710f42
Merge pull request #21993 from Shourya742/2026-04-08-remove-generate-…
ChayimFriedman2 Apr 9, 2026
53180ee
Merge pull request #21978 from shorwood/feat/granular-override-placeh…
ChayimFriedman2 Apr 9, 2026
9369702
Merge pull request #21982 from A4-Tacks/kw-not-snippet
ChayimFriedman2 Apr 9, 2026
50ec8ea
Merge pull request #21986 from A4-Tacks/lspext-defs-layout-node
ChayimFriedman2 Apr 9, 2026
3357945
Merge pull request #21992 from BenjaminBrienen/view-crate-graph-unwrap
ChayimFriedman2 Apr 9, 2026
f8a6be4
Merge pull request #21920 from Wilfred/claude/update-match-arms-messa…
ChayimFriedman2 Apr 9, 2026
3c48665
Merge pull request #21969 from BenjaminBrienen/reload
Veykril Apr 9, 2026
ec5d051
Merge pull request #21971 from ChayimFriedman2/fill-fields-coerce
Veykril Apr 9, 2026
b47b612
Merge pull request #21981 from ChayimFriedman2/cfg-crate
Veykril Apr 9, 2026
f493cab
Add a test for an LLVM crash "Vector elements must have same size"
jakubadamw Apr 9, 2026
12e847f
Add a test for a const evaluator ICE on a self-receiver type mismatch
jakubadamw Apr 9, 2026
fc9f492
Add a codegen test for a missed optimisation with spare niches
jakubadamw Apr 9, 2026
c254d42
Merge pull request #21973 from ChayimFriedman2/import-context
Veykril Apr 9, 2026
d383daa
Disable the fix for missing-fields when the fields are private
ChayimFriedman2 Apr 6, 2026
bbb7fad
Merge pull request #21977 from ChayimFriedman2/fill-fields-priv
ChayimFriedman2 Apr 9, 2026
9f83ca0
remove create-struct-def subeditors we don't need them and can use ma…
Shourya742 Apr 9, 2026
0fbab04
minor follow up to removing soft mode `#[unstable]`
WaffleLapkin Mar 10, 2026
6cd5315
Implement `GenericTypeVisitable` for some types
ChayimFriedman2 Apr 9, 2026
d6ce50e
Merge pull request #21996 from Shourya742/2026-04-08-migrate-extract-…
ChayimFriedman2 Apr 9, 2026
4bcf305
Introduce a `#[diagnostic::on_unknown_item]` attribute
weiznich Feb 9, 2025
a5f3c84
Address review comments
weiznich Mar 16, 2026
93f9aec
Rename the attribute to `on_unknown`
weiznich Apr 8, 2026
d024e57
Fix if branch in op.rs
malezjaa Apr 9, 2026
95852ab
Prepare for merging from rust-lang/rust
lnicola Apr 9, 2026
02b25f7
Merge ref '4c4205163abc' from rust-lang/rust
lnicola Apr 9, 2026
dbc08cf
main-termination
xonx4l Jan 19, 2026
a186638
Merge pull request #22000 from lnicola/sync-from-rust
lnicola Apr 9, 2026
0c4a94d
Rollup merge of #155046 - lnicola:sync-from-ra, r=lnicola
JonathanBrouwer Apr 9, 2026
216ccd7
Rollup merge of #152901 - weiznich:feature/on_unknown_item, r=jdonsze…
JonathanBrouwer Apr 9, 2026
0414688
Rollup merge of #154973 - Zoxc:cycle-single, r=petrochenkov
JonathanBrouwer Apr 9, 2026
2f57799
Rollup merge of #155034 - ChayimFriedman2:ra-fixes, r=lcnr
JonathanBrouwer Apr 9, 2026
d6536ab
Rollup merge of #151377 - xonx4l:main_termination, r=lcnr
JonathanBrouwer Apr 9, 2026
5182f21
Rollup merge of #154677 - Darksonn:hwasan-tagged-globals, r=davidtwco
JonathanBrouwer Apr 9, 2026
2682f45
Rollup merge of #154774 - quic-mliebel:add-maintainer, r=TaKO8Ki
JonathanBrouwer Apr 9, 2026
b683446
Rollup merge of #155015 - jakubadamw:issues-104037-112623-113899, r=K…
JonathanBrouwer Apr 9, 2026
c6deb08
Rollup merge of #155039 - WaffleLapkin:hard_unstable, r=JonathanBrouwer
JonathanBrouwer Apr 9, 2026
b52fdca
Rollup merge of #155043 - malezjaa:refactor-typecheck-op, r=adwinwhite
JonathanBrouwer Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ fn maybe_stage_features(sess: &Session, features: &Features, krate: &ast::Crate)
AttributeParser::parse_limited(
sess,
&krate.attrs,
sym::feature,
&[sym::feature],
DUMMY_SP,
krate.id,
Some(&features),
Expand Down
19 changes: 17 additions & 2 deletions compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub(crate) mod do_not_recommend;
pub(crate) mod on_const;
pub(crate) mod on_move;
pub(crate) mod on_unimplemented;
pub(crate) mod on_unknown;

#[derive(Copy, Clone)]
pub(crate) enum Mode {
Expand All @@ -35,6 +36,8 @@ pub(crate) enum Mode {
DiagnosticOnConst,
/// `#[diagnostic::on_move]`
DiagnosticOnMove,
/// `#[diagnostic::on_unknown]`
DiagnosticOnUnknown,
}

fn merge_directives<S: Stage>(
Expand Down Expand Up @@ -122,6 +125,13 @@ fn parse_directive_items<'p, S: Stage>(
span,
);
}
Mode::DiagnosticOnUnknown => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
AttributeLintKind::MalformedOnUnknownAttr { span },
span,
);
}
}
continue;
}}
Expand All @@ -140,7 +150,7 @@ fn parse_directive_items<'p, S: Stage>(
Mode::RustcOnUnimplemented => {
cx.emit_err(NoValueInOnUnimplemented { span: item.span() });
}
Mode::DiagnosticOnUnimplemented |Mode::DiagnosticOnConst | Mode::DiagnosticOnMove => {
Mode::DiagnosticOnUnimplemented |Mode::DiagnosticOnConst | Mode::DiagnosticOnMove | Mode::DiagnosticOnUnknown => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
AttributeLintKind::IgnoredDiagnosticOption {
Expand Down Expand Up @@ -176,7 +186,8 @@ fn parse_directive_items<'p, S: Stage>(
Ok((f, warnings)) => {
for warning in warnings {
let (FormatWarning::InvalidSpecifier { span, .. }
| FormatWarning::PositionalArgument { span, .. }) = warning;
| FormatWarning::PositionalArgument { span, .. }
| FormatWarning::DisallowedPlaceholder { span }) = warning;
cx.emit_lint(
MALFORMED_DIAGNOSTIC_FORMAT_LITERALS,
AttributeLintKind::MalformedDiagnosticFormat { warning },
Expand Down Expand Up @@ -326,6 +337,10 @@ fn parse_arg(
is_source_literal: bool,
) -> FormatArg {
let span = slice_span(input_span, arg.position_span.clone(), is_source_literal);
if matches!(mode, Mode::DiagnosticOnUnknown) {
warnings.push(FormatWarning::DisallowedPlaceholder { span });
return FormatArg::AsIs(sym::empty_braces);
}

match arg.position {
// Something like "hello {name}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
use rustc_hir::attrs::diagnostic::Directive;
use rustc_session::lint::builtin::MALFORMED_DIAGNOSTIC_ATTRIBUTES;

use crate::attributes::diagnostic::*;
use crate::attributes::prelude::*;

#[derive(Default)]
pub(crate) struct OnUnknownParser {
span: Option<Span>,
directive: Option<(Span, Directive)>,
}

impl OnUnknownParser {
fn parse<'sess, S: Stage>(
&mut self,
cx: &mut AcceptContext<'_, 'sess, S>,
args: &ArgParser,
mode: Mode,
) {
if !cx.features().diagnostic_on_unknown() {
return;
}
let span = cx.attr_span;
self.span = Some(span);

let items = match args {
ArgParser::List(items) if !items.is_empty() => items,
ArgParser::NoArgs | ArgParser::List(_) => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
AttributeLintKind::MissingOptionsForOnUnknown,
span,
);
return;
}
ArgParser::NameValue(_) => {
cx.emit_lint(
MALFORMED_DIAGNOSTIC_ATTRIBUTES,
AttributeLintKind::MalformedOnUnknownAttr { span },
span,
);
return;
}
};

if let Some(directive) = parse_directive_items(cx, mode, items.mixed(), true) {
merge_directives(cx, &mut self.directive, (span, directive));
};
}
}

impl<S: Stage> AttributeParser<S> for OnUnknownParser {
const ATTRIBUTES: AcceptMapping<Self, S> = &[(
&[sym::diagnostic, sym::on_unknown],
template!(List: &[r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#]),
|this, cx, args| {
this.parse(cx, args, Mode::DiagnosticOnUnknown);
},
)];
//FIXME attribute is not parsed for non-use statements but diagnostics are issued in `check_attr.rs`
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS);

fn finalize(self, _cx: &FinalizeContext<'_, '_, S>) -> Option<AttributeKind> {
if let Some(span) = self.span {
Some(AttributeKind::OnUnknown {
span,
directive: self.directive.map(|d| Box::new(d.1)),
})
} else {
None
}
}
}
2 changes: 2 additions & 0 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::attributes::diagnostic::do_not_recommend::*;
use crate::attributes::diagnostic::on_const::*;
use crate::attributes::diagnostic::on_move::*;
use crate::attributes::diagnostic::on_unimplemented::*;
use crate::attributes::diagnostic::on_unknown::*;
use crate::attributes::doc::*;
use crate::attributes::dummy::*;
use crate::attributes::inline::*;
Expand Down Expand Up @@ -156,6 +157,7 @@ attribute_parsers!(
OnConstParser,
OnMoveParser,
OnUnimplementedParser,
OnUnknownParser,
RustcAlignParser,
RustcAlignStaticParser,
RustcCguTestAttributeParser,
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_attr_parsing/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct AttributeParser<'sess, S: Stage = Late> {
/// *Only* parse attributes with this symbol.
///
/// Used in cases where we want the lowering infrastructure for parse just a single attribute.
parse_only: Option<Symbol>,
parse_only: Option<&'static [Symbol]>,
}

impl<'sess> AttributeParser<'sess, Early> {
Expand All @@ -53,7 +53,7 @@ impl<'sess> AttributeParser<'sess, Early> {
pub fn parse_limited(
sess: &'sess Session,
attrs: &[ast::Attribute],
sym: Symbol,
sym: &'static [Symbol],
target_span: Span,
target_node_id: NodeId,
features: Option<&'sess Features>,
Expand All @@ -77,7 +77,7 @@ impl<'sess> AttributeParser<'sess, Early> {
pub fn parse_limited_should_emit(
sess: &'sess Session,
attrs: &[ast::Attribute],
sym: Symbol,
sym: &'static [Symbol],
target_span: Span,
target_node_id: NodeId,
target: Target,
Expand Down Expand Up @@ -109,7 +109,7 @@ impl<'sess> AttributeParser<'sess, Early> {
pub fn parse_limited_all<'a>(
sess: &'sess Session,
attrs: impl IntoIterator<Item = &'a ast::Attribute>,
parse_only: Option<Symbol>,
parse_only: Option<&'static [Symbol]>,
target: Target,
target_span: Span,
target_node_id: NodeId,
Expand Down Expand Up @@ -301,7 +301,7 @@ impl<'sess, S: Stage> AttributeParser<'sess, S> {
for attr in attrs.into_iter() {
// If we're only looking for a single attribute, skip all the ones we don't care about.
if let Some(expected) = self.parse_only {
if !attr.has_name(expected) {
if !attr.path_matches(expected) {
continue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ impl<'a> TraitDef<'a> {
match item {
Annotatable::Item(item) => {
let is_packed = matches!(
AttributeParser::parse_limited(cx.sess, &item.attrs, sym::repr, item.span, item.id, None),
AttributeParser::parse_limited(cx.sess, &item.attrs, &[sym::repr], item.span, item.id, None),
Some(Attribute::Parsed(AttributeKind::Repr { reprs, .. })) if reprs.iter().any(|(x, _)| matches!(x, ReprPacked(..)))
);

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/proc_macro_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl<'a> CollectProcMacros<'a> {
})) = AttributeParser::parse_limited(
self.session,
slice::from_ref(attr),
sym::proc_macro_derive,
&[sym::proc_macro_derive],
item.span,
item.node_id(),
None,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
AttributeParser::parse_limited(
cx.sess,
&i.attrs,
sym::should_panic,
&[sym::should_panic],
i.span,
i.node_id(),
None,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/test_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn get_test_runner(sess: &Session, features: &Features, krate: &ast::Crate) -> O
match AttributeParser::parse_limited(
sess,
&krate.attrs,
sym::test_runner,
&[sym::test_runner],
krate.spans.inner_span,
krate.id,
Some(features),
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ fn llvm_features_by_flags(sess: &Session, features: &mut Vec<String>) {
}

target_features::retpoline_features_by_flags(sess, features);
target_features::sanitizer_features_by_flags(sess, features);

// -Zfixed-x18
if sess.opts.unstable_opts.fixed_x18 {
Expand Down
11 changes: 10 additions & 1 deletion compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rustc_session::Session;
use rustc_session::lint::builtin::AARCH64_SOFTFLOAT_NEON;
use rustc_session::parse::feature_err;
use rustc_span::{Span, Symbol, edit_distance, sym};
use rustc_target::spec::Arch;
use rustc_target::spec::{Arch, SanitizerSet};
use rustc_target::target_features::{RUSTC_SPECIFIC_FEATURES, Stability};
use smallvec::SmallVec;

Expand Down Expand Up @@ -460,6 +460,15 @@ pub fn retpoline_features_by_flags(sess: &Session, features: &mut Vec<String>) {
}
}

/// Computes the backend target features to be added to account for sanitizer flags.
pub fn sanitizer_features_by_flags(sess: &Session, features: &mut Vec<String>) {
// It's intentional that this is done only for non-kernel version of hwaddress. This matches
// clang behavior.
if sess.sanitizers().contains(SanitizerSet::HWADDRESS) {
features.push("+tagged-globals".into());
}
}

pub(crate) fn provide(providers: &mut Providers) {
*providers = Providers {
rust_target_features: |tcx, cnum| {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
AttributeParser::parse_limited(
sess,
krate_attrs,
sym::feature,
&[sym::feature],
DUMMY_SP,
DUMMY_NODE_ID,
Some(&features),
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ pub fn is_stable_diagnostic_attribute(sym: Symbol, features: &Features) -> bool
sym::on_unimplemented | sym::do_not_recommend => true,
sym::on_const => features.diagnostic_on_const(),
sym::on_move => features.diagnostic_on_move(),
sym::on_unknown => features.diagnostic_on_unknown(),
_ => false,
}
}
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ declare_features! (
(unstable, diagnostic_on_const, "1.93.0", Some(143874)),
/// Allows giving on-move borrowck custom diagnostic messages for a type
(unstable, diagnostic_on_move, "CURRENT_RUSTC_VERSION", Some(154181)),
/// Allows giving unresolved imports a custom diagnostic message
(unstable, diagnostic_on_unknown, "CURRENT_RUSTC_VERSION", Some(152900)),
/// Allows `#[doc(cfg(...))]`.
(unstable, doc_cfg, "1.21.0", Some(43781)),
/// Allows `#[doc(masked)]`.
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_hir/src/attrs/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,14 @@ pub enum AttributeKind {
/// None if the directive was malformed in some way.
directive: Option<Box<Directive>>,
},

/// Represents `#[diagnostic::on_unknown]`
OnUnknown {
span: Span,
/// None if the directive was malformed in some way.
directive: Option<Box<Directive>>,
},

/// Represents `#[optimize(size|speed)]`
Optimize(OptimizeAttr, Span),

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_hir/src/attrs/encode_cross_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl AttributeKind {
OnConst { .. } => Yes,
OnMove { .. } => Yes,
OnUnimplemented { .. } => Yes,
OnUnknown { .. } => Yes,
Optimize(..) => No,
PanicRuntime => No,
PatchableFunctionEntry { .. } => Yes,
Expand Down
Loading
Loading