Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/rustc_hir_analysis/src/coherence/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ fn visit_implementation_of_unpin(checker: &Checker<'_>) -> Result<(), ErrorGuara
}));
}
ty::Adt(_, _) => {}
// `extern type`s have no fields, so they can't be structurally pinned.
ty::Foreign(_) => {}
_ => {
return Err(tcx.dcx().span_delayed_bug(span, "impl of `Unpin` for a non-adt type"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::spec::{
pub(crate) fn target() -> Target {
let mut base = base::fuchsia::opts();
base.cpu = "generic".into();
base.features = "+v8a,+crc,+aes,+sha2,+neon".into();
base.features = "+v8a,+crc,+aes,+sha2,+neon,+fix-cortex-a53-835769".into();
base.max_atomic_width = Some(128);
base.stack_probes = StackProbeType::Inline;
base.supported_sanitizers = SanitizerSet::ADDRESS
Expand Down
14 changes: 14 additions & 0 deletions tests/codegen-llvm/aarch64-fuchsia-target-features.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ add-minicore
//@ compile-flags: --crate-type=rlib --target=aarch64-unknown-fuchsia
//@ needs-llvm-components: aarch64

// CHECK: attributes #0 = { {{.*}}"target-features"="{{.*}}+fix-cortex-a53-835769{{.*}}" }

#![feature(no_core, lang_items)]
#![no_core]

extern crate minicore;
use minicore::*;

#[no_mangle]
pub fn test() {}
11 changes: 0 additions & 11 deletions tests/crashes/155053.rs

This file was deleted.

18 changes: 18 additions & 0 deletions tests/ui/pin-ergonomics/impl-unpin-extern-type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//! Verify that a local `extern type` can manually implement `Unpin` with `pin_ergonomics` enabled.
//! Unlike a `#[pin_v2]` ADT, an extern type has no fields that could be structually pinned.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/155053>.

//@ check-pass

#![feature(pin_ergonomics)]
#![feature(extern_types)]
#![allow(incomplete_features)]

unsafe extern "C" {
type ExternType;
}

impl Unpin for ExternType {}

fn main() {}
Loading