1653 Commits

Author SHA1 Message Date
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
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
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
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
8e81cc0772
Merge pull request #19109 from Veykril/push-nzpuuqommpnq
fix: Do not show safety hints for extern items lacking semantics
2025-02-12 13:58:56 +00:00
Lukas Wirth
e0814742f0 fix: Do not show safety hints for extern items lacking semantics 2025-02-12 14:43:51 +01: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
Hayashi Mikihiro
c84cec1547 Shadowing BuiltinType by Module
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-02-10 17:46:43 +09:00
Ali Bektas
97251b3e28 Check if PatPtr resolves to ExprId 2025-02-09 17:31:45 +01:00
Ali Bektas
76b93c0d1f Fix clippy errors 2025-02-09 17:31:09 +01:00
Ali Bektas
bd369a83c0 Remove dbg lines 2025-02-09 17:31:09 +01:00
Ali Bektas
18f90a9d2a resolve_bind_pat_to_const does not early return if expr 2025-02-09 17:31:09 +01:00
Ali Bektas
574ea0296c make SourceAnalyzer::pat_id return ExprOrPatId
Not all patterns are mapped to Pats. As such, it was necessary to change
the ret type Option<PatId> to Option<ExprOrPatId>
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
Chayim Refael Friedman
134b6f2228 Fix IDE resolution of use inside a body
We stopped the expression search too early because `use` is an item.
2025-02-04 18:30:50 +02:00
Ali Bektas
d8779b4a0e Make higher levels adapt Bodys exprs having ExprOrPatId values 2025-02-03 12:14:13 +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
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
55d3851820 Back out "Remove has_default from FieldId"
This backs out commit 8aa6c09fcee6270c787a6f00615d76343fbe5c07.
2025-01-27 17:30:34 -05: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
Chayim Refael Friedman
cdc3f89a3f Don't suggest into_iter().method() on iterators 2025-01-27 18:48:20 +02:00
Chayim Refael Friedman
028c47999d Remove duplicate method from hir::Type
I added it by mistake in #18927.

I chose to keep the method as not static, because it's more comfortable, and keep the name `add_reference()` and not `reference()`, because it is clearer and better matches `strip_reference[s]()`.
2025-01-27 18:40:01 +02:00
Chayim Refael Friedman
55c63abc59 Fix #[rustc_deprecated_safe_2024]
It should be considered by the edition of the caller, not the callee.

Technically we still don't do it correctly - we need the span of the method name (if it comes from a macro), but we don't keep it and this is good enough for now.
2025-01-27 14:35:20 +02:00
Shoyu Vanilla
8aa6c09fce Remove has_default from FieldId 2025-01-27 19:41:58 +09:00
Shoyu Vanilla
b4d4d02db8 Compute diagnostics of a field body iff it has one 2025-01-27 19:41:57 +09:00
Shoyu Vanilla
c134b20c9c Merge record lit's ellipsis into pre-existing spread's variant 2025-01-27 19:41:54 +09:00
Shoyu Vanilla
7de0b2e75a feat: Implement default-field-values 2025-01-27 19:38:35 +09:00
Lukas Wirth
35b55fd67f
Merge pull request #19036 from Veykril/push-nprltlwvryxw
Split out `ExpressionStore` from `Body`
2025-01-27 07:54:44 +00:00
Chayim Refael Friedman
791b1ebfd4 Support RFC 2396
AKA. target_feature 1.1, or non unsafe target_feature.
2025-01-26 23:31:58 +02:00
Lukas Wirth
3bb0ff3480 Add GenericDefId::StaticId 2025-01-26 11:07:54 +01:00
Lukas Wirth
55d1d5dd8b Split out ExpressionStore from Body 2025-01-26 11:02:00 +01:00
Lukas Wirth
fbf3d08a30
Merge pull request #19026 from Veykril/push-wrxrutptywzx
Only collect implicit visibile use symbols if they have renames
2025-01-25 10:27:26 +00:00
Lukas Wirth
7acf8dcf7b Only collect implicit visibile use symbols if they have renames
Otherwise this will pollute the index too much with unnecessary symbols
2025-01-25 11:12:06 +01:00
Lukas Wirth
6e4c29f7ce
Merge pull request #19018 from Veykril/push-wxqqunxwrply
internal: Record the use tree index in glob imports
2025-01-24 14:27:49 +00:00
Lukas Wirth
a62e2f513a
Merge pull request #18991 from Veykril/push-rmqmnrymwmoz
Keep already computed inlay hint properties instead of late resolving them
2025-01-24 14:27:43 +00:00
Lukas Wirth
433888c4b2 Record the use tree index in glob imports 2025-01-24 15:12:48 +01:00
Lukas Wirth
93de80d833
Merge pull request #19016 from Veykril/push-moqnsytyrupu
fix: Fix `ItemScope` not recording glob imports
2025-01-24 13:25:39 +00:00
Lukas Wirth
3b88a2f134 Fix ItemScope not recording glob imports
This caused us other code to incorrectly assume in dealing with a declaration when in fact it was dealing with a glob imported definition
2025-01-24 14:11:45 +01:00
Lukas Wirth
831e3535e6 Fix Param::as_local treating closures wrong 2025-01-21 11:15:36 +01:00
Lukas Wirth
a3eee10638 Goto Display::fmt when invoked on to_string 2025-01-20 17:00:28 +01:00
Lukas Wirth
0fdab1be36 Bring back goto def redirect for parse -> FromStr 2025-01-20 16:32:17 +01:00
Lukas Wirth
03ea40369f Move dual blanket impl logic from source analyzer to goto_def 2025-01-20 16:24:42 +01:00
Lukas Wirth
93a5846784
Merge pull request #18967 from Veykril/push-pwonkmwqmmol
Properly record meaningful imports as re-exports in symbol index
2025-01-20 13:46:52 +00:00
Lukas Wirth
b2f822b074
Merge pull request #18934 from 1hakusai1/goto_definition_from_into
feat: Add the ability to jump from `into` to `from` definitions
2025-01-20 13:46:47 +00:00
Lukas Wirth
a06606c802 Fix import search not discarding rawness 2025-01-20 14:29:11 +01:00