diff options
| author | lcnr <rust@lcnr.de> | 2023-03-14 14:19:06 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-03-21 09:57:20 +0100 |
| commit | 791ce0b7b5d03649bc9014d5b0abb78f3c6f2cfd (patch) | |
| tree | 4a321c50deba262c65a0dc552fbfaca8cc70de14 /compiler/rustc_const_eval | |
| parent | 84c47b8279b39e165dfebeb529eb6d92592e4f8d (diff) | |
| download | rust-791ce0b7b5d03649bc9014d5b0abb78f3c6f2cfd.tar.gz rust-791ce0b7b5d03649bc9014d5b0abb78f3c6f2cfd.zip | |
remove some trait solver helpers
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs index bb4b7ad50b8..6758cba2eed 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs @@ -9,7 +9,7 @@ use rustc_middle::mir; use rustc_middle::mir::*; use rustc_middle::ty::{self, subst::SubstsRef, AdtDef, Ty}; use rustc_trait_selection::traits::{ - self, ImplSource, Obligation, ObligationCause, SelectionContext, + self, ImplSource, Obligation, ObligationCause, ObligationCtxt, SelectionContext, }; use super::ConstCx; @@ -184,7 +184,10 @@ impl Qualif for NeedsNonConstDrop { } // If we had any errors, then it's bad - !traits::fully_solve_obligations(&infcx, impl_src.nested_obligations()).is_empty() + let ocx = ObligationCtxt::new(&infcx); + ocx.register_obligations(impl_src.nested_obligations()); + let errors = ocx.select_all_or_error(); + !errors.is_empty() } fn in_adt_inherently<'tcx>( |
