mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Merge pull request #18427 from ChayimFriedman2/cleanup-ty
Cleanup TypeRef lowering
This commit is contained in:
commit
3fd6a72556
12 changed files with 151 additions and 170 deletions
|
@ -2033,7 +2033,7 @@ impl HirDisplayWithTypesMap for TypeRefId {
|
|||
TypeRef::Macro(macro_call) => {
|
||||
let (mut types_map, mut types_source_map) =
|
||||
(TypesMap::default(), TypesSourceMap::default());
|
||||
let ctx = hir_def::lower::LowerCtx::new(
|
||||
let mut ctx = hir_def::lower::LowerCtx::new(
|
||||
f.db.upcast(),
|
||||
macro_call.file_id,
|
||||
&mut types_map,
|
||||
|
@ -2041,7 +2041,7 @@ impl HirDisplayWithTypesMap for TypeRefId {
|
|||
);
|
||||
let macro_call = macro_call.to_node(f.db.upcast());
|
||||
match macro_call.path() {
|
||||
Some(path) => match Path::from_src(&ctx, path) {
|
||||
Some(path) => match Path::from_src(&mut ctx, path) {
|
||||
Some(path) => path.hir_fmt(f, &types_map)?,
|
||||
None => write!(f, "{{macro}}")?,
|
||||
},
|
||||
|
|
|
@ -465,13 +465,13 @@ impl<'a> TyLoweringContext<'a> {
|
|||
let (mut types_map, mut types_source_map) =
|
||||
(TypesMap::default(), TypesSourceMap::default());
|
||||
|
||||
let ctx = expander.ctx(
|
||||
let mut ctx = expander.ctx(
|
||||
self.db.upcast(),
|
||||
&mut types_map,
|
||||
&mut types_source_map,
|
||||
);
|
||||
// FIXME: Report syntax errors in expansion here
|
||||
let type_ref = TypeRef::from_ast(&ctx, expanded.tree());
|
||||
let type_ref = TypeRef::from_ast(&mut ctx, expanded.tree());
|
||||
|
||||
drop(expander);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue