diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2022-10-19 12:41:35 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2022-10-19 12:41:35 +0200 |
| commit | ead96f7f749846a2310e7aaedef0ea38fc7c3a4a (patch) | |
| tree | e330b581169df21916fd0866a9f87e65db8d6719 | |
| parent | e60016eb55ec312dfac4b33cbb509435a05919ed (diff) | |
| download | rust-ead96f7f749846a2310e7aaedef0ea38fc7c3a4a.tar.gz rust-ead96f7f749846a2310e7aaedef0ea38fc7c3a4a.zip | |
Allow #[unstable] impls for fn() with unstable abi.
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index cfd6acd8d7c..78591e640e3 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -888,10 +888,15 @@ impl<'tcx> Visitor<'tcx> for CheckTraitImplStable<'tcx> { } fn visit_ty(&mut self, t: &'tcx Ty<'tcx>) { - if let TyKind::Never = t.kind { - self.fully_stable = false; + match t.kind { + TyKind::Never => self.fully_stable = false, + TyKind::BareFn(f) => { + if rustc_target::spec::abi::is_stable(f.abi.name()).is_err() { + self.fully_stable = false; + } + } + _ => intravisit::walk_ty(self, t), } - intravisit::walk_ty(self, t) } } |
