33318 Commits

Author SHA1 Message Date
bors
1094830d8c Auto merge of #134248 - oli-obk:patkind-path-removal, r=BoxyUwU
Merge `PatKind::Path` into `PatKind::Expr`

Follow-up to #134228

We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after #134228, so I'm removing it now.
2025-01-29 19:16:29 +00:00
Nathan Vegdahl
87fb27930a Fix typo 2025-01-29 17:47:38 +01:00
Nathan Vegdahl
b89adf07d4 Fix #19071: ensure completion_item_hash serializes items uniquely
Previously it may have been possible for different completion items to
produce colliding hashes, not because of the hash but because of how
the items were serialized into byte streams for hashing. See #19071
for details.

The chances of that happening were low, if it was actually possible at
all. Nevertheless, this commit ensures that it definitely can't happen.

This commit uses a handful of techniques used to fix this, but they all
boil down to "ensure this could be re-parsed". If it's possible to parse
to recreate the original item, then by construction there is no chance
of two different items getting serialized to identical byte streams.
2025-01-29 17:22:13 +01:00
Lukas Wirth
7fd6f72007
Merge pull request #19070 from Veykril/push-wpqzmznymtrn
Remove mutable syntax tree shenanigans from adjustment hints
2025-01-29 13:58:18 +00:00
Lukas Wirth
f61d31b144 Remove mutable syntax tree shenanigans from adjustment hints 2025-01-29 14:42:37 +01:00
Laurențiu Nicola
13cde501e0
Merge pull request #19067 from cessen/update_tenthash
Update TentHash to version 1.0
2025-01-29 11:29:46 +00:00
bors
2f3aea3cba Auto merge of #136227 - fmease:rollup-ewpvznh, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #136121 (Deduplicate operand creation between scalars, non-scalars and string patterns)
 - #136134 (Fix SIMD codegen tests on LLVM 20)
 - #136153 (Locate asan-odr-win with other sanitizer tests)
 - #136161 (rustdoc: add nobuild typescript checking to our JS)
 - #136166 (interpret: is_alloc_live: check global allocs last)
 - #136168 (GCI: Don't try to eval / collect mono items inside overly generic free const items)
 - #136170 (Reject unsound toggling of Arm atomics-32 target feature)
 - #136176 (Render pattern types nicely in mir dumps)
 - #136186 (uefi: process: Fix args)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-29 11:27:18 +00:00
Nathan Vegdahl
d6943d976d Update TentHash to version 1.0
The TentHash spec was frozen Jan 1st 2025, and release 1.0 of the Rust
crate is a minor cleanup as a follow-up to that, representing a
commitment to API stability as well.

The hash output remains the same as version 0.4, which rust-analyzer was
previously using. The only API change was a struct rename.
2025-01-29 12:07:20 +01:00
bors
702da50daa Auto merge of #136117 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-01-29 08:43:30 +00:00
bors
048b31dee6 Auto merge of #136225 - fmease:rollup-fm7m744, r=fmease
Rollup of 7 pull requests

Successful merges:

 - #135625 ([cfg_match] Document the use of expressions.)
 - #135902 (Do not consider child bound assumptions for rigid alias)
 - #135943 (Rename `Piece::String` to `Piece::Lit`)
 - #136104 (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump)
 - #136143 (Update books)
 - #136147 (ABI-required target features: warn when they are missing in base CPU)
 - #136164 (Refactor FnKind variant to hold &Fn)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-29 05:00:20 +00:00
León Orell Valerian Liehr
6000289c68
Rollup merge of #136164 - celinval:chores-fnkind, r=oli-obk
Refactor FnKind variant to hold &Fn

Pulling the change suggested in #128045 to reduce the impact of changing `Fn` item.

r? `@oli-obk`
2025-01-29 03:12:22 +01:00
León Orell Valerian Liehr
f23ce52587
Rollup merge of #136147 - RalfJung:required-target-features-check-not-add, r=workingjubilee
ABI-required target features: warn when they are missing in base CPU

Part of https://github.com/rust-lang/rust/pull/135408:
instead of adding ABI-required features to the target we build for LLVM, check that they are already there. Crucially we check this after applying `-Ctarget-cpu` and `-Ctarget-feature`, by reading `sess.unstable_target_features`. This means we can tweak the ABI target feature check without changing the behavior for any existing user; they will get warnings but the target features behave as before.

The test changes here show that we are un-doing the "add all required target features" part. Without the full #135408, there is no way to take a way an ABI-required target feature with `-Ctarget-cpu`, so we cannot yet test that part.

Cc ``@workingjubilee``
2025-01-29 03:12:21 +01:00
León Orell Valerian Liehr
95f724a7f2
Rollup merge of #136143 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

3 commits in 82a4a49789bc96db1a1b2a210b4c5ed7c9ef0c0d..fa312a343fbff01bc6cef393e326817f70719813
2025-01-22 17:14:29 UTC to 2025-01-22 15:09:26 UTC

- chore: reformat src with dprint (rust-lang/book#4211)
- Redirects: get rid of the weird gap in Ch. 20 sections! (rust-lang/book#4209)
- Document that `use` is also for `precise capturing` (rust-lang/book#4210)

## rust-lang/edition-guide

1 commits in d56e0f3a0656b7702ca466d4b191e16c28262b82..4ed5a1a4a2a7ecc2e529a5baaef04f7bc7917eda
2025-01-21 21:39:56 UTC to 2025-01-21 21:39:56 UTC

- Add alternatives for static-mut-refs (rust-lang/edition-guide#354)

## rust-lang/nomicon

3 commits in 625b200e5b33a5af35589db0bc454203a3d46d20..bc2298865544695c63454fc1f9f98a3dc22e9948
2025-01-23 19:01:24 UTC to 2025-01-20 14:37:52 UTC

- corrected grammatical error. (rust-lang/nomicon#477)
- Remove `#![start]` attribute (rust-lang/nomicon#478)
- Update guidance on uninitialized fields to use &raw mut instead of addr_of_mut! (rust-lang/nomicon#476)

## rust-lang/reference

10 commits in 293af991003772bdccf2d6b980182d84dd055942..93b921c7d3213d38d920f7f905a3bec093d2217d
2025-01-25 21:59:01 UTC to 2025-01-14 17:28:04 UTC

- distinct 'static' items never overlap (rust-lang/reference#1657)
- Change `'_static` to `'static` as an invalid lifetime parameter name (rust-lang/reference#1721)
- reword reference about inert attributes (rust-lang/reference#1719)
- Provide a better error message for broken links in mdbook-spec (rust-lang/reference#1716)
- Remove unstable vectorcall (rust-lang/reference#1717)
- Move the function pointer example (rust-lang/reference#1718)
- references and Box must be non-null (rust-lang/reference#1715)
- Fix filename for theme customization (rust-lang/reference#1711)
- Add Identifier Syntax to Several Chapters (rust-lang/reference#1597)
- move r[rules] to the left of the main body, using a grid (rust-lang/reference#1710)
2025-01-29 03:12:20 +01:00
León Orell Valerian Liehr
e15e3fcbe3
Rollup merge of #136104 - lqd:polonius-debugger-episode-2, r=matthewjasper
Add mermaid graphs of NLL regions and SCCs to polonius MIR dump

This PR expands the polonius MIR dump again with a couple of mermaid charts ported from the graphviz version:
- the NLL region graph
- and the NLL SCCs

I still have done zero visual design on this until now, but [here's](https://gistpreview.github.io/?fbbf900fed2ad21108c7ca0353456398) how it looks (i.e. still bad) just to give an idea of the result.

r? `````@matthewjasper````` (feel free to reassign) or anyone
2025-01-29 03:12:20 +01:00
León Orell Valerian Liehr
33ff3e92b1
Rollup merge of #135943 - hkBst:opt_imports, r=estebank
Rename `Piece::String` to `Piece::Lit`

This renames Piece::String to Piece::Lit to avoid shadowing std::string::String and removes "pub use Piece::*;".
2025-01-29 03:12:19 +01:00
León Orell Valerian Liehr
07804f1937
Rollup merge of #135625 - c410-f3r:cfg-match-foo-bar-baz, r=tgross35,jhpratt
[cfg_match] Document the use of expressions.

cc #115585

Adds documentation to this new feature introduced in #133720.
2025-01-29 03:12:18 +01:00
Ali Bektas
dd461203a6 call infer_pats from infer::expr with context 2025-01-29 00:54:18 +01:00
Ali Bektas
7befcb32e4 Equip infer_pat_* with declaration origin 2025-01-29 00:54:18 +01:00
Ali Bektas
5a3488a43e add test, bless tests 2025-01-29 00:54:18 +01:00
Ali Bektas
d092918b55 try to infer array type from slice pattern
rust-analyzer equivalent of rust-lang/rust#2827aa97
2025-01-29 00:54:18 +01:00
Marijn Schouten
e766255067 parse_format optimize import use 2025-01-28 19:33:00 +01:00
David Barsky
bc10a44798
Merge pull request #19063 from davidbarsky/davidbarsky/backout-struct-default-fields
internal: backout `hir-*` changes from #19001
2025-01-28 16:45:45 +00:00
David Richey
a81712b9a6 Update lsif_contains_generated_constant 2025-01-28 10:44:32 -06:00
Shoyu Vanilla
461ee092bf feat: Implement default-field-values only in parser 2025-01-28 11:30:47 -05:00
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00
David Richey
9462322f20 Fix scip symbols for implicit modules 2025-01-28 10:14:04 -06:00
Lukas Wirth
9f1ad04e72
Merge pull request #19056 from Giga-Bowser/fix-syntax-tree-crlf
fix: Properly handle CRLF line endings in the syntax tree view
2025-01-28 16:04:21 +00:00
Lukas Wirth
68edc96046
Merge pull request #19057 from darichey/status-bar-in-output
Show status bar in RA output
2025-01-28 16:02:15 +00:00
David Richey
a329b6ac2c Fix scip crate symbol name 2025-01-28 09:34:23 -06:00
Lukas Wirth
1f86729f29
Merge pull request #19061 from Veykril/push-rwyqqtqmnput
Disable `Receiver` based autoderef temporarily
2025-01-28
2025-01-28 14:08:49 +00:00
Lukas Wirth
8a9992cef4 Disable Receiver based autoderef temporarily 2025-01-28 14:54:02 +01:00
bors
7066f1a68a Auto merge of #134290 - tgross35:windows-i128-callconv, r=bjorn3,wesleywiser
Windows x86: Change i128 to return via the vector ABI

Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C.

In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW.

Link: https://github.com/rust-lang/rust/issues/134288 (does not fix) [1]

try-job: x86_64-msvc
try-job: x86_64-msvc-ext1
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
2025-01-28 06:11:13 +00:00
David Richey
50172919a6 Fix scip inherent impl overflow 2025-01-27 23:20:16 -06:00
David Barsky
be3307450f Back out "feat: Implement default-field-values"
This backs out commit 7de0b2e75a541b98f735ee6fcd12d326be38d23f.
2025-01-27 17:30:35 -05:00
David Barsky
35f6123059 Back out "Handle missing fields diagnostics"
This backs out commit e6a103ae50699db1dbb0676d075a4bcda2247939.
2025-01-27 17:30:35 -05:00
David Barsky
f3451d54d6 Back out "Merge record lit's ellipsis into pre-existing spread's variant"
This backs out commit c134b20c9cbc88a36e77acb8522e8dc4573bd906.
2025-01-27 17:30:35 -05:00
David Barsky
77c1507048 Back out "Compute diagnostics of a field body iff it has one"
This backs out commit b4d4d02db8a95f5507fbd0aa90904d7b774f0027.
2025-01-27 17:30:35 -05:00
David Barsky
e1b9a01c69 Back out "Implement HasResolver and HasModule for FieldId"
This backs out commit ce9da9063097c26006886b3f403a0c50790c285a.
2025-01-27 17:30:34 -05:00
David Barsky
52ee4ee1df Back out "Add a test for field default value body as defining usage of TAIT"
This backs out commit 4fe18a6fb5a1181a04c47391f558ebab5b8b0f39.
2025-01-27 17:30:34 -05:00
David Barsky
34d05b3bd0 Back out "Fix a mistake in condition"
This backs out commit e5c38558f5dbc37cbc91f9fda58144ce02e1f5aa.
2025-01-27 17:30:34 -05:00
David Barsky
55d3851820 Back out "Remove has_default from FieldId"
This backs out commit 8aa6c09fcee6270c787a6f00615d76343fbe5c07.
2025-01-27 17:30:34 -05:00
David Richey
fc1ead1312 Show status bar in RA output 2025-01-27 14:20:05 -06:00
Chayim Refael Friedman
a995319633
Merge pull request #19055 from vkrivopalov/fix-testdir-unused-variable-warning-on-freebsd
Add FreeBSD as a target OS for TestDir to avoid warnings
2025-01-27 20:16:57 +00:00
Giga Bowser
027363fef1 fix: Properly handle CRLF line endings in the syntax tree view 2025-01-27 15:09:58 -05:00
Vladimir Krivopalov
538f4faafb Add FreeBSD as a target OS for TestDir to avoid warnings
Currently, running rust-analyzer tests on FreeBSD produces an "unused
variable" warning. The code is fully compatible with FreeBSD and doesn't
have to be omitted.

Signed-off-by: Vladimir Krivopalov <vladimir@krivopalov.ru>
2025-01-27 14:53:56 -05:00
Lukas Wirth
7c387ed3a7
Merge pull request #19051 from ChayimFriedman2/fn-ptr-unsafe
fix: Report calling unsafe fn pointer as unsafe
2025-01-27 17:42:06 +00:00
Lukas Wirth
b27c5b4cae
Merge pull request #19050 from ChayimFriedman2/iter-self
fix: Don't suggest `into_iter().method()` on iterators
2025-01-27 17:41:02 +00:00
Lukas Wirth
8384bc5c55
Merge pull request #19049 from ChayimFriedman2/add-reference-ty
minor: Remove duplicate method from `hir::Type`
2025-01-27 17:40:09 +00:00
Lukas Wirth
fe253df5f0
Merge pull request #19052 from Veykril/push-yqwutllwwyyp
Prioritize formatting thread tasks in main_loop
2025-01-27 17:40:07 +00:00
Lukas Wirth
ec06a9d1d4 Prioritize formatting thread tasks in main_loop 2025-01-27 18:23:42 +01:00