mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Encode edition within FileId in the hir layer
This commit is contained in:
parent
92268627a8
commit
5264f86242
160 changed files with 1117 additions and 824 deletions
|
@ -206,10 +206,11 @@ fn validate_snippet(
|
|||
) -> Option<(Box<[GreenNode]>, String, Option<Box<str>>)> {
|
||||
let mut imports = Vec::with_capacity(requires.len());
|
||||
for path in requires.iter() {
|
||||
let use_path = ast::SourceFile::parse(&format!("use {path};"), syntax::Edition::CURRENT)
|
||||
.syntax_node()
|
||||
.descendants()
|
||||
.find_map(ast::Path::cast)?;
|
||||
let use_path =
|
||||
ast::SourceFile::parse(&format!("use {path};"), syntax::Edition::CURRENT_FIXME)
|
||||
.syntax_node()
|
||||
.descendants()
|
||||
.find_map(ast::Path::cast)?;
|
||||
if use_path.syntax().text() != path.as_str() {
|
||||
return None;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue