mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Finalize Trait grammar
This commit is contained in:
parent
b2cdb0b226
commit
c83467796b
42 changed files with 92 additions and 92 deletions
|
@ -99,8 +99,8 @@ impl HasSource for Static {
|
|||
}
|
||||
}
|
||||
impl HasSource for Trait {
|
||||
type Ast = ast::TraitDef;
|
||||
fn source(self, db: &dyn HirDatabase) -> InFile<ast::TraitDef> {
|
||||
type Ast = ast::Trait;
|
||||
fn source(self, db: &dyn HirDatabase) -> InFile<ast::Trait> {
|
||||
self.id.lookup(db.upcast()).source(db.upcast())
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ impl HasSource for ImplDef {
|
|||
}
|
||||
|
||||
impl HasSource for TypeParam {
|
||||
type Ast = Either<ast::TraitDef, ast::TypeParam>;
|
||||
type Ast = Either<ast::Trait, ast::TypeParam>;
|
||||
fn source(self, db: &dyn HirDatabase) -> InFile<Self::Ast> {
|
||||
let child_source = self.id.parent.child_source(db.upcast());
|
||||
child_source.map(|it| it[self.id.local_id].clone())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue