File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
prusti-interface/src/environment Expand file tree Collapse file tree 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> {
510510 let param_env = self . tcx . param_env ( caller_def_id) ;
511511
512512 // `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) ;
514514
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 ) ) )
516516 . 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)
517522 . map ( |instance| ( instance. def_id ( ) , instance. substs ) )
518523 . unwrap_or ( ( called_def_id, call_substs) ) )
519524 . unwrap_or ( ( called_def_id, call_substs) )
You can’t perform that action at this time.
0 commit comments