-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement unification of const abstract impls
If two impls cover the entire set of possibilities: i.e. ``` impl TraitName for Struct<true> {} impl TraitName for Struct<false> {} ``` Then it would be expected that: ``` ... <const N: usize> ... where Struct<{N > 1}>: TraitName { ``` Should compile. This allows for such by generating a pseudo-impl for conditions which are exhaustive. Since these impls will never be instantiated as is, it is fine to have a fake impl. For now, this checks for a single bool condition, and whether both bool implementations are present. Change some of the api surface This adds separate functionality for checking for recursive traits versus exhaustive traits. But is still a WIP.
- Loading branch information
1 parent
866710c
commit 1a27a84
Showing
21 changed files
with
530 additions
and
2 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
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
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
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,31 @@ | ||
error[E0277]: the trait bound `ConstOption<usize, { N <= 0 }>: Default` is not satisfied | ||
--> $DIR/bool_cond.rs:42:5 | ||
| | ||
LL | #[derive(Default)] | ||
| ------- in this derive macro expansion | ||
... | ||
LL | _a: ConstOption<usize, { N <= 0 }>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `ConstOption<usize, { N <= 0 }>` | ||
| | ||
= help: the following other types implement trait `Default`: | ||
ConstOption<T, false> | ||
ConstOption<T, true> | ||
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `ConstOption<usize, { N <= 1 }>: Default` is not satisfied | ||
--> $DIR/bool_cond.rs:44:5 | ||
| | ||
LL | #[derive(Default)] | ||
| ------- in this derive macro expansion | ||
... | ||
LL | _b: ConstOption<usize, { N <= 1 }>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `ConstOption<usize, { N <= 1 }>` | ||
| | ||
= help: the following other types implement trait `Default`: | ||
ConstOption<T, false> | ||
ConstOption<T, true> | ||
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Oops, something went wrong.