839 Commits

Author SHA1 Message Date
Laurențiu Nicola
363590b450 Merge from rust-lang/rust 2025-03-10 10:41:53 +02:00
Moulins
18772836d4 Use rustc_abi code for SIMD layout in rust-analyzer 2025-03-08 12:36:42 +01:00
Moulins
4929f38544 Remove most manual LayoutData creations and move them to rustc_abi
...either as:
- methods on LayoutCalculator, for faillible operations;
- constructors on LayoutData, for infaillible ones.
2025-03-08 12:27:19 +01:00
Lukas Wirth
27dc614627
Merge pull request #19274 from Veykril/push-pouwrwwrlrlt
Highlight unsafe operations as unsafe, not definitions
2025-03-05 12:57:25 +00:00
Lukas Wirth
9fc0ffe008 Use HIR unsafety information for unsafe syntax highlightng 2025-03-05 13:18:46 +01:00
Thalia Archibald
0811ca0a61 Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
2025-03-05 00:48:44 -08:00
Matthias Krüger
a52ffa7068
Rollup merge of #137921 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-03-03 20:47:14 +01:00
Laurențiu Nicola
2244c99b69 Merge from rust-lang/rust 2025-03-03 08:38:46 +02:00
Moulins
c64ed1e187 Remove layouting dead code for non-array SIMD types.
These aren't supported anymore, and are already rejected in type checking.
2025-03-02 12:50:14 +01:00
Ralf Jung
5377cfb472 rename BackendRepr::Vector → SimdVector 2025-02-28 17:17:45 +01:00
BenjaminBrienen
b19ef6b046 fix doc tests 2025-02-27 14:58:46 +01:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
Chayim Refael Friedman
7c5524c854 Disable typos checker for the target feature names 2025-02-25 05:02:17 +02:00
Chayim Refael Friedman
87ed04bac0 Support target features implications in target_feature 1.1
We vendor the list of implications, which isn't nice, but t-compiler doesn't want to make rustc_target available to us.
2025-02-25 04:50:26 +02:00
Lukas Wirth
93bd36dfb9
Merge pull request #18987 from ChayimFriedman2/drop-glue
feat: Calculate drop glue and show it on hover
2025-02-24 13:52:17 +00:00
Laurențiu Nicola
f641813e07 Format code 2025-02-24 10:28:46 +02:00
Laurențiu Nicola
a5bf2d5604 Add rustc_hashes and bump the others 2025-02-24 10:10:51 +02:00
Laurențiu Nicola
807aa45e0a Merge from rust-lang/rust 2025-02-24 09:42:57 +02:00
Lukas Wirth
6d68c475c7
Merge pull request #19191 from Veykril/push-yzzlosskwrxs
Remove `limit` crate in favor `usize`
2025-02-23 16:50:32 +00:00
Lukas Wirth
0b2e8166a1 Remove limit crate in favor usize 2025-02-23 17:35:09 +01:00
Jacob Pratt
001a4019df
Rollup merge of #137334 - compiler-errors:edition-2024-fresh-2, r=saethlin,traviscross
Greatly simplify lifetime captures in edition 2024

Remove most of the `+ Captures` and `+ '_` from the compiler, since they are now unnecessary with the new edition 2021 lifetime capture rules. Use some `+ 'tcx` and `+ 'static` rather than being overly verbose with precise capturing syntax.
2025-02-23 02:44:18 -05:00
Michael Goulet
fb3a49ed55 Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
Jubilee Young
eb4c00e9c7 rust-analyzer: use new function in (incorrect) layout computation
This is only to fix the build.
2025-02-20 19:55:29 -08:00
Zachary S
8aba4e6dcb Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData.
Also update comments that refered to BackendRepr::Uninhabited.
2025-02-20 13:27:32 -06:00
Shoyu Vanilla
a82773ab48 Explicitly compare TypesMap as ptrs 2025-02-20 08:49:00 +09:00
Shoyu Vanilla
9d459e8de7 fix: Binding wrong assoc ty when lowering trait ref bound 2025-02-20 00:47:21 +09:00
Lukas Wirth
6543225ad9
Revert "pass struct fields to chalk" 2025-02-18 11:37:43 +01:00
Matthias Krüger
447b34760d
Rollup merge of #137173 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-02-17 17:06:14 +01:00
Laurențiu Nicola
cba236d9b7
Merge pull request #19169 from lnicola/sync-from-rust
minor: Sync from downstream
2025-02-17 12:30:13 +00:00
Lukas Wirth
656daef4da
Merge pull request #19167 from ChayimFriedman2/fix-ref-pat
fix: Fix detection of ref patterns for path patterns
2025-02-17 11:23:18 +00:00
Laurențiu Nicola
bec6d6fbe3 Merge from rust-lang/rust 2025-02-17 13:20:12 +02:00
bors
2ac072e546 Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #137095 (Replace some u64 hashes with Hash64)
 - #137100 (HIR analysis: Remove unnecessary abstraction over list of clauses)
 - #137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.)
 - #137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows)
 - #137125 (Re-add missing empty lines in the releases notes)
 - #137145 (use add-core-stubs / minicore for a few more tests)
 - #137149 (Remove SSE ABI from i586-pc-windows-msvc)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-17 11:18:33 +00:00
Chayim Refael Friedman
eb69d3734c Fix detection of ref patterns for path patterns
I was wrong on #19127, I thought hir-def resolver is enough for them, but it turns out not because of paths like `<Enum>::Variant` and `Type::AssocThatIsEnum::Variant`.
2025-02-17 11:51:29 +02:00
Lukas Wirth
efdfdc448b
Merge pull request #19122 from Austaras/master
pass struct fields to chalk
2025-02-17 09:37:55 +00:00
Lukas Wirth
09db657439
Merge pull request #19127 from ChayimFriedman2/different-generic-args
feat: Refactor path lowering and serve a new path diagnostic
2025-02-17 08:30:10 +00:00
Chayim Refael Friedman
100e166bb1 Calculate drop glue and show it on hover
Also fix the `needs_drop()` intrinsic.

Unions also need this information (to err if they have a drop-needing field), but this will come in a follow-up PR.
2025-02-17 06:29:37 +02:00
Nicholas Nethercote
30bcf2a6b5 Add pattern_complexity_limit to Limits.
It's similar to the other limits, e.g. obtained via `get_limit`. So it
makes sense to handle it consistently with the other limits. We now use
`Limit`/`usize` in most places instead of `Option<usize>`, so we use
`Limit::new(usize::MAX)`/`usize::MAX` to emulate how `None` used to work.

The commit also adds `Limit::unlimited`.
2025-02-17 09:30:33 +11:00
Ben Kimock
b4b1e778c9 Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
Chayim Refael Friedman
55c04ab371 Refactor path lowering
And add a new diagnostic for non-`Fn` parenthesized generic args.

Path lowering started to look like a mess, with each function carrying additional parameters for the diagnostic callback (since paths can occur both in type and in expression/pattern position, and their diagnostic handling is different) and the segment index, for the diagnostics report. So I refactored it from stateless functions on `TyLoweringContext` into stateful struct, `PathLoweringContext`, that tracks the process of lowering a path from resolution til assoc types selection.
2025-02-16 19:44:50 +02:00
Lukas Wirth
e6ea353d94 Improve error recovery when method-calling an assoc function 2025-02-16 11:49:48 +01:00
Lukas Wirth
26a5e24507
Merge pull request #19148 from Veykril/push-ptnykrwnwwlu
Improve error recovery when method-calling a field
2025-02-12 15:51:04 +00:00
Lukas Wirth
c942fb6061 Improve error recovery when method-calling a field 2025-02-12 16:37:15 +01:00
Lukas Wirth
c9838ec62d
Merge pull request #19111 from ShoyuVanilla/issue-19021
fix: Apply adjustments to proper expr when invoking `CoerceMany`
2025-02-12 13:42:52 +00:00
Lukas Wirth
622ef64f93
Merge pull request #18995 from alibektas/12210
fix: Lower range pattern bounds to expressions
2025-02-12 11:58:33 +00:00
Lukas Wirth
5af2d6abea Propogate error types in mir type projections 2025-02-12 09:24:33 +01:00
Bastian Kersting
50fb303dae Extend the renaming to coerce_unsafe_ptr 2025-02-10 13:01:55 +00:00
austaras
a48cb25b1c pass struct fields to chalk 2025-02-10 17:34:25 +08:00
Ali Bektas
76b93c0d1f Fix clippy errors 2025-02-09 17:31:09 +01:00
Ali Bektas
8956b1e1ba Lower ast::Ident to hir::Path when lowering RangePats 2025-02-09 17:31:09 +01:00
Shoyu Vanilla
11ffa88505 fix: Apply adjustments to proper expr when invoking CoerceMany 2025-02-08 02:38:41 +09:00