about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2015-03-11 18:53:55 -0500
committerFlavio Percoco <flaper87@gmail.com>2015-03-20 16:43:11 +0100
commit38dbcb2e3718eab4bac9f5a3ec8226d7ee4f40a7 (patch)
treef315ac84816c98b0251edcf98e1f3f92ff182fed /src/test
parent01d24297eb6fe16abdf7869c60519650e3490faf (diff)
downloadrust-38dbcb2e3718eab4bac9f5a3ec8226d7ee4f40a7.tar.gz
rust-38dbcb2e3718eab4bac9f5a3ec8226d7ee4f40a7.zip
Check trait unsafety for defaulted traits
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/coherence-default-trait-impl.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/compile-fail/coherence-default-trait-impl.rs b/src/test/compile-fail/coherence-default-trait-impl.rs
index 6bcbefb904d..a5b31730737 100644
--- a/src/test/compile-fail/coherence-default-trait-impl.rs
+++ b/src/test/compile-fail/coherence-default-trait-impl.rs
@@ -21,4 +21,14 @@ impl MyTrait for .. {}
 impl MyTrait for .. {}
 //~^ ERROR conflicting implementations for trait `MyTrait`
 
+trait MySafeTrait: MarkerTrait {}
+
+unsafe impl MySafeTrait for .. {}
+//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
+
+unsafe trait MyUnsafeTrait: MarkerTrait {}
+
+impl MyUnsafeTrait for .. {}
+//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
+
 fn main() {}