diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-02-20 19:07:39 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-02-20 19:11:07 +0000 |
| commit | 8ef535e03d8f34c7ad7aab14eea6a73bf4445b4c (patch) | |
| tree | ade146fde98cbef7307db62e97f03980bb04cc38 /compiler | |
| parent | e565eeed78d0e59e475dce34b0833bbf8f84871b (diff) | |
| download | rust-8ef535e03d8f34c7ad7aab14eea6a73bf4445b4c.tar.gz rust-8ef535e03d8f34c7ad7aab14eea6a73bf4445b4c.zip | |
Point out the type of more expressions on bad `?`
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 133d8a88de3..4004fdd073c 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -961,14 +961,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { let Some(typeck) = &self.typeck_results else { return false; }; - let Some((ObligationCauseCode::QuestionMark, Some(y))) = - obligation.cause.code().parent_with_predicate() - else { + let ObligationCauseCode::QuestionMark = obligation.cause.code().peel_derives() else { return false; }; - if !self.tcx.is_diagnostic_item(sym::FromResidual, y.def_id()) { - return false; - } let self_ty = trait_pred.skip_binder().self_ty(); let found_ty = trait_pred.skip_binder().trait_ref.args.get(1).and_then(|a| a.as_type()); |
