diff options
Diffstat (limited to 'tests/ui/traits/safety-inherent-impl.rs')
| -rw-r--r-- | tests/ui/traits/safety-inherent-impl.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/traits/safety-inherent-impl.rs b/tests/ui/traits/safety-inherent-impl.rs new file mode 100644 index 00000000000..50e15f0d25f --- /dev/null +++ b/tests/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() { } |
