diff options
| author | Boxy <supbscripter@gmail.com> | 2023-02-12 19:32:07 +0000 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2023-02-12 19:32:07 +0000 |
| commit | 57ad73aa27dcfc1341e62738b3b79690a51beccd (patch) | |
| tree | 00180c3218add053a74477f459aec025ac562366 /compiler/rustc_trait_selection/src/traits | |
| parent | a85b0101e6a1d7d2a7a51d0e5472c1a1215b3031 (diff) | |
| download | rust-57ad73aa27dcfc1341e62738b3b79690a51beccd.tar.gz rust-57ad73aa27dcfc1341e62738b3b79690a51beccd.zip | |
rename query and use `NoSolution`
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/misc.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/mod.rs | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/misc.rs b/compiler/rustc_trait_selection/src/traits/misc.rs index 39654258dcd..de730773794 100644 --- a/compiler/rustc_trait_selection/src/traits/misc.rs +++ b/compiler/rustc_trait_selection/src/traits/misc.rs @@ -6,6 +6,7 @@ use rustc_data_structures::fx::FxIndexSet; use rustc_hir as hir; use rustc_infer::infer::canonical::Canonical; use rustc_infer::infer::{RegionResolutionError, TyCtxtInferExt}; +use rustc_infer::traits::query::NoSolution; use rustc_infer::{infer::outlives::env::OutlivesEnvironment, traits::FulfillmentError}; use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt, TypeVisitable}; use rustc_span::DUMMY_SP; @@ -134,10 +135,10 @@ pub fn type_allowed_to_implement_copy<'tcx>( Ok(()) } -pub fn check_const_param_definitely_unequal<'tcx>( +pub fn check_tys_might_be_eq<'tcx>( tcx: TyCtxt<'tcx>, canonical: Canonical<'tcx, (ParamEnv<'tcx>, Ty<'tcx>, Ty<'tcx>)>, -) -> Result<(), ()> { +) -> Result<(), NoSolution> { let (infcx, (param_env, ty_a, ty_b), _) = tcx.infer_ctxt().build_with_canonical(DUMMY_SP, &canonical); let ocx = ObligationCtxt::new(&infcx); @@ -147,5 +148,5 @@ pub fn check_const_param_definitely_unequal<'tcx>( // we don't get errors from obligations being ambiguous. let errors = ocx.select_where_possible(); - if errors.len() > 0 || result.is_err() { Err(()) } else { Ok(()) } + if errors.len() > 0 || result.is_err() { Err(NoSolution) } else { Ok(()) } } diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index f34d55531e7..227119ac7ac 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -554,7 +554,7 @@ pub fn provide(providers: &mut ty::query::Providers) { specialization_graph_of: specialize::specialization_graph_provider, specializes: specialize::specializes, subst_and_check_impossible_predicates, - check_const_param_definitely_unequal: misc::check_const_param_definitely_unequal, + check_tys_might_be_eq: misc::check_tys_might_be_eq, is_impossible_method, ..*providers }; |
