@@ -2819,7 +2819,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2819
2819
// binder moved -\
2820
2820
let ty: ty:: Binder < Ty < ' tcx > > = ty:: Binder :: bind ( ty) ; // <----/
2821
2821
2822
- self . infcx . in_snapshot ( |_| {
2822
+ self . infcx . commit_unconditionally ( |_| {
2823
2823
let ( skol_ty, _) = self . infcx
2824
2824
. replace_bound_vars_with_placeholders ( & ty) ;
2825
2825
let Normalized {
@@ -2932,7 +2932,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2932
2932
}
2933
2933
2934
2934
fn confirm_projection_candidate ( & mut self , obligation : & TraitObligation < ' tcx > ) {
2935
- self . infcx . in_snapshot ( |snapshot| {
2935
+ self . infcx . commit_unconditionally ( |snapshot| {
2936
2936
let result =
2937
2937
self . match_projection_obligation_against_definition_bounds (
2938
2938
obligation,
@@ -3054,19 +3054,20 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3054
3054
nested,
3055
3055
) ;
3056
3056
3057
- let trait_obligations: Vec < PredicateObligation < ' _ > > = self . infcx . in_snapshot ( |_| {
3058
- let poly_trait_ref = obligation. predicate . to_poly_trait_ref ( ) ;
3059
- let ( trait_ref, _) = self . infcx
3060
- . replace_bound_vars_with_placeholders ( & poly_trait_ref) ;
3061
- let cause = obligation. derived_cause ( ImplDerivedObligation ) ;
3062
- self . impl_or_trait_obligations (
3063
- cause,
3064
- obligation. recursion_depth + 1 ,
3065
- obligation. param_env ,
3066
- trait_def_id,
3067
- & trait_ref. substs ,
3068
- )
3069
- } ) ;
3057
+ let trait_obligations: Vec < PredicateObligation < ' _ > > =
3058
+ self . infcx . commit_unconditionally ( |_| {
3059
+ let poly_trait_ref = obligation. predicate . to_poly_trait_ref ( ) ;
3060
+ let ( trait_ref, _) = self . infcx
3061
+ . replace_bound_vars_with_placeholders ( & poly_trait_ref) ;
3062
+ let cause = obligation. derived_cause ( ImplDerivedObligation ) ;
3063
+ self . impl_or_trait_obligations (
3064
+ cause,
3065
+ obligation. recursion_depth + 1 ,
3066
+ obligation. param_env ,
3067
+ trait_def_id,
3068
+ & trait_ref. substs ,
3069
+ )
3070
+ } ) ;
3070
3071
3071
3072
// Adds the predicates from the trait. Note that this contains a `Self: Trait`
3072
3073
// predicate as usual. It won't have any effect since auto traits are coinductive.
@@ -3089,7 +3090,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3089
3090
3090
3091
// First, create the substitutions by matching the impl again,
3091
3092
// this time not in a probe.
3092
- self . infcx . in_snapshot ( |snapshot| {
3093
+ self . infcx . commit_unconditionally ( |snapshot| {
3093
3094
let substs = self . rematch_impl ( impl_def_id, obligation, snapshot) ;
3094
3095
debug ! ( "confirm_impl_candidate: substs={:?}" , substs) ;
3095
3096
let cause = obligation. derived_cause ( ImplDerivedObligation ) ;
@@ -3253,7 +3254,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3253
3254
obligation, alias_def_id
3254
3255
) ;
3255
3256
3256
- self . infcx . in_snapshot ( |_| {
3257
+ self . infcx . commit_unconditionally ( |_| {
3257
3258
let ( predicate, _) = self . infcx ( )
3258
3259
. replace_bound_vars_with_placeholders ( & obligation. predicate ) ;
3259
3260
let trait_ref = predicate. trait_ref ;
0 commit comments