forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#61118 - pnkfelix:issue-60654-dont-ice-on-ga…
…t, r=varkor Dont ICE on an attempt to use GAT without feature gate Fix rust-lang#60654
- Loading branch information
Showing
4 changed files
with
40 additions
and
10 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
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
14 changes: 14 additions & 0 deletions
14
src/test/ui/rfc1598-generic-associated-types/gat-dont-ice-on-absent-feature.rs
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,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() { } |
12 changes: 12 additions & 0 deletions
12
src/test/ui/rfc1598-generic-associated-types/gat-dont-ice-on-absent-feature.stderr
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,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`. |