mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Remove arm::t32-specific function pointer test.
All function pointers are currently treated as unaligned anyway; any change implementing function pointer alignment during consteval should add tests that it works properly on arm::t32 functions.
This commit is contained in:
@@ -42,18 +42,6 @@ fn aligned_foo() {}
|
||||
unsafe { std::mem::transmute(aligned_foo as fn()) }
|
||||
};
|
||||
|
||||
// Only on armv5te-* and armv4t-*
|
||||
#[cfg(all(
|
||||
target_arch = "arm",
|
||||
not(target_feature = "v6"),
|
||||
))]
|
||||
const ALIGNED_THUMB_FN_PTR: *const () = {
|
||||
#[rustc_align(2)]
|
||||
#[instruction_set(arm::t32)]
|
||||
fn aligned_thumb_foo() {}
|
||||
unsafe { std::mem::transmute(aligned_thumb_foo as fn()) }
|
||||
};
|
||||
|
||||
trait Trait {
|
||||
#[allow(unused)]
|
||||
fn method(&self) -> u8;
|
||||
@@ -204,14 +192,10 @@ fn method(&self) -> u8 { 2 }
|
||||
// due to platform-specific semantics.
|
||||
// See https://github.com/rust-lang/rust/issues/144661
|
||||
// FIXME: This could return `Some` on platforms where function pointers' addresses actually
|
||||
// correspond to function addresses including alignment, or on ARM if t32 function pointers
|
||||
// have their low bit set for consteval.
|
||||
// correspond to function addresses including alignment, or on platforms where all functions
|
||||
// are aligned to some amount (e.g. ARM where a32 function pointers are at least 4-aligned,
|
||||
// and t32 function pointers are 2-aligned-offset-by-1).
|
||||
do_test!(ALIGNED_FN_PTR, ALIGNED_FN_PTR.wrapping_byte_offset(1), None);
|
||||
#[cfg(all(
|
||||
target_arch = "arm",
|
||||
not(target_feature = "v6"),
|
||||
))]
|
||||
do_test!(ALIGNED_THUMB_FN_PTR, ALIGNED_THUMB_FN_PTR.wrapping_byte_offset(1), None);
|
||||
|
||||
// Conservatively say we don't know.
|
||||
do_test!(FN_PTR, VTABLE_PTR_1, None);
|
||||
|
||||
Reference in New Issue
Block a user