-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement specialization for const traits
- Loading branch information
1 parent
f5be3ca
commit 3644c4a
Showing
4 changed files
with
138 additions
and
21 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
26 changes: 23 additions & 3 deletions
26
...traits/const-traits/specialization/const-default-bound-non-const-specialized-bound.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 |
---|---|---|
@@ -1,11 +1,31 @@ | ||
error: cannot specialize on const impl with non-const impl | ||
error[E0119]: conflicting implementations of trait `Bar` | ||
--> $DIR/const-default-bound-non-const-specialized-bound.rs:28:1 | ||
| | ||
LL | / impl<T> const Bar for T | ||
LL | | where | ||
LL | | T: ~const Foo, | ||
| |__________________- first implementation here | ||
... | ||
LL | / impl<T> Bar for T | ||
LL | | where | ||
LL | | T: Foo, //FIXME ~ ERROR missing `~const` qualifier | ||
LL | | T: Specialize, | ||
| |__________________^ | ||
| |__________________^ conflicting implementation | ||
|
||
error[E0119]: conflicting implementations of trait `Baz` | ||
--> $DIR/const-default-bound-non-const-specialized-bound.rs:48:1 | ||
| | ||
LL | / impl<T> const Baz for T | ||
LL | | where | ||
LL | | T: ~const Foo, | ||
| |__________________- first implementation here | ||
... | ||
LL | / impl<T> const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz` | ||
LL | | where | ||
LL | | T: Foo, | ||
LL | | T: Specialize, | ||
| |__________________^ conflicting implementation | ||
|
||
error: aborting due to 1 previous error | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
error: cannot specialize on const impl with non-const impl | ||
error[E0119]: conflicting implementations of trait `A` | ||
--> $DIR/specializing-constness.rs:23:1 | ||
| | ||
LL | impl<T: ~const Spec> const A for T { | ||
| ---------------------------------- first implementation here | ||
... | ||
LL | impl<T: Spec + Sup> A for T { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |