mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-04 17:22:19 +00:00
13 lines
376 B
Rust
13 lines
376 B
Rust
//@ test-mir-pass: InstSimplify-after-simplifycfg
|
|
//@ needs-unwind
|
|
|
|
#![crate_type = "lib"]
|
|
#![feature(core_intrinsics)]
|
|
|
|
// EMIT_MIR align_of_slice.of_val_slice.InstSimplify-after-simplifycfg.diff
|
|
pub fn of_val_slice<T>(slice: &[T]) -> usize {
|
|
// CHECK-LABEL: fn of_val_slice(_1: &[T])
|
|
// CHECK: _0 = AlignOf(T);
|
|
unsafe { core::intrinsics::align_of_val(slice) }
|
|
}
|