From b54d72264aebf88e1099004c52aac6e4a06affd8 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 21 Feb 2024 10:38:54 +0000 Subject: [PATCH] Use `DefineOpaqueTypes::Yes` in diagnostics code --- .../src/traits/error_reporting/suggestions.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index fe2691e9d4d..af90372b97c 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -3842,7 +3842,9 @@ fn note_function_argument_obligation( self.probe(|_| { match self .at(&ObligationCause::misc(expr.span, body_id), param_env) - .eq(DefineOpaqueTypes::No, expected, actual) + // Doesn't actually matter if we define opaque types here, this is just used for + // diagnostics, and the result is never kept around. + .eq(DefineOpaqueTypes::Yes, expected, actual) { Ok(_) => (), // We ignore nested obligations here for now. Err(err) => type_diffs.push(err),