mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros
This commit is contained in:
parent
83370fe5d7
commit
a483d3bc37
39 changed files with 187 additions and 145 deletions
|
@ -120,7 +120,7 @@ impl<N: AstNode> From<AstPtr<N>> for SyntaxNodePtr {
|
|||
fn test_local_syntax_ptr() {
|
||||
use crate::{ast, AstNode, SourceFile};
|
||||
|
||||
let file = SourceFile::parse("struct Foo { f: u32, }").ok().unwrap();
|
||||
let file = SourceFile::parse("struct Foo { f: u32, }", parser::Edition::CURRENT).ok().unwrap();
|
||||
let field = file.syntax().descendants().find_map(ast::RecordField::cast).unwrap();
|
||||
let ptr = SyntaxNodePtr::new(field.syntax());
|
||||
let field_syntax = ptr.to_node(file.syntax());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue