Skip to content

Commit d304aa3

Browse files
committed
account for safe target features in fndef<->closure and fndef<->fndef coerce-lubs
1 parent cac9606 commit d304aa3

File tree

2 files changed

+4
-2
lines changed
  • compiler/rustc_public/src

2 files changed

+4
-2
lines changed

compiler/rustc_public/src/mir/body.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ pub enum Safety {
978978
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Serialize)]
979979
pub enum PointerCoercion {
980980
/// Go from a fn-item type to a fn-pointer type.
981-
ReifyFnPointer,
981+
ReifyFnPointer(Safety),
982982

983983
/// Go from a safe fn pointer to an unsafe fn pointer.
984984
UnsafeFnPointer,

compiler/rustc_public/src/unstable/convert/stable/ty.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ impl<'tcx> Stable<'tcx> for ty::adjustment::PointerCoercion {
130130
) -> Self::T {
131131
use rustc_middle::ty::adjustment::PointerCoercion;
132132
match self {
133-
PointerCoercion::ReifyFnPointer => crate::mir::PointerCoercion::ReifyFnPointer,
133+
PointerCoercion::ReifyFnPointer(safety) => {
134+
crate::mir::PointerCoercion::ReifyFnPointer(safety.stable(tables, cx))
135+
}
134136
PointerCoercion::UnsafeFnPointer => crate::mir::PointerCoercion::UnsafeFnPointer,
135137
PointerCoercion::ClosureFnPointer(safety) => {
136138
crate::mir::PointerCoercion::ClosureFnPointer(safety.stable(tables, cx))

0 commit comments

Comments
 (0)