diff options
| author | bors <bors@rust-lang.org> | 2024-10-29 19:25:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-29 19:25:03 +0000 |
| commit | 1e4f10ba6476e48a42a79b9f846a2d9366525b9e (patch) | |
| tree | 66c68bd54e4c3891de7c37e48c563a9b79177192 /compiler/rustc_trait_selection | |
| parent | e473783d90e2289b8a97575fa60d6315f0a318eb (diff) | |
| parent | 07afe8d12f1c72bdc46f052088922943ca91bcdd (diff) | |
| download | rust-1e4f10ba6476e48a42a79b9f846a2d9366525b9e.tar.gz rust-1e4f10ba6476e48a42a79b9f846a2d9366525b9e.zip | |
Auto merge of #132326 - matthiaskrgr:rollup-ngyw18g, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #131984 (Stabilize if_let_rescope) - #132151 (Ensure that resume arg outlives region bound for coroutines) - #132157 (Remove detail from label/note that is already available in other note) - #132274 (Cleanup op lookup in HIR typeck) - #132319 (cg_llvm: Clean up FFI calls for setting module flags) - #132321 (xous: sync: remove `rustc_const_stable` attribute on Condvar and Mutex new()) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index a7d1f1bd8d0..8e0bdce1280 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -5105,24 +5105,13 @@ pub(super) fn get_explanation_based_on_obligation<'tcx>( _ => None, }; - let pred = obligation.predicate; - let (_, base) = obligation.cause.code().peel_derives_with_predicate(); - let post = if let ty::PredicateKind::Clause(clause) = pred.kind().skip_binder() - && let ty::ClauseKind::Trait(pred) = clause - && let Some(base) = base - && base.skip_binder() != pred - { - format!(", which is required by `{base}`") - } else { - String::new() - }; let desc = match ty_desc { Some(desc) => format!(" {desc}"), None => String::new(), }; if let ty::PredicatePolarity::Positive = trait_predicate.polarity() { format!( - "{pre_message}the trait `{}` is not implemented for{desc} `{}`{post}", + "{pre_message}the trait `{}` is not implemented for{desc} `{}`", trait_predicate.print_modifiers_and_trait_path(), tcx.short_ty_string(trait_predicate.self_ty().skip_binder(), &mut None), ) @@ -5130,7 +5119,7 @@ pub(super) fn get_explanation_based_on_obligation<'tcx>( // "the trait bound `T: !Send` is not satisfied" reads better than "`!Send` is // not implemented for `T`". // FIXME: add note explaining explicit negative trait bounds. - format!("{pre_message}the trait bound `{trait_predicate}` is not satisfied{post}") + format!("{pre_message}the trait bound `{trait_predicate}` is not satisfied") } } } |
