-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Showing
2 changed files
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
trait Bug { | ||
type Item: Bug; | ||
|
||
const FUN: fn() -> Self::Item; | ||
} | ||
|
||
impl Bug for &() { | ||
existential type Item: Bug; //~ ERROR existential types are unstable | ||
//~^ ERROR the trait bound `(): Bug` is not satisfied | ||
//~^^ ERROR could not find defining uses | ||
|
||
const FUN: fn() -> Self::Item = || (); | ||
} | ||
|
||
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,29 @@ | ||
error[E0658]: existential types are unstable | ||
--> $DIR/issue-60371.rs:8:5 | ||
| | ||
LL | existential type Item: Bug; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/34511 | ||
= help: add #![feature(existential_type)] to the crate attributes to enable | ||
|
||
error[E0277]: the trait bound `(): Bug` is not satisfied | ||
--> $DIR/issue-60371.rs:8:5 | ||
| | ||
LL | existential type Item: Bug; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bug` is not implemented for `()` | ||
| | ||
= help: the following implementations were found: | ||
<&() as Bug> | ||
= note: the return type of a function must have a statically known size | ||
|
||
error: could not find defining uses | ||
--> $DIR/issue-60371.rs:8:5 | ||
| | ||
LL | existential type Item: Bug; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0277, E0658. | ||
For more information about an error, try `rustc --explain E0277`. |