Rollup merge of #107779 - compiler-errors:issue-107775, r=jackh726
Remove astconv usage in diagnostic Fixes #107775 Location of the test sucks, I know, but I needed to put it somewhere 😓 The issue here is that the root cause of the issue has nothing to do with what's being tested, so I couldn't really give it a better name. Oh well.
This commit is contained in:
commit
fe26182281
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