diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/traits/safety-inherent-impl.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/traits/safety-inherent-impl.rs b/src/test/ui/traits/safety-inherent-impl.rs new file mode 100644 index 000000000..50e15f0d2 --- /dev/null +++ b/src/test/ui/traits/safety-inherent-impl.rs @@ -0,0 +1,9 @@ +// Check that inherent impls cannot be unsafe. + +struct SomeStruct; + +unsafe impl SomeStruct { //~ ERROR inherent impls cannot be unsafe + fn foo(self) { } +} + +fn main() { } |