Skip to content

Commit ead96f7

Browse files
committed
Allow #[unstable] impls for fn() with unstable abi.
1 parent e60016e commit ead96f7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

compiler/rustc_passes/src/stability.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,10 +888,15 @@ impl<'tcx> Visitor<'tcx> for CheckTraitImplStable<'tcx> {
888888
}
889889

890890
fn visit_ty(&mut self, t: &'tcx Ty<'tcx>) {
891-
if let TyKind::Never = t.kind {
892-
self.fully_stable = false;
891+
match t.kind {
892+
TyKind::Never => self.fully_stable = false,
893+
TyKind::BareFn(f) => {
894+
if rustc_target::spec::abi::is_stable(f.abi.name()).is_err() {
895+
self.fully_stable = false;
896+
}
897+
}
898+
_ => intravisit::walk_ty(self, t),
893899
}
894-
intravisit::walk_ty(self, t)
895900
}
896901
}
897902

0 commit comments

Comments
 (0)