Remove astconv usage in diagnostic
This commit is contained in:
parent
e4dd9edb76
commit
6fdfdea8b1
3 changed files with 67 additions and 10 deletions
|
@ -1336,16 +1336,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
hir::Path { segments: [segment], .. },
|
||||
))
|
||||
| hir::ExprKind::Path(QPath::TypeRelative(ty, segment)) => {
|
||||
let self_ty = self.astconv().ast_ty_to_ty(ty);
|
||||
if let Ok(pick) = self.probe_for_name(
|
||||
Mode::Path,
|
||||
Ident::new(capitalized_name, segment.ident.span),
|
||||
Some(expected_ty),
|
||||
IsSuggestion(true),
|
||||
self_ty,
|
||||
expr.hir_id,
|
||||
ProbeScope::TraitsInScope,
|
||||
) {
|
||||
if let Some(self_ty) = self.typeck_results.borrow().node_type_opt(ty.hir_id)
|
||||
&& let Ok(pick) = self.probe_for_name(
|
||||
Mode::Path,
|
||||
Ident::new(capitalized_name, segment.ident.span),
|
||||
Some(expected_ty),
|
||||
IsSuggestion(true),
|
||||
self_ty,
|
||||
expr.hir_id,
|
||||
ProbeScope::TraitsInScope,
|
||||
)
|
||||
{
|
||||
(pick.item, segment)
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue