rust/tests/ui/traits/auxiliary/trait_safety_lib.rs
2023-01-11 09:32:08 +00:00

10 lines
183 B
Rust

// Simple smoke test that unsafe traits can be compiled etc.
pub unsafe trait Foo {
fn foo(&self) -> isize;
}
unsafe impl Foo for isize {
fn foo(&self) -> isize { *self }
}