Skip to content

Commit aa9369c

Browse files
committed
Add test
1 parent 26afc4f commit aa9369c

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
trait Bug {
2+
type Item: Bug;
3+
4+
const FUN: fn() -> Self::Item;
5+
}
6+
7+
impl Bug for &() {
8+
existential type Item: Bug; //~ ERROR existential types are unstable
9+
//~^ ERROR the trait bound `(): Bug` is not satisfied
10+
//~^^ ERROR could not find defining uses
11+
12+
const FUN: fn() -> Self::Item = || ();
13+
}
14+
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
error[E0658]: existential types are unstable
2+
--> $DIR/issue-60371.rs:8:5
3+
|
4+
LL | existential type Item: Bug;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/34511
8+
= help: add #![feature(existential_type)] to the crate attributes to enable
9+
10+
error[E0277]: the trait bound `(): Bug` is not satisfied
11+
--> $DIR/issue-60371.rs:8:5
12+
|
13+
LL | existential type Item: Bug;
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bug` is not implemented for `()`
15+
|
16+
= help: the following implementations were found:
17+
<&() as Bug>
18+
= note: the return type of a function must have a statically known size
19+
20+
error: could not find defining uses
21+
--> $DIR/issue-60371.rs:8:5
22+
|
23+
LL | existential type Item: Bug;
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
26+
error: aborting due to 3 previous errors
27+
28+
Some errors have detailed explanations: E0277, E0658.
29+
For more information about an error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)