-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for safe/unsafe negative impls
- Loading branch information
Showing
5 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
tests/ui/decl_safety/safe_trait-negative_impl_mismatch.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Error: check_neg_trait_impl(unsafe impl ! Foo for u32 {}) | ||
|
||
Caused by: | ||
negative impls cannot be unsafe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
crate baguette { | ||
trait Foo {} | ||
unsafe impl !Foo for u32 {} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@check-pass | ||
[ | ||
crate baguette { | ||
unsafe trait Foo {} | ||
impl !Foo for u32 {} | ||
} | ||
] |
4 changes: 4 additions & 0 deletions
4
tests/ui/decl_safety/unsafe_trait-negative_impl_mismatch.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Error: check_neg_trait_impl(unsafe impl ! Foo for u32 {}) | ||
|
||
Caused by: | ||
negative impls cannot be unsafe |
6 changes: 6 additions & 0 deletions
6
tests/ui/decl_safety/unsafe_trait-negative_impl_mismatch.π¬
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
crate baguette { | ||
unsafe trait Foo {} | ||
unsafe impl !Foo for u32 {} | ||
} | ||
] |