mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Support trait method call autoimports
This commit is contained in:
parent
8f959f20ee
commit
d5c3808545
2 changed files with 251 additions and 141 deletions
|
@ -548,6 +548,10 @@ impl Function {
|
|||
let mut validator = ExprValidator::new(self.id, infer, sink);
|
||||
validator.validate_body(db);
|
||||
}
|
||||
|
||||
pub fn container(self, db: &impl DefDatabase) -> AssocContainerId {
|
||||
self.id.lookup(db).container
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
@ -699,7 +703,7 @@ impl AssocItem {
|
|||
|
||||
pub fn container(self, db: &impl DefDatabase) -> AssocContainerId {
|
||||
match self {
|
||||
AssocItem::Function(f) => f.id.lookup(db).container,
|
||||
AssocItem::Function(f) => f.container(db),
|
||||
AssocItem::Const(c) => c.id.lookup(db).container,
|
||||
AssocItem::TypeAlias(t) => t.id.lookup(db).container,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue