-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
rustc
paniked when I tried to use GAT, I didn't know rustc
does not support it then.
Anyway I think it is not supposed to panic.
I have confirmed with
- version 1.39 on Windows, my PC
- version 1.36 on Linux. https://repl.it/repls/ImpassionedSociableSystems
fn main() {
}
trait Trait1 {
type A;
}
trait Trait2 {
type Type1<B>: Trait1<A=B>;
}
It said,
error[E0658]: generic associated types are unstable
--> src/main.rs:9:3
|
9 | type Type1<B>: Trait1<A=B>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44265
error: internal compiler error: src\librustc\ty\subst.rs:557: type parameter `B/#1` (B/1) out of range when substituting (root type=Some(B)) substs=[Self]
thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:778:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.39.0 (4560ea788 2019-11-04) running on x86_64-pc-windows-msvc
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
jplatte
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.