diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-01-12 16:33:13 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-01-12 16:33:29 +0000 |
| commit | 4586fdce47e70ed4fe8568a6578bde2ed9faa31e (patch) | |
| tree | 4cea6a30aa42defe383bc6085fd154309ad3e9df /compiler/rustc_hir_analysis/src/astconv/mod.rs | |
| parent | 174e73a3f6df6f96ab453493796e461164dea94a (diff) | |
| download | rust-4586fdce47e70ed4fe8568a6578bde2ed9faa31e.tar.gz rust-4586fdce47e70ed4fe8568a6578bde2ed9faa31e.zip | |
Taint `_` placeholder types
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv/mod.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/astconv/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs index 2886ec21320..49887cfb617 100644 --- a/compiler/rustc_hir_analysis/src/astconv/mod.rs +++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs @@ -2543,7 +2543,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { self.suggest_trait_fn_ty_for_impl_fn_infer(hir_id, Some(i)) { infer_replacements.push((a.span, suggested_ty.to_string())); - return suggested_ty; + return Ty::new_error_with_message( + self.tcx(), + a.span, + suggested_ty.to_string(), + ); } } @@ -2561,7 +2565,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { self.suggest_trait_fn_ty_for_impl_fn_infer(hir_id, None) { infer_replacements.push((output.span, suggested_ty.to_string())); - suggested_ty + Ty::new_error_with_message(self.tcx(), output.span, suggested_ty.to_string()) } else { visitor.visit_ty(output); self.ast_ty_to_ty(output) |
