File tree 1 file changed +7
-2
lines changed
prusti-interface/src/environment
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -510,10 +510,15 @@ impl<'tcx> Environment<'tcx> {
510
510
let param_env = self . tcx . param_env ( caller_def_id) ;
511
511
512
512
// `resolve_instance` below requires normalized substs.
513
- let call_substs = self . tcx . normalize_erasing_regions ( param_env, call_substs) ;
513
+ let normalized_call_substs = self . tcx . normalize_erasing_regions ( param_env, call_substs) ;
514
514
515
- traits:: resolve_instance ( self . tcx , param_env. and ( ( called_def_id, call_substs ) ) )
515
+ traits:: resolve_instance ( self . tcx , param_env. and ( ( called_def_id, normalized_call_substs ) ) )
516
516
. map ( |opt_instance| opt_instance
517
+ // if the resolved instance is the same as what we queried for
518
+ // anyway, ignore it: this way we keep the regions in substs
519
+ // at least for non-trait-impl method calls
520
+ // TODO: different behaviour used for unsafe core proof
521
+ . filter ( |instance| !config:: unsafe_core_proof ( ) || instance. def_id ( ) != called_def_id)
517
522
. map ( |instance| ( instance. def_id ( ) , instance. substs ) )
518
523
. unwrap_or ( ( called_def_id, call_substs) ) )
519
524
. unwrap_or ( ( called_def_id, call_substs) )
You can’t perform that action at this time.
0 commit comments