Handle macro-generated expressions slightly less wrong

This commit is contained in:
Aleksey Kladov 2019-11-14 10:30:30 +03:00
parent a73b7bb3f6
commit da2ca01eba
6 changed files with 62 additions and 48 deletions

View file

@ -145,7 +145,8 @@ impl Local {
Some(res)
})?;
let (_body, source_map) = db.body_with_source_map(parent);
let pat_id = source_map.node_pat(&src.ast.into())?;
let src = src.map(ast::Pat::from);
let pat_id = source_map.node_pat(src.as_ref())?;
Some(Local { parent, pat_id })
}
}