Skip to content

Commit c235ba4

Browse files
committed
Regression test for issue #60654.
1 parent 8e4132a commit c235ba4

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is
2+
// missing the feature gate.
3+
4+
struct Foo;
5+
6+
impl Iterator for Foo {
7+
type Item<'b> = &'b Foo; //~ ERROR generic associated types are unstable [E0658]
8+
9+
fn next(&mut self) -> Option<Self::Item> {
10+
None
11+
}
12+
}
13+
14+
fn main() { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0658]: generic associated types are unstable
2+
--> $DIR/gat-dont-ice-on-absent-feature.rs:7:5
3+
|
4+
LL | type Item<'b> = &'b Foo;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/44265
8+
= help: add #![feature(generic_associated_types)] to the crate attributes to enable
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)