mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Support inferring Self
type in enum definitions
Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
This commit is contained in:
parent
c73193efe2
commit
6bad638928
7 changed files with 54 additions and 9 deletions
|
@ -24,7 +24,7 @@ use crate::{
|
|||
U8, USIZE,
|
||||
},
|
||||
nameres::{CrateModuleId, ImportId, ModuleScope, Namespace},
|
||||
resolve::{Resolver, TypeNs},
|
||||
resolve::{Resolver, Scope, TypeNs},
|
||||
traits::TraitData,
|
||||
ty::{
|
||||
primitive::{FloatBitness, FloatTy, IntBitness, IntTy, Signedness},
|
||||
|
@ -465,7 +465,7 @@ impl Enum {
|
|||
// ...and add generic params, if present
|
||||
let p = self.generic_params(db);
|
||||
let r = if !p.params.is_empty() { r.push_generic_params_scope(p) } else { r };
|
||||
r
|
||||
r.push_scope(Scope::AdtScope(From::from(self)))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue