From b2317a642d36e26e6cdf0624c38d461384f7b94e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 3 Jan 2023 01:09:08 +0000 Subject: [PATCH] has_overflow only if value is *not* within limit --- compiler/rustc_trait_selection/src/solve/overflow.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_trait_selection/src/solve/overflow.rs b/compiler/rustc_trait_selection/src/solve/overflow.rs index 8d73a83aec9..fdd6adb681b 100644 --- a/compiler/rustc_trait_selection/src/solve/overflow.rs +++ b/compiler/rustc_trait_selection/src/solve/overflow.rs @@ -36,7 +36,7 @@ pub(super) fn did_overflow(&self) -> bool { #[inline] pub(super) fn has_overflow(&self, depth: usize) -> bool { - self.current_limit.value_within_limit(depth + self.additional_depth) + !self.current_limit.value_within_limit(depth + self.additional_depth) } /// Updating the current limit when hitting overflow.