mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +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
@ -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…
Reference in New Issue
Block a user