Rollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelix
remove find_use_placement A more robust solution to finding where to place use suggestions was added in #94584. The algorithm uses the AST to find the span for the suggestion so we pass this span down to the HIR during lowering and use it instead of calling `find_use_placement` Fixes #94941
This commit is contained in:
commit
bdbf0998f3
12 changed files with 57 additions and 148 deletions
|
@ -584,7 +584,7 @@ impl<'hir> Map<'hir> {
|
|||
Some(OwnerNode::Item(&Item { span, kind: ItemKind::Mod(ref m), .. })) => {
|
||||
(m, span, hir_id)
|
||||
}
|
||||
Some(OwnerNode::Crate(item)) => (item, item.inner, hir_id),
|
||||
Some(OwnerNode::Crate(item)) => (item, item.spans.inner_span, hir_id),
|
||||
node => panic!("not a module: {:?}", node),
|
||||
}
|
||||
}
|
||||
|
@ -1012,7 +1012,7 @@ impl<'hir> Map<'hir> {
|
|||
Node::Infer(i) => i.span,
|
||||
Node::Visibility(v) => bug!("unexpected Visibility {:?}", v),
|
||||
Node::Local(local) => local.span,
|
||||
Node::Crate(item) => item.inner,
|
||||
Node::Crate(item) => item.spans.inner_span,
|
||||
};
|
||||
Some(span)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue