Skip to content

Commit

Permalink
Regression test for issue rust-lang#60654.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed May 24, 2019
1 parent 8e4132a commit c235ba4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is
// missing the feature gate.

struct Foo;

impl Iterator for Foo {
type Item<'b> = &'b Foo; //~ ERROR generic associated types are unstable [E0658]

fn next(&mut self) -> Option<Self::Item> {
None
}
}

fn main() { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0658]: generic associated types are unstable
--> $DIR/gat-dont-ice-on-absent-feature.rs:7:5
|
LL | type Item<'b> = &'b Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44265
= help: add #![feature(generic_associated_types)] to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.

0 comments on commit c235ba4

Please sign in to comment.