]>
git.proxmox.com Git - rustc.git/blob - tests/ui/traits/safety-trait-impl.rs
1 // Check that unsafe traits require unsafe impls and that inherent
2 // impls cannot be unsafe.
8 unsafe trait UnsafeTrait
{
12 unsafe impl UnsafeTrait
for u8 { }
// OK
14 impl UnsafeTrait
for u16 { }
//~ ERROR requires an `unsafe impl` declaration
16 unsafe impl SafeTrait
for u32 { }
//~ ERROR the trait `SafeTrait` is not unsafe