Skip to content

Commit 70c3cf5

Browse files
committed
remove normalize call
1 parent d1a8d56 commit 70c3cf5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
804804
debug_assert!(self.shallow_resolve(a) == a);
805805
debug_assert!(self.shallow_resolve(b) == b);
806806

807-
let InferOk { value: b, mut obligations } =
808-
self.at(&self.cause, self.param_env).normalize(b);
809-
810807
match b.kind() {
811808
ty::FnPtr(_, b_hdr) => {
812809
let mut a_sig = a.fn_sig(self.tcx);
@@ -838,9 +835,8 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
838835
}
839836
}
840837

841-
let InferOk { value: a_sig, obligations: o1 } =
838+
let InferOk { value: a_sig, mut obligations } =
842839
self.at(&self.cause, self.param_env).normalize(a_sig);
843-
obligations.extend(o1);
844840

845841
let InferOk { value, obligations: o2 } = self.coerce_from_safe_fn(
846842
a_sig,
@@ -855,8 +851,8 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
855851
}
856852
}
857853

858-
/// Attempts to coerce from the type of a non-capturing closure
859-
/// into a function pointer.
854+
/// Attempts to coerce from a closure to a function pointer. Fails
855+
/// if the closure has any upvars.
860856
fn coerce_closure_to_fn(
861857
&self,
862858
a: Ty<'tcx>,

0 commit comments

Comments
 (0)