From 794cb890dee2df982403d85a951f9414f86b6daf Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 22 Apr 2023 03:54:33 +0000 Subject: Consider polarity in new solver --- compiler/rustc_middle/src/ty/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 42b98540ac7..8025697d6d1 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -861,6 +861,11 @@ impl<'tcx> PolyTraitPredicate<'tcx> { pub fn is_const_if_const(self) -> bool { self.skip_binder().is_const_if_const() } + + #[inline] + pub fn polarity(self) -> ImplPolarity { + self.skip_binder().polarity + } } /// `A: B` -- cgit 1.4.1-3-g733a5