mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #2308
2308: Remove the custom impl of AttrsOwner for ImplItem r=matklad a=DJMcNab
The default impl should have the same behaviour, and it can be generated by codegen.
See also `ModuleItem` and `NominalDef`.
Also see 5dbbfda34a (r36011245)
Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
This commit is contained in:
commit
a4f21801c5
3 changed files with 4 additions and 12 deletions
|
@ -2,7 +2,7 @@
|
|||
//! Extensions for various expressions live in a sibling `expr_extensions` module.
|
||||
|
||||
use crate::{
|
||||
ast::{self, child_opt, children, AstChildren, AstNode, AttrInput, SyntaxNode},
|
||||
ast::{self, child_opt, children, AstNode, AttrInput, SyntaxNode},
|
||||
SmolStr, SyntaxElement,
|
||||
SyntaxKind::*,
|
||||
SyntaxToken, T,
|
||||
|
@ -176,16 +176,6 @@ impl ast::ImplBlock {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::AttrsOwner for ast::ImplItem {
|
||||
fn attrs(&self) -> AstChildren<ast::Attr> {
|
||||
match self {
|
||||
ast::ImplItem::FnDef(it) => it.attrs(),
|
||||
ast::ImplItem::TypeAliasDef(it) => it.attrs(),
|
||||
ast::ImplItem::ConstDef(it) => it.attrs(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum StructKind {
|
||||
Tuple(ast::TupleFieldDefList),
|
||||
|
|
|
@ -1298,6 +1298,7 @@ impl AstNode for ImplItem {
|
|||
}
|
||||
}
|
||||
}
|
||||
impl ast::AttrsOwner for ImplItem {}
|
||||
impl ImplItem {}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct ImplTraitType {
|
||||
|
|
|
@ -401,7 +401,8 @@ Grammar(
|
|||
traits: ["AttrsOwner"]
|
||||
),
|
||||
"ImplItem": (
|
||||
enum: ["FnDef", "TypeAliasDef", "ConstDef"]
|
||||
enum: ["FnDef", "TypeAliasDef", "ConstDef"],
|
||||
traits: ["AttrsOwner"]
|
||||
),
|
||||
|
||||
"TupleExpr": (
|
||||
|
|
Loading…
Reference in a new issue