Regression test for issue #60654.

This commit is contained in:
Felix S. Klock II 2019-05-24 14:02:05 +02:00
parent 8e4132a55c
commit c235ba4d0b
2 changed files with 26 additions and 0 deletions

View File

@ -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() { }

View File

@ -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`.