diff options
| author | Lukas Markeffsky <@> | 2024-01-05 21:55:09 +0100 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2024-01-05 21:56:32 +0100 |
| commit | 339fa311ad8140cfb98a1c6080ea7e002b9ce3fa (patch) | |
| tree | b4a2a3c2a3fa122a8761bcc03be10ca79f52920b /compiler/rustc_resolve/src | |
| parent | 274674819c3c37e09f5fe0e3276d3921068dbb95 (diff) | |
| download | rust-339fa311ad8140cfb98a1c6080ea7e002b9ce3fa.tar.gz rust-339fa311ad8140cfb98a1c6080ea7e002b9ce3fa.zip | |
fix cycle error for "use constructor" suggestion
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 6c38ed62270..1ccb4820cdd 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -1755,11 +1755,8 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> { .filter_map(|item| { // Only assoc fns that return `Self` let fn_sig = self.r.tcx.fn_sig(item.def_id).skip_binder(); - let ret_ty = fn_sig.output(); - let ret_ty = self - .r - .tcx - .normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), ret_ty); + // Don't normalize the return type, because that can cause cycle errors. + let ret_ty = fn_sig.output().skip_binder(); let ty::Adt(def, _args) = ret_ty.kind() else { return None; }; |
