From 8014116e5f07eb99e2cd12c578f117f3b5280c69 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 2 Apr 2019 00:14:57 +0300 Subject: remove dead code --- crates/ra_syntax/src/ast.rs | 7 ------- crates/ra_syntax/src/ast/generated.rs | 29 ----------------------------- crates/ra_syntax/src/grammar.ron | 1 - 3 files changed, 37 deletions(-) diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 9a44afc67..ffd115cef 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -25,13 +25,6 @@ pub trait AstNode: fn syntax(&self) -> &SyntaxNode; } -pub trait AstToken: AstNode { - fn text(&self) -> &SmolStr { - // self.syntax().leaf_text().unwrap() - unimplemented!() - } -} - pub trait TypeAscriptionOwner: AstNode { fn ascribed_type(&self) -> Option<&TypeRef> { child_opt(self) diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 4afe1a146..1dc5d810d 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -4367,32 +4367,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; -} - -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; - fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } -} - - -impl ast::AstToken for Whitespace {} -impl Whitespace {} - diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 6d7a5a1cb..efc06c218 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron @@ -663,6 +663,5 @@ Grammar( "TypeArg": (options: ["TypeRef"]), "AssocTypeArg": (options: ["NameRef", "TypeRef"]), "LifetimeArg": (), - "Whitespace": ( traits: ["AstToken"] ), }, ) -- cgit v1.2.3