File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
compiler/rustc_mir_build/src Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -132,21 +132,16 @@ impl<'tcx> TerminatorClassifier<'tcx> for CallRecursion<'tcx> {
132
132
return false ;
133
133
}
134
134
let caller = body. source . def_id ( ) ;
135
- let param_env = tcx . param_env ( caller ) ;
135
+ let typing_env = body . typing_env ( tcx ) ;
136
136
137
137
let func_ty = func. ty ( body, tcx) ;
138
138
if let ty:: FnDef ( callee, args) = * func_ty. kind ( ) {
139
- let Ok ( normalized_args) =
140
- tcx. try_normalize_erasing_regions ( ty:: TypingEnv :: from_param_env ( param_env) , args)
141
- else {
139
+ let Ok ( normalized_args) = tcx. try_normalize_erasing_regions ( typing_env, args) else {
142
140
return false ;
143
141
} ;
144
- let ( callee, call_args) = if let Ok ( Some ( instance) ) = Instance :: try_resolve (
145
- tcx,
146
- ty:: TypingEnv :: from_param_env ( param_env) ,
147
- callee,
148
- normalized_args,
149
- ) {
142
+ let ( callee, call_args) = if let Ok ( Some ( instance) ) =
143
+ Instance :: try_resolve ( tcx, typing_env, callee, normalized_args)
144
+ {
150
145
( instance. def_id ( ) , instance. args )
151
146
} else {
152
147
( callee, normalized_args)
You can’t perform that action at this time.
0 commit comments