mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Address comments: fix docs, add completion test for Self
.
This commit is contained in:
parent
6bad638928
commit
b043358be9
4 changed files with 32 additions and 5 deletions
|
@ -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.push_scope(Scope::AdtScope(From::from(self)))
|
||||
r.push_scope(Scope::AdtScope(self.into()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ pub(crate) enum Scope {
|
|||
GenericParams(Arc<GenericParams>),
|
||||
/// Brings `Self` in `impl` block into scope
|
||||
ImplBlockScope(ImplBlock),
|
||||
/// Brings `Self` in enum definition into scope
|
||||
/// Brings `Self` in enum, struct and union definitions into scope
|
||||
AdtScope(Adt),
|
||||
/// Local bindings
|
||||
ExprScope(ExprScope),
|
||||
|
|
|
@ -559,9 +559,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
|
|||
match resolver.resolve_path_in_type_ns_fully(self.db, &path) {
|
||||
Some(TypeNs::Adt(Adt::Struct(it))) => it.into(),
|
||||
Some(TypeNs::Adt(Adt::Union(it))) => it.into(),
|
||||
Some(TypeNs::AdtSelfType(Adt::Struct(it))) => it.into(),
|
||||
Some(TypeNs::AdtSelfType(Adt::Union(it))) => it.into(),
|
||||
Some(TypeNs::AdtSelfType(Adt::Enum(it))) => it.into(),
|
||||
Some(TypeNs::AdtSelfType(adt)) => adt.into(),
|
||||
Some(TypeNs::EnumVariant(it)) => it.into(),
|
||||
Some(TypeNs::TypeAlias(it)) => it.into(),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue