Hayashi Mikihiro
c79e24c1f1
Migrate remove_dbg assist to use SyntaxEditor
2025-07-11 16:24:57 +09:00
Matthias Krüger
562dab675c
Rollup merge of #143708 - epage:pretty, r=compiler-errors
...
fix: Include frontmatter in -Zunpretty output
In the implementation (rust-lang/rust#140035 ), this was left as an open question for
the tracking issue (rust-lang/rust#136889 ). My assumption is that this should be
carried over.
The test was carried over from rust-lang/rust#137193 which was superseded by rust-lang/rust#140035 .
Thankfully, either way, `-Zunpretty` is unstable and we can always
change it even if we stabilize frontmatter.
2025-07-11 07:35:21 +02:00
Chayim Refael Friedman
e2c8cefa63
Merge pull request #20228 from ChayimFriedman2/fix-use-display
...
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Fix display of `use<>` syntax
2025-07-10 21:19:38 +00:00
Chayim Refael Friedman
1d3ca1d6f3
Fix display of use<> syntax
2025-07-11 00:08:24 +03:00
Shoyu Vanilla (Flint)
600f573256
Merge pull request #20054 from Young-Flash/folding_all
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
feat: support folding multiline arg list & fn body in one folding range
2025-07-10 12:05:31 +00:00
Hayashi Mikihiro
c3a5a8c22a
Migrate generate_impl assist to use SyntaxEditor
2025-07-10 18:12:16 +09:00
Shoyu Vanilla (Flint)
e9968fc555
Merge pull request #20210 from ChayimFriedman2/naked-asm-safe
...
fix: Inline asm fixes
2025-07-10 06:28:49 +00:00
yukang
c37949c628
remove unnecessary parens in rust-analyzer
2025-07-10 13:50:02 +08:00
Laurențiu Nicola
8789098dbc
Revert "remove if-let chains"
...
This reverts commit fcc81a38b3 .
2025-07-10 08:24:53 +03:00
Shoyu Vanilla (Flint)
eede8f1f4e
Merge pull request #20212 from ChayimFriedman2/dyn-hint
...
fix: Fixes for `dyn` inlay hint
2025-07-10 04:57:57 +00:00
Hayashi Mikihiro
be609a57bf
Migrate convert_match_to_let_else assist to use SyntaxEditor
...
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10 11:22:32 +09:00
Chayim Refael Friedman
ad708fdbd1
Put the expression stuff in the expression store behind an Option<Box>
...
And leave only the type stuff without it.
This is because most expression stores don't have anything but types (e.g. generics, fields, signatures) so this saves a lot of memory.
This saves 58mb on `analysis-stats .`.
2025-07-10 05:18:43 +03:00
Ed Page
f4d9018a48
feat(lexer): Allow including frontmatter with 'tokenize'
2025-07-09 16:42:27 -05:00
Chayim Refael Friedman
f8e2fa0e80
Make AsmExpr have AstId
...
We need it because `global_asm!()` is an item. It's unfortunate that such thing can slip in and I see no way to automatically catch that, but thankfully analysis-stats on self has caught that.
2025-07-09 21:43:20 +03:00
Chayim Refael Friedman
a8e67dffca
Put dyn inlay hints in their correct place in presence of parentheses
2025-07-09 19:33:47 +03:00
Chayim Refael Friedman
5e30dab65c
Disable the diagnostics_dont_block_typing test on CI
...
It's failing to much. We need to fix it, but my changes are unlikely to be the cause.
2025-07-09 19:29:11 +03:00
Chayim Refael Friedman
3931afa624
Don't show dyn hint in a HRTB bound
2025-07-09 19:19:51 +03:00
Hayashi Mikihiro
5a410c3215
migrate convert_named_struct_to_tuple_struct assist to use 'SyntaxEditor'
...
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10 01:01:47 +09:00
Chayim Refael Friedman
95c04c4503
Make global_asm!() work
...
Because apparently, we were not accepting inline asm in item position, completely breaking it.
2025-07-09 18:55:27 +03:00
Shoyu Vanilla (Flint)
64551a5696
Merge pull request #20109 from Hmikihiro/generate_new_tuple_field
...
feat: Generate `new` for tuple struct
2025-07-09 15:22:47 +00:00
Chayim Refael Friedman
bd8087e86e
Differentiate between asm!(), global_asm!() and naked_asm!(), and make only asm!() unsafe
2025-07-09 17:37:27 +03:00
Chayim Refael Friedman
edb804a100
Don't hash the SyntaxKind in the ast id
...
There is no need to, it's already stored in the `kind`.
2025-07-09 17:21:45 +03:00
bors
3a5e13a8b3
Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrieril
...
`rustc_pattern_analysis`: always check that deref patterns don't match on the same place as normal constructors
In rust-lang/rust#140106 , deref pattern validation was tied to the `deref_patterns` feature to temporarily avoid affecting perf. However:
- As of rust-lang/rust#143414 , box patterns are represented as deref patterns in `rustc_pattern_analysis`. Since they can be used by enabling `box_patterns` instead of `deref_patterns`, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test.
- External tooling (e.g. rust-analyzer) will also need to validate matches containing deref patterns, which was not possible. This fixes that by making `compute_match_usefulness` validate deref patterns by default.
In order to avoid doing an extra pass for anything with patterns, the second commit makes `RustcPatCtxt` keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter.
r? `@Nadrieril`
2025-07-09 09:45:36 +00:00
Shoyu Vanilla (Flint)
e429bac879
Merge pull request #20200 from rust-lang/revert-20157-push-nxrvpywtvoys
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
autopublish / publish (push) Has been cancelled
release / dist (aarch64-apple-darwin) (push) Has been cancelled
release / dist (x86_64-apple-darwin) (push) Has been cancelled
release / dist (aarch64-unknown-linux-gnu) (push) Has been cancelled
release / dist (arm-unknown-linux-gnueabihf) (push) Has been cancelled
release / dist (x86_64-unknown-linux-gnu) (push) Has been cancelled
release / dist (aarch64-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-pc-windows-msvc) (push) Has been cancelled
release / dist (i686-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-unknown-linux-musl) (push) Has been cancelled
release / publish (push) Has been cancelled
Revert "Re-enable fixpoint iteration for variance computation"
2025-07-09 02:30:26 +00:00
Chayim Refael Friedman
43644ca4fe
Revert "Re-enable fixpoint iteration for variance computation"
2025-07-08 23:41:22 +03:00
Hayashi Mikihiro
c6ce2abd47
Migrate pull_assignment_up assist to SyntaxEditor
...
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-09 00:58:58 +09:00
Lukas Wirth
9a1fc3cdb8
Merge pull request #20192 from ChayimFriedman2/link-type-panic
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Fix a case where the link type was `None`
2025-07-08 05:52:58 +00:00
bors
af15612448
Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgr
...
Rollup of 9 pull requests
Successful merges:
- rust-lang/rust#132469 (Do not suggest borrow that is already there in fully-qualified call)
- rust-lang/rust#143340 (awhile -> a while where appropriate)
- rust-lang/rust#143438 (Fix the link in `rustdoc.md`)
- rust-lang/rust#143539 (Regression tests for repr ICEs)
- rust-lang/rust#143566 (Fix `x86_64-unknown-netbsd` platform support page)
- rust-lang/rust#143572 (Remove unused allow attrs)
- rust-lang/rust#143583 (`loop_match`: fix 'no terminator on block')
- rust-lang/rust#143584 (make `Machine::load_mir` infallible)
- rust-lang/rust#143591 (Fix missing words in future tracking issue)
r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-07 20:30:53 +00:00
Lukas Wirth
778e08df16
Merge pull request #20180 from ChayimFriedman2/parser-stuck
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Always bump in the parser in `err_and_bump()`
2025-07-07 18:42:12 +00:00
Matthias Krüger
23584a4666
Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865
...
awhile -> a while where appropriate
2025-07-07 19:55:32 +02:00
Chayim Refael Friedman
793e1573d4
Fix a case where the link type was None
...
Which caused a panic.
2025-07-07 20:44:18 +03:00
bors
b00b4ea65b
Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee
...
Allow custom default address spaces and parse `p-` specifications in the datalayout string
Some targets, such as CHERI, use as default an address space different from the "normal" default address space `0` (in the case of CHERI, [200 is used](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-877.pdf )). Currently, `rustc` does not allow to specify custom address spaces and does not take into consideration [`p-` specifications in the datalayout string](https://llvm.org/docs/LangRef.html#langref-datalayout ).
This patch tries to mitigate these problems by allowing targets to define a custom default address space (while keeping the default value to address space `0`) and adding the code to parse the `p-` specifications in `rustc_abi`. The main changes are that `TargetDataLayout` now uses functions to refer to pointer-related informations, instead of having specific fields for the size and alignment of pointers in the default address space; furthermore, the two `pointer_size` and `pointer_align` fields in `TargetDataLayout` are replaced with an `FxHashMap` that holds info for all the possible address spaces, as parsed by the `p-` specifications.
The potential performance drawbacks of not having ad-hoc fields for the default address space will be tested in this PR's CI run.
r? workingjubilee
2025-07-07 17:28:14 +00:00
David Barsky
5bae4f5c81
Merge pull request #20185 from ChayimFriedman2/variant-symbols
...
feat: Include enum variants in world symbols
2025-07-07 15:15:27 +00:00
Edoardo Marangoni
54507d88b4
compiler: Parse p- specs in datalayout string, allow definition of custom default data address space
2025-07-07 09:04:53 +02:00
Chayim Refael Friedman
b34e5b7fe4
Include enum variants in world symbols
...
I opted to not include enum variant imports, only under the enum, and to not gate this behind a setting.
2025-07-06 14:52:10 +03:00
Lukas Wirth
0ac65592a8
Merge pull request #20184 from Veykril/push-ywpynxnltpok
...
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
release / dist (aarch64-unknown-linux-gnu) (push) Has been cancelled
release / dist (arm-unknown-linux-gnueabihf) (push) Has been cancelled
release / dist (x86_64-unknown-linux-gnu) (push) Has been cancelled
release / dist (aarch64-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-pc-windows-msvc) (push) Has been cancelled
release / dist (i686-pc-windows-msvc) (push) Has been cancelled
autopublish / publish (push) Has been cancelled
release / publish (push) Has been cancelled
release / dist (aarch64-apple-darwin) (push) Has been cancelled
release / dist (x86_64-apple-darwin) (push) Has been cancelled
release / dist (x86_64-unknown-linux-musl) (push) Has been cancelled
chore: Remove dead field from `InferenceContext`
2025-07-06 09:08:36 +00:00
Lukas Wirth
c86d83219b
chore: Remove dead field from InferenceContext
2025-07-06 10:57:06 +02:00
Lukas Wirth
2691c11104
Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore
...
Add AsMut, Borrow and BorrowMut to minicore and famous_defs
2025-07-06 08:01:54 +00:00
Lukas Wirth
fce1f41462
Merge pull request #20126 from Wilfred/no_unwrap_in_discover_projects
...
fix: Avoid .unwrap() when running the discover command
2025-07-06 08:01:10 +00:00
Lukas Wirth
ef3e52b6eb
Merge pull request #20179 from ChayimFriedman2/destructuring-assignment-never
...
fix: Fix diverging destructuring assignments
2025-07-06 07:01:40 +00:00
Chayim Refael Friedman
87cddda2d8
Always bump in the parser in err_and_bump()
...
Even when at curly braces, otherwise the parser can get stuck.
This has happened in the past in #18625 , but it was just worked around instead of handling the root of the problem. Now this happened again in #20171 . IMO we can't let `err_and_bump()` not bump, that's too confusing and invites errors. We can (as I did) workaround the worse recovery instead.
2025-07-06 03:21:43 +03:00
Chayim Refael Friedman
3ec0d80ae1
Fix diverging destructuring assignments
...
They need to return `!`, unlike diverging ordinary assignments. See the comment in the code.
2025-07-05 22:35:22 +03:00
A4-Tacks
439f2d24cd
Fix Borrow and BorrowMut define from beta std
2025-07-05 21:49:56 +08:00
dianne
127a4eff71
always check for mixed deref pattern and normal constructors
...
This makes it work for box patterns and in rust-analyzer.
2025-07-04 23:47:31 -07:00
dianne
8dc54f4d33
hir_ty::match_check: remove special handling for box patterns
2025-07-04 23:43:49 -07:00
Wilfred Hughes
a50b7b6b4e
fix: Avoid .unwrap() when running the discover command
...
Previously, the following configuration in settings.json:
"rust-analyzer.workspace.discoverConfig": {
"command": [
"oops",
"develop-json",
"{arg}"
],
"progressLabel": "rust-analyzer",
"filesToWatch": [
"BUCK",
"TARGETS"
]
},
Would previously cause a crash in rust-analyzer:
thread 'LspServer' panicked at crates/rust-analyzer/src/main_loop.rs:776:84:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Instead, use more specific panic messages.
2025-07-04 16:55:53 +01:00
Laurențiu Nicola
3816d0ae53
Merge pull request #20170 from Veykril/push-vtsmzopsunsw
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Improve flycheck and build script progress reporting
2025-07-04 13:46:09 +00:00
Lukas Wirth
4ee90e97f6
Improve flycheck and build script progress reporting
2025-07-04 11:52:09 +02:00
Lukas Wirth
638e49b0fc
Skip unnecessary eq work in BodySourceMap
2025-07-04 11:36:06 +02:00
Lukas Wirth
da1888a75c
Merge pull request #20031 from jnyfah/some-branch
...
Fix: Resolve HIR display length issues and improve adjustment tooltips
2025-07-04 09:20:14 +00:00