diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-02-28 22:32:29 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-03-01 02:12:47 +0000 |
| commit | dab3d5bb281bd4be59b68adaa6f1f003c20ea303 (patch) | |
| tree | 2986dde9788bb78e65cc52db69e39ad3c8167c5d /compiler/rustc_trait_selection/src | |
| parent | c475e2303b551d726307c646181e0677af1e0069 (diff) | |
| download | rust-dab3d5bb281bd4be59b68adaa6f1f003c20ea303.tar.gz rust-dab3d5bb281bd4be59b68adaa6f1f003c20ea303.zip | |
Never say "`Trait` is implemented for `{type error}`"
When a trait bound error occurs, we look for alternative types that
would have made the bound succeed. For some reason `{type error}`
sometimes would appear as a type that would do so.
We now remove `{type error}` from the list in every case to avoid
nonsensical `note`s.
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs index dcbb63f00f7..de3231a0e86 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs @@ -1908,6 +1908,9 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { ct_op: |ct| ct.normalize(self.tcx, ty::ParamEnv::empty()), }, ); + if cand.references_error() { + return false; + } err.highlighted_help(vec