mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Remove the custom impl of AttrsOwner for ImplItem
The default impl should have the same behaviour, and it can be generated by codegen. See also `ModuleItem` and `NominalDef`
This commit is contained in:
parent
7614439033
commit
27ce1e822b
3 changed files with 4 additions and 12 deletions
|
@ -2,7 +2,7 @@
|
||||||
//! Extensions for various expressions live in a sibling `expr_extensions` module.
|
//! Extensions for various expressions live in a sibling `expr_extensions` module.
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ast::{self, child_opt, children, AstChildren, AstNode, AttrInput, SyntaxNode},
|
ast::{self, child_opt, children, AstNode, AttrInput, SyntaxNode},
|
||||||
SmolStr, SyntaxElement,
|
SmolStr, SyntaxElement,
|
||||||
SyntaxKind::*,
|
SyntaxKind::*,
|
||||||
SyntaxToken, T,
|
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)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum StructKind {
|
pub enum StructKind {
|
||||||
Tuple(ast::TupleFieldDefList),
|
Tuple(ast::TupleFieldDefList),
|
||||||
|
|
|
@ -1298,6 +1298,7 @@ impl AstNode for ImplItem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl ast::AttrsOwner for ImplItem {}
|
||||||
impl ImplItem {}
|
impl ImplItem {}
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct ImplTraitType {
|
pub struct ImplTraitType {
|
||||||
|
|
|
@ -401,7 +401,8 @@ Grammar(
|
||||||
traits: ["AttrsOwner"]
|
traits: ["AttrsOwner"]
|
||||||
),
|
),
|
||||||
"ImplItem": (
|
"ImplItem": (
|
||||||
enum: ["FnDef", "TypeAliasDef", "ConstDef"]
|
enum: ["FnDef", "TypeAliasDef", "ConstDef"],
|
||||||
|
traits: ["AttrsOwner"]
|
||||||
),
|
),
|
||||||
|
|
||||||
"TupleExpr": (
|
"TupleExpr": (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue