@@ -2819,7 +2819,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
28192819 // binder moved -\
28202820 let ty: ty:: Binder < Ty < ' tcx > > = ty:: Binder :: bind ( ty) ; // <----/
28212821
2822- self . infcx . in_snapshot ( |_| {
2822+ self . infcx . commit_unconditionally ( |_| {
28232823 let ( skol_ty, _) = self . infcx
28242824 . replace_bound_vars_with_placeholders ( & ty) ;
28252825 let Normalized {
@@ -2932,7 +2932,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
29322932 }
29332933
29342934 fn confirm_projection_candidate ( & mut self , obligation : & TraitObligation < ' tcx > ) {
2935- self . infcx . in_snapshot ( |snapshot| {
2935+ self . infcx . commit_unconditionally ( |snapshot| {
29362936 let result =
29372937 self . match_projection_obligation_against_definition_bounds (
29382938 obligation,
@@ -3054,19 +3054,20 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
30543054 nested,
30553055 ) ;
30563056
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+ } ) ;
30703071
30713072 // Adds the predicates from the trait. Note that this contains a `Self: Trait`
30723073 // predicate as usual. It won't have any effect since auto traits are coinductive.
@@ -3089,7 +3090,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
30893090
30903091 // First, create the substitutions by matching the impl again,
30913092 // this time not in a probe.
3092- self . infcx . in_snapshot ( |snapshot| {
3093+ self . infcx . commit_unconditionally ( |snapshot| {
30933094 let substs = self . rematch_impl ( impl_def_id, obligation, snapshot) ;
30943095 debug ! ( "confirm_impl_candidate: substs={:?}" , substs) ;
30953096 let cause = obligation. derived_cause ( ImplDerivedObligation ) ;
@@ -3253,7 +3254,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
32533254 obligation, alias_def_id
32543255 ) ;
32553256
3256- self . infcx . in_snapshot ( |_| {
3257+ self . infcx . commit_unconditionally ( |_| {
32573258 let ( predicate, _) = self . infcx ( )
32583259 . replace_bound_vars_with_placeholders ( & obligation. predicate ) ;
32593260 let trait_ref = predicate. trait_ref ;
0 commit comments