mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
RemoveDeadCode
This commit is contained in:
parent
6be50f7d5d
commit
8f1a83b4cb
1 changed files with 0 additions and 17 deletions
|
@ -39,23 +39,6 @@ impl SyntaxPtr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct OwnedAst<T> {
|
|
||||||
syntax: SyntaxNode,
|
|
||||||
phantom: PhantomData<T>,
|
|
||||||
}
|
|
||||||
|
|
||||||
trait ToAst {
|
|
||||||
type Ast;
|
|
||||||
fn to_ast(self) -> Self::Ast;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> ToAst for &'a OwnedAst<ast::FnDef<'static>> {
|
|
||||||
type Ast = ast::FnDef<'a>;
|
|
||||||
fn to_ast(self) -> ast::FnDef<'a> {
|
|
||||||
ast::FnDef::cast(self.syntax.borrowed()).unwrap()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A pionter to a syntax node inside a file.
|
/// A pionter to a syntax node inside a file.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
pub(crate) struct LocalSyntaxPtr {
|
pub(crate) struct LocalSyntaxPtr {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue