Laurențiu Nicola
6b53c09ef5
Merge branch 'master' into sync-from-rust
2023-11-15 09:46:27 +02:00
Lukas Wirth
723d799ec1
Diagnose missing assoc items in trait impls
2023-11-14 22:00:52 +01:00
Lukas Wirth
e21d21a8fb
Diagnose incorrect unsafety for trait impls
2023-11-14 21:05:27 +01:00
Lukas Wirth
d5faad1dae
Fix inlay-hint tests being invalidated by minicore chanes
2023-11-14 18:53:48 +01:00
Lukas Wirth
6ddccc9a6e
Diagnose some orphan trait impl cases
2023-11-14 18:09:34 +01:00
Laurențiu Nicola
b6951defa6
Add missing rustc_private features
2023-11-13 21:38:57 +02:00
Lukas Wirth
ba61766217
Add config for preferring / ignoring prelude modules in find_path
2023-11-11 14:56:38 +01:00
Laurențiu Nicola
d1d111d09e
Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra
2023-11-08 08:15:03 +02:00
bors
bd38871a98
Auto merge of #15736 - rmehri01:15678_module_incorrect_case_diagnostics, r=HKalbasi
...
fix: add incorrect case diagnostics for module names
Adds diagnostics for checking both inline and file module names are snake case.
Closes #15678
2023-10-20 16:20:40 +00:00
Lukas Wirth
40acc5250f
Update rustc_abi dependency
2023-10-15 18:57:40 +02:00
Ryan Mehri
36eac9abee
fix: add incorrect case diagnostics for module names
2023-10-09 13:36:39 -07:00
Lukas Wirth
88a00bf49d
Shrink PatPtr by swapping its AstPtr and Either wrap order
2023-10-06 12:32:37 +02:00
Lukas Wirth
fe398163b6
Recognize custom main function as binary entrypoint for runnables
2023-10-04 12:07:41 +02:00
hkalbasi
7834b8fadb
Add unused_variables
native diagnostic
2023-09-24 21:29:15 +03:30
Laurențiu Nicola
bcfc997eac
Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-from-ra
2023-09-18 12:33:49 +03:00
Lukas Wirth
affe5a7315
fix: Temporarily skip decl check in derive expansions
2023-09-12 23:10:03 +02:00
Lukas Wirth
8f5fee4a5a
Diagnose incorrect and private fields in record structs
2023-09-09 10:45:29 +02:00
Lukas Wirth
55c75450fb
Diagnose private fields in record constructor
2023-09-08 23:19:30 +02:00
Lukas Wirth
8654a098c7
Diagnose mismatched arg count for tuple struct patterns
2023-09-08 14:54:43 +02:00
Lukas Wirth
8eddc64f86
Simplify
2023-09-02 17:12:57 +02:00
Lukas Wirth
b1575528c0
Move doc comment handling into ide-db
2023-09-02 16:27:26 +02:00
Lukas Wirth
0bf0563a00
Add a few more db.unwind_if_cancelled()
calls
2023-09-02 14:39:19 +02:00
Laurențiu Nicola
30d8aa1bec
Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra
2023-08-21 12:44:09 +03:00
Lukas Wirth
eb6244c5f9
Record import aliases in symbol index
2023-08-18 11:46:35 +02:00
bors
b771de3fdc
Auto merge of #15179 - ponyii:fix/default-values-of-const-params-are-ignored, r=HKalbasi
...
the "add missing members" assists: implemented substitution of default values of const params
To achieve this, I've made `hir::ConstParamData` store the default values
2023-08-15 10:17:43 +00:00
bors
0fa822dfe1
Auto merge of #15418 - oxalica:fix/sig-from-macro, r=Veykril
...
Fix signature help of methods from macros
Currently the receiver type is copied from AST instead re-formatting through `HirDisplay`. Macro generated functions seem to have no spaces and their signature help are rendered like `fn foo(&'amutself)` instead of `fn foo(&'a mut self)`.
2023-08-15 06:25:13 +00:00
Lukas Wirth
9adff006e8
Simplify
2023-08-10 20:10:19 +02:00
bors
ddbbd6a7e7
Auto merge of #15417 - lowr:patch/purge-generic-arg-data-in-expr, r=HKalbasi
...
internal: use `Cast::cast()` instead of explicit interning
I firmly believe that we should generally use `cast()` instead of interning `GenericArgData` to construct `GenericArg` because it's less verbose and more readable.
2023-08-08 19:27:18 +00:00
oxalica
de86444756
Prefer hir::SelfParam
and fix signature help of methods from macros
2023-08-09 02:42:08 +08:00
oxalica
6a2f83a8a2
Impl HirDisplay
for SelfParam
2023-08-09 02:26:44 +08:00
ponyii
e4c45427dc
refactoring
2023-08-08 21:57:55 +04:00
ponyii
4ebdc6f052
syntax update: the default value of ConstParam
turned from Expr
into ConstArg
2023-08-08 21:57:54 +04:00
ponyii
52b4392724
the "add missing members" assists: implemented substitution of default values of const params
2023-08-08 21:57:54 +04:00
Ryo Yoshida
6aa03c5d15
Use Cast::cast()
instead of interning GenericArgData
2023-08-09 00:47:29 +09:00
Laurențiu Nicola
aa55ce9567
Merge commit 'baee6b338b0ea076cd7a9f18d47f175dd2ba0e5d' into sync-from-ra
2023-08-07 12:03:15 +03:00
Ryo Yoshida
0c433c23b1
Support doc links that resolve to fields
2023-08-07 00:59:35 +09:00
Lukas Wirth
6e2c3f610b
Remove suspicious unwrap
2023-08-02 12:18:10 +02:00
Lukas Wirth
bcff166b3a
Add ExternCrateDecl to HIR
2023-08-02 11:52:55 +02:00
Laurențiu Nicola
0155385b57
Merge commit '99718d0c8bc5aadd993acdcabc1778fc7b5cc572' into sync-from-ra
2023-07-24 12:21:34 +03:00
bors
59d35d24a7
Auto merge of #15320 - lowr:fix/incorrect-name-case-for-inner-items, r=HKalbasi
...
Report `incorrect-ident-case` for inner items
Fixes #15319
Although we have been collecting the diagnostics for inner items within function bodies, we were discarding them and never reported to the users. This PR makes sure that they are all reported and additionally collects the diagnostics for inner items within const bodies, static bodies, and enum variant bodies.
2023-07-21 06:41:30 +00:00
Ryo Yoshida
b53a07835b
Report incorrect case for fn inner items
2023-07-21 15:07:49 +09:00
hkalbasi
eb143383c3
Pass TraitEnvironment
into layout_ty
and const_eval
2023-07-20 13:08:38 +03:30
Laurențiu Nicola
4704881b64
Merge commit '37f84c101bca43b11027f30ab0c2852f9325bc3d' into sync-from-ra
2023-07-17 16:49:15 +03:00
Lukas Wirth
6a7b905c86
Fix the eager token maps by re-mapping the textranges between the input and input expansion
2023-07-13 09:22:38 +02:00
Lukas Wirth
d5f64f875a
Infallibe ExpandDatabase::macro_def
2023-07-10 16:23:29 +02:00
hkalbasi
f0ba0dbe8a
Use debug impl in rendering const eval result
2023-07-08 01:07:38 +03:30
hkalbasi
4a444e768c
Implement recursion in mir interpreter without recursion
2023-07-07 15:07:29 +03:30
hkalbasi
3a1054fc1c
Replace x
with it
2023-07-06 17:33:17 +03:30
Lukas Wirth
8886d707b8
Stronger typing for AstId and AstIdMap
2023-07-04 09:16:15 +02:00
bors
45272efec5
Auto merge of #14990 - HKalbasi:diagnostic-map, r=HKalbasi
...
Map our diagnostics to rustc and clippy's ones
And control their severity by lint attributes `#[allow]`, `#[deny]` and ... .
It doesn't work with proc macros and I would like to fix that before merge but I don't know how to do it.
2023-07-03 18:58:47 +00:00
Lukas Wirth
69cd3c30ac
Format let-else
2023-07-03 20:34:09 +02:00
Lukas Wirth
321e570d92
Don't diagnose builtin derives
2023-07-03 14:23:36 +02:00
Ryo Yoshida
56dd5368f5
Refactor
...
- don't take `&self` as receiver for `Copy` types
- simplify `hir::Module::nearest_non_block_module()`
- style changes for consistency
2023-06-27 16:01:07 +09:00
hkalbasi
674cd5ab57
Add run-tests command
2023-06-22 19:33:37 +03:30
Lukas Wirth
d8b970f1fc
Skip mutable diagnostics on synthetic bindings
2023-06-21 19:38:19 +02:00
Laurențiu Nicola
9326cf7f0c
Merge commit 'cd3bf9fe51676b520c546460e6d8919b8c8ff99f' into sync-from-ra
2023-06-19 09:14:04 +03:00
Lukas Wirth
83d7724629
fix: Add binding definition for for-expr iterator desugared binding
2023-06-18 11:44:01 +02:00
hkalbasi
e55a1f1916
Map our diagnostics to rustc and clippy's ones
2023-06-15 01:47:22 +03:30
bors
9c967d3809
Auto merge of #15053 - Veykril:crate-root-module-id, r=Veykril
...
internal: Add a CrateRootModuleId that encodes a module id that is always a crate root
2023-06-14 14:41:06 +00:00
Lukas Wirth
cf178cba8f
internal: Add a CrateRootModuleId that encodes a module id that is always a crate root
2023-06-14 15:41:06 +02:00
Lukas Wirth
abe249559d
internal: Give ConstBlockId and InTypeConstId named Location types
2023-06-12 18:21:17 +02:00
bors
6b3659d38f
Auto merge of #15026 - lowr:fix/deduplicate-compl-fields, r=Veykril
...
fix: deduplicate fields and types in completion
Fixes #15024
- `hir_ty::autoderef()` (which is only meant to be used outside `hir-ty`) now deduplicates types and completely resolves inference variables within.
- field completion now deduplicates fields of the same name and only picks such field of the first type in the deref chain.
2023-06-12 12:53:53 +00:00
Ryo Yoshida
b4795507e3
autoderef: completely resolve and deduplicate types
2023-06-11 19:34:22 +09:00
hkalbasi
a481e004b0
Lower const params with a bad id
2023-06-11 00:39:28 +03:30
bors
95228d23bb
Auto merge of #14875 - ponyii:fix/implement-missing-members-do-not-transform-lifetimes, r=Veykril
...
fix: implemeted lifetime transformation fot assits
A part of https://github.com/rust-lang/rust-analyzer/issues/13363
I expect to implement transformation of const params in a separate PR
Other assists and a completion affected:
- `generate_function` currently just ignores lifetimes and, consequently, is not affected
- `inline_call` and `replace_derive_with...` don't seem to need lifetime transformation
- `trait_impl` (a completion) is fixed and tested
2023-06-10 13:22:50 +00:00
Viktor Lott
8103a10a78
update assist to include more literals
2023-06-06 00:34:00 +02:00
Laurențiu Nicola
c48062fe2a
Merge commit 'aa9bc8612514d216f84eec218dfd19ab83f3598a' into sync-from-ra
2023-06-05 12:04:23 +03:00
hkalbasi
71f3e4b08c
Detect "bound more than once" error and suppress need-mut
for it.
2023-06-04 12:39:36 +03:30
ponyii
7f45cccda4
lifetime transformation: refactoring & a new test
2023-06-03 21:34:31 +04:00
ponyii
fe8f862757
made the add_missing_impl_members
and add_missing_default_members
assists transform lifetimes
2023-06-03 21:12:11 +04:00
bors
0677c204ca
Auto merge of #14947 - HKalbasi:render-const, r=HKalbasi
...
Add enum, reference, array and slice to `render_const_scalar`
2023-06-02 10:18:36 +00:00
hkalbasi
f9e3b180b7
Add enum, reference, array and slice to render_const_scalar
2023-06-02 13:47:02 +03:30
Lukas Wirth
dc7c6d43c7
Slightly shrink DefMap
2023-06-01 14:46:36 +02:00
Lukas Wirth
ecb8616870
fix: Don't duplicate sysroot crates in rustc workspace
2023-05-31 15:37:35 +02:00
Lukas Wirth
3c862507b9
Add render configs for memory layout hovers
2023-05-30 18:36:06 +02:00
Lukas Wirth
1275adc200
Don't leak rustc Layout in hir layer
2023-05-30 13:54:30 +02:00
Lukas Wirth
3514f2f2ab
Render niches on hover
2023-05-30 13:49:43 +02:00
hkalbasi
51368793b4
MIR episode 6
2023-05-28 23:25:15 +03:30
Lukas Wirth
8bc826dd53
Add diagnostic for _
expressions (typed holes)
2023-05-28 14:55:28 +02:00
Lukas Wirth
be9cc0baae
Render size, align and offset hover values in hex
2023-05-26 16:41:45 +02:00
Lukas Wirth
c7ef6c25b7
internal: Replace Display impl for Name
2023-05-24 20:55:12 +02:00
hkalbasi
cae9660a1d
Add layout info for enum variant and locals
2023-05-18 21:03:03 +03:30
hkalbasi
b55fbd3ad7
Add moved-out-of-ref
diagnostic
2023-05-18 19:17:06 +03:30
bors
034d7c8537
Auto merge of #14787 - HKalbasi:mir2, r=HKalbasi
...
MIR episode 5
This PR inits drop support (it is very broken at this stage, some things are dropped multiple time, drop scopes are wrong, ...) and adds stdout support (`println!` doesn't work since its expansion is dummy, but `stdout().write(b"hello world\n")` works if you use `RA_SYSROOT_HACK`) for interpreting. There is no useful unit test that it can interpret yet, but it is a good sign that it didn't hit a major road block yet.
In MIR lowering, it adds support for slice pattern and anonymous const blocks, and some fixes so that we can evaluate `SmolStr::new_inline` in const eval. With these changes, 57 failed mir body remains.
2023-05-18 09:44:26 +00:00
hkalbasi
261047d019
Fix layout for hir_ty::Ty
and friends
2023-05-18 11:29:03 +03:30
bors
c06f088968
Auto merge of #14823 - Veykril:discriminant-inlays, r=Veykril
...
fix: Discriminant hints only render for datacarrying enums with primitive repr
2023-05-18 05:50:41 +00:00
Lukas Wirth
c12ede8c34
fix: Discriminant hints only render for datacarrying enums with primitive repr
2023-05-16 22:15:39 +02:00
Lukas Wirth
08dc0e21af
feat: Render hover actions for closure captures and sig
2023-05-15 19:35:27 +02:00
hkalbasi
cbcafd3539
MIR episode 5
2023-05-12 18:17:15 +03:30
Lukas Wirth
4c5fd19ee5
Render places in capture inlay hints
2023-05-08 09:50:58 +02:00
Lukas Wirth
8081a654da
feat: Closure capture inlay hints
2023-05-05 13:38:22 +02:00
hkalbasi
36c9d5ce17
Fix pattern type mismatch in tuples
2023-05-04 16:03:36 +03:30
Laurențiu Nicola
7197a27028
Use triomphe Arc
2023-05-02 20:02:43 +03:00
bors
94ac1cdbf5
Auto merge of #14715 - Veykril:symbol-index, r=Veykril
...
Refactor symbol index
Closes https://github.com/rust-lang/rust-analyzer/issues/14677
instead of eagerly fetching the source data in symbol index we do it lazily now, this shouldn't make it much more expensive as we had to parse the source most of the time anyways even after fetching.
2023-05-02 10:34:53 +00:00
Lukas Wirth
f501c6a516
Refactor symbol index
2023-05-02 12:11:42 +02:00
bors
466b4ec547
Auto merge of #14714 - jhgg:hover/exclude-sized-trait-in-goto-actions, r=Veykril
...
fix: ide: exclude sized in go-to actions in hover
fixes #13163
i opted to just simply omit `Sized` entirely from go-to actions, as opposed to including it if even someone writes an explicit `T: Sized`, as i think a go-to on Sized is of dubious value practically.
2023-05-02 08:30:17 +00:00
Jake Heinz
3132a9e7fc
fix: ide: exclude sized in go-to actions
2023-05-02 08:19:59 +00:00
Lukas Wirth
a64626d99e
Highlight closure captures when cursor is on pipe
2023-05-02 08:59:40 +02:00
hkalbasi
6312fbf521
MIR episode 4
2023-05-01 23:23:10 +03:30
hkalbasi
5df545b3f0
Add hover for closure
2023-04-30 14:31:43 +03:30
wtj
c533ac3573
minor: fix typos
2023-04-28 18:49:05 +08:00
bors
2400b36a2e
Auto merge of #14577 - jsoref:spelling, r=lnicola
...
Spelling
This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling ).
The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796
The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293
closes #14567
2023-04-19 14:05:40 +00:00
Josh Soref
bc7d84c3ce
Spelling
...
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Lukas Wirth
d1632c2727
Report syntax errors from item level macro expansions
2023-04-16 17:22:06 +02:00
Lukas Wirth
a5558cdfe5
internal: Report macro definition errors on the definition
2023-04-16 14:15:59 +02:00
Lukas Wirth
0bb9a17312
internal: Move layout logic from hir-def to hir-ty
2023-04-16 12:21:12 +02:00
hkalbasi
7cb4318331
Fix explicit deref problems in closure capture
2023-04-14 15:32:40 +03:30
hkalbasi
59b6f2d9f2
Compute closure captures
2023-04-10 23:04:34 +03:30
Lukas Wirth
a1b96b1e00
Remove unnecessary Names from FunctionData::params
2023-04-06 20:14:51 +02:00
Lukas Wirth
3f5c9920d6
Move hir_def::builtin_attr to hir_def::attr::builtin
2023-04-06 19:55:49 +02:00
Lukas Wirth
40c068f502
Use hir_def::builtin_attr::find_builtin_attr_idx
2023-04-06 19:44:29 +02:00
Lukas Wirth
99b69525f4
hir_def::expr -> hir_def::hir, hir_def::type_ref -> hir_def::hir::type_ref
2023-04-06 19:36:25 +02:00
Lukas Wirth
8e7c104b3a
Move hir_def::adt to hir_def::data::adt
2023-04-06 19:23:29 +02:00
Lukas Wirth
fbb1bd5880
Re-enable controlflow outside loop diagnostic
2023-04-06 15:37:53 +02:00
Lukas Wirth
0e7117900c
internal: Resolve labels in body lowering
2023-04-06 14:21:20 +02:00
Lukas Wirth
b3919ea80d
Cleanup crate_graph construction
2023-03-31 14:14:04 +02:00
Lukas Wirth
fc840dbb2d
internal: Don't expose InferenceTable outside of hir-ty
2023-03-30 13:27:10 +02:00
Lukas Wirth
251b3a47af
Simplify
2023-03-30 09:21:10 +02:00
Lukas Wirth
342fd2b9f3
fix: Properly handle local trait impls
2023-03-28 08:34:29 +02:00
hkalbasi
8a3ad7c3d5
Support evaluating inherent associated constants with generics
2023-03-21 02:20:30 +03:30
Laurențiu Nicola
dbf04a5ee2
⬆️ rust-analyzer
2023-03-20 08:31:01 +02:00
Lukas Wirth
f34b2469bd
lint incoherent inherent impls
2023-03-14 19:20:44 +01:00
bors
def4dbb520
Auto merge of #14336 - swarnimarun:remove-slice, r=lnicola
...
internal: add `as_slice` to `hir::Type`
~`remove_slice`~ `as_slice` is same as `remove_ref` but for slices.
Though there is `as_array` which I believe was named such because it also gets the length of the array, maybe. I am still shaky on the names feel free to suggest corrections.
2023-03-14 09:20:58 +00:00
Swarnim Arun
cfbdf62344
fix: as suggested change remove_slice
to as_slice
2023-03-13 17:28:37 +05:30
Swarnim Arun
34e3ea8cc8
feat: add remove_slice
to hir::Type
2023-03-13 16:49:24 +05:30
Swarnim Arun
fe82649e77
feat: add is_float
& is_char
to hir::Type
2023-03-13 15:47:50 +05:30
Laurențiu Nicola
b2f6fd4f96
⬆️ rust-analyzer
2023-03-13 10:42:24 +02:00
bors
70e10deee8
Auto merge of #14326 - iDawer:refactor, r=Veykril
...
internal: Rename `hir::diagnostics::MissingMatchArms.match_expr` field
`hir::diagnostics::MissingMatchArms.match_expr` had confusing name: it is pointing to scrutinee expression. Renamed to `scrutinee_expr` and used better fitting type for it.
Also small refactorings/cleanup.
2023-03-11 07:36:00 +00:00
iDawer
5e8c586f3b
Refactor hir::diagnostics::MissingMatchArms fields, better naming
2023-03-10 18:22:32 +05:00
Lukas Wirth
879cac4b28
minor: Remove dead code
2023-03-09 15:40:51 +01:00
bors
44ff3c407a
Auto merge of #14232 - HKalbasi:mir, r=Veykril
...
MIR episode 2
This PR adds:
1. `need-mut` and `unused-mut` diagnostics
2. `View mir` command which shows MIR for the body under cursor, useful for debugging
3. MIR lowering for or-patterns and for-loops
2023-03-07 09:49:49 +00:00
bors
31c12ec282
Auto merge of #14266 - Veykril:generalize-eager-lazy, r=Veykril
...
feature: Make replace_or_with_or_else assists more generally applicable
2023-03-06 21:41:46 +00:00
Lukas Wirth
199bc82ce8
feature: Make replace_or_with_or_else assists more generally applicable
2023-03-06 22:17:30 +01:00
hkalbasi
af90ec8096
Partially support "overloaded deref" MIR lowering
2023-03-06 21:09:09 +03:30
hkalbasi
ac04bfd7a7
Add View Mir
command and fix some bugs
2023-03-06 21:09:09 +03:30
hkalbasi
a25710b0c0
Add need-mut
and unused-mut
diagnostics
2023-03-06 21:09:08 +03:30
hkalbasi
61ad6a96ad
Add BindingId
2023-03-06 21:09:08 +03:30
hkalbasi
ae8ce99d97
Bring back the hex in const hover
2023-03-05 13:53:49 +03:30
Lukas Wirth
29150c2315
Disable pattern type mismatches again
2023-03-03 22:41:41 +01:00
Lukas Wirth
e7485a0416
Diagnose unresolved method calls
2023-03-03 20:43:13 +01:00
Lukas Wirth
78b2dd813a
Diagnose unresolved field accesses
2023-03-03 20:43:10 +01:00
Lukas Wirth
3c7a0aa00e
Diagnose call expression on non-callable things
2023-03-03 20:43:05 +01:00
bors
3ba876a4a6
Auto merge of #14240 - Veykril:coerce-many, r=Veykril
...
Diagnose value breaks in incorrect breakables
2023-03-03 17:03:39 +00:00
Lukas Wirth
41f234df09
Diagnose value breaks in incorrect breakables
2023-03-03 17:28:57 +01:00
bors
6756294aa0
Auto merge of #14184 - lowr:feat/trait-alias-def, r=Veykril
...
Handle trait alias definitions
Part of #2773
This PR adds a bunch of structs and enum variants for trait aliases. Trait aliases should be handled as an independent item because they are semantically distinct from traits.
I basically started by adding `TraitAlias{Id, Loc}` to `hir_def::item_tree` and iterated adding necessary stuffs until compiler stopped complaining what's missing. Let me know if there's still anything I need to add.
I'm opening up this PR for early review and stuff. I'm planning to add tests for IDE functionalities in this PR, but not type-related support, for which I put FIXME notes.
2023-03-03 15:45:18 +00:00
Ryo Yoshida
29c957f973
Lower and handle trait aliases in HIR
2023-03-04 00:24:07 +09:00
bors
c229a836e8
Auto merge of #14222 - Veykril:pat-mismatch-diags, r=Veykril
...
Show pattern mismatch diagnostics
2023-03-03 10:33:54 +00:00
Lukas Wirth
fc2b395e00
Show pattern mismatch diagnostics
2023-03-03 10:41:44 +01:00
Ryo Yoshida
bda2af71c6
feat: allow generate_function
to generate in different local crate
2023-03-03 18:40:13 +09:00
bors
32424d0aba
Auto merge of #14176 - lowr:fix/assoc-func-vis-in-local-impl, r=Veykril
...
Fix associated item visibility in block-local impls
Fixes #14046
When we're resolving visibility of block-local items...
> `self` normally refers to the containing non-block module, and `super` to its parent (etc.). However, visibilities must only refer to a module in the DefMap they're written in, so we restrict them when that happens. ([link])
...unless we're resolving visibility of associated items in block-local impls, because that impl is semantically "hoisted" to the nearest (non-block) module. With this PR, we skip the adjustment for such items.
Since visibility representation of those items is modified, this PR also adjusts visibility rendering in `HirDisplay`.
[link]: a6603fc21d/crates/hir-def/src/nameres/path_resolution.rs (L101-L103)
2023-03-01 12:40:55 +00:00