diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-01 22:38:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-01 22:38:49 +0100 |
| commit | 06ca0de91c352bf9824d5f670fec0a7404fac8e1 (patch) | |
| tree | 6a33e706ee24bb4551294e2ebd208a5ada3ca133 /compiler/rustc_trait_selection/src/traits | |
| parent | 0d2205f9a6d907fb2f6beaef4c5958b8521349b4 (diff) | |
| parent | dab3d5bb281bd4be59b68adaa6f1f003c20ea303 (diff) | |
| download | rust-06ca0de91c352bf9824d5f670fec0a7404fac8e1.tar.gz rust-06ca0de91c352bf9824d5f670fec0a7404fac8e1.zip | |
Rollup merge of #121803 - estebank:dont-mention-type-error-e0277, r=compiler-errors
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/traits')
| -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 e6d5cb9f237..3aaed398f57 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 @@ -1916,6 +1916,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