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