blob: 82a7d2307f4500c8edb4ea7abe29cc94db7913e4 [file]
// { dg-additional-options "-w" }
#![feature(no_core)]
#![no_core]
#![feature(lang_items)]
#[lang = "sized"]
pub trait Sized {}
struct FatPtr<T> {
data: *const T,
len: usize,
}
pub union Repr<T> {
rust: *const [T],
rust_mut: *mut [T],
raw: FatPtr<T>,
}
impl<T> [T] {
pub const fn is_empty(&self) -> bool {
self.len() == 0
}
pub const fn len(&self) -> usize {
unsafe { Repr { rust: self }.raw.len }
}
}