1084: remove dead code r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-04-01 21:27:45 +00:00
commit c2912892ef
3 changed files with 0 additions and 37 deletions

View File

@ -25,13 +25,6 @@ pub trait AstNode:
fn syntax(&self) -> &SyntaxNode; fn syntax(&self) -> &SyntaxNode;
} }
pub trait AstToken: AstNode {
fn text(&self) -> &SmolStr {
// self.syntax().leaf_text().unwrap()
unimplemented!()
}
}
pub trait TypeAscriptionOwner: AstNode { pub trait TypeAscriptionOwner: AstNode {
fn ascribed_type(&self) -> Option<&TypeRef> { fn ascribed_type(&self) -> Option<&TypeRef> {
child_opt(self) child_opt(self)

View File

@ -4375,32 +4375,3 @@ impl WhileExpr {
} }
} }
// Whitespace
#[derive(Debug, PartialEq, Eq, Hash)]
#[repr(transparent)]
pub struct Whitespace {
pub(crate) syntax: SyntaxNode,
}
unsafe impl TransparentNewType for Whitespace {
type Repr = rowan::SyntaxNode<RaTypes>;
}
impl AstNode for Whitespace {
fn cast(syntax: &SyntaxNode) -> Option<&Self> {
match syntax.kind() {
WHITESPACE => Some(Whitespace::from_repr(syntax.into_repr())),
_ => None,
}
}
fn syntax(&self) -> &SyntaxNode { &self.syntax }
}
impl ToOwned for Whitespace {
type Owned = TreeArc<Whitespace>;
fn to_owned(&self) -> TreeArc<Whitespace> { TreeArc::cast(self.syntax.to_owned()) }
}
impl ast::AstToken for Whitespace {}
impl Whitespace {}

View File

@ -664,6 +664,5 @@ Grammar(
"TypeArg": (options: ["TypeRef"]), "TypeArg": (options: ["TypeRef"]),
"AssocTypeArg": (options: ["NameRef", "TypeRef"]), "AssocTypeArg": (options: ["NameRef", "TypeRef"]),
"LifetimeArg": (), "LifetimeArg": (),
"Whitespace": ( traits: ["AstToken"] ),
}, },
) )