mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Fix bug when $crate in LHS in mbe
This commit is contained in:
parent
1a29934c37
commit
74a24adc8e
2 changed files with 8 additions and 5 deletions
|
@ -109,6 +109,10 @@ fn next_op<'a>(first: &tt::TokenTree, src: &mut TtIter<'a>, mode: Mode) -> Resul
|
|||
let id = punct.id;
|
||||
Op::Var { name, kind, id }
|
||||
}
|
||||
tt::Leaf::Ident(ident) if ident.text == "crate" => {
|
||||
// We simply produce identifier `$crate` here. And it will be resolved when lowering ast to Path.
|
||||
Op::Leaf(tt::Leaf::from(tt::Ident { text: "$crate".into(), id: ident.id }))
|
||||
}
|
||||
tt::Leaf::Ident(ident) => {
|
||||
let name = ident.text.clone();
|
||||
let kind = eat_fragment_kind(src, mode)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue