-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ecbf42
commit 875acc3
Showing
6 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
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
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
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,14 @@ | ||
use sealed::sealed; | ||
|
||
#[sealed(partial)] | ||
pub trait A { | ||
#[seal] | ||
fn sealed() {} | ||
} | ||
|
||
#[sealed(partial)] | ||
pub trait B { | ||
fn not_sealed(); | ||
} | ||
|
||
fn main() {} |
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,11 @@ | ||
error: This trait is partially sealed, however none of its methods are implementable, so the `partial` argument does nothing. | ||
--> tests/fail/09-partial-argument.rs:4:11 | ||
| | ||
4 | pub trait A { | ||
| ^ | ||
|
||
error: This trait is partially sealed, however none of its methods are sealed, so it does nothing. Either seal a function or remove `partial` from the `sealed` attribute. | ||
--> tests/fail/09-partial-argument.rs:10:11 | ||
| | ||
10 | pub trait B { | ||
| ^ |
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,9 @@ | ||
use sealed::sealed; | ||
|
||
#[sealed(partial)] | ||
pub trait A { | ||
#[seal] | ||
fn sealed(); | ||
} | ||
|
||
fn main() {} |
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,5 @@ | ||
error: This function is sealed from implementation, but it does not have a default implementation. This effectively seals the entire trait, which would be clearer to do by not having the trait seal be partial. | ||
--> tests/fail/10-partial-without-default.rs:5:2 | ||
| | ||
5 | #[seal] | ||
| ^^^^^^^ |