From 7808f69ad7a31e54719bf71017b745ee3ceac167 Mon Sep 17 00:00:00 2001 From: lcnr Date: Thu, 7 Jul 2022 11:04:36 +0200 Subject: [PATCH] `QueryNormalizer` bug on ambiguity --- compiler/rustc_trait_selection/src/traits/query/normalize.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs index eccfb3477b9dd..449d7a7b47b1f 100644 --- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs @@ -254,7 +254,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> { let result = tcx.normalize_projection_ty(c_data)?; // We don't expect ambiguity. if result.is_ambiguous() { - return Err(NoSolution); + bug!("unexpected ambiguity: {:?} {:?}", c_data, result); } let InferOk { value: result, obligations } = self.infcx.instantiate_query_response_and_region_obligations( @@ -293,7 +293,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> { let result = tcx.normalize_projection_ty(c_data)?; // We don't expect ambiguity. if result.is_ambiguous() { - return Err(NoSolution); + bug!("unexpected ambiguity: {:?} {:?}", c_data, result); } let InferOk { value: result, obligations } = self.infcx.instantiate_query_response_and_region_obligations(