diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2015-03-11 18:53:55 -0500 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2015-03-20 16:43:11 +0100 |
| commit | 38dbcb2e3718eab4bac9f5a3ec8226d7ee4f40a7 (patch) | |
| tree | f315ac84816c98b0251edcf98e1f3f92ff182fed /src/test | |
| parent | 01d24297eb6fe16abdf7869c60519650e3490faf (diff) | |
| download | rust-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.rs | 10 |
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() {} |
