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
Shoyu Vanilla
b7b4dd5afc
fix: Resolve projection types before checking casts
2025-02-07 09:51:32 +09:00
Chayim Refael Friedman
8ea61356a9
Remove a no-longer-correct FIXME
2025-02-04 23:07:48 +02:00
Chayim Refael Friedman
74591ecefe
Fix incorrect terminology
...
Lifetimes are elided in function signatures, and inferred in bodies.
2025-02-04 23:07:35 +02:00
Chayim Refael Friedman
1432ab05d9
Refactor TyLoweringContext::substs_from_args_and_bindings()
to always take a GenericDefId
2025-02-04 23:07:05 +02:00
Chayim Refael Friedman
9db2499bb9
Add a FIXME for feature(adt_const_params)
2025-02-04 21:28:19 +02:00
Lukas Wirth
13c17db07b
Merge pull request #19066 from alibektas/slice_pattern_type_inference
...
fix: try to infer array type from slice pattern
2025-02-03 14:03:50 +00:00
Lukas Wirth
d6645d11da
Fix some mir eval/lowerings
2025-02-03 14:42:41 +01:00
Lukas Wirth
465844c3be
Do not use make use of InferenceResult::has_errors
flag for mir building
...
It generaly does not work as expected right now as we fallback type parameters to errors
2025-02-03 12:26:06 +01:00
Ali Bektas
135fca9efe
Revert tests::patterns::infer_pattern
...
And apply requested changes
2025-02-03 12:23:13 +01:00
Ali Bektas
06097c3388
Make Pat::Range's start and end Option<ExprId>
2025-02-03 12:14:11 +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
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
Lukas Wirth
8a9992cef4
Disable Receiver
based autoderef temporarily
2025-01-28 14:54:02 +01: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
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