Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustc paniked when I tried to use GAT #67424

Closed
Cosmius opened this issue Dec 19, 2019 · 3 comments · Fixed by #67543
Closed

rustc paniked when I tried to use GAT #67424

Cosmius opened this issue Dec 19, 2019 · 3 comments · Fixed by #67543
Labels
A-GATs Area: Generic associated types (GATs) E-needs-test 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 glacier ICE tracked in rust-lang/glacier. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Cosmius
Copy link

Cosmius commented Dec 19, 2019

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

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`.
@Cosmius
Copy link
Author

Cosmius commented Dec 19, 2019

Seems a duplicate of #49362 , I did not noticed it when I was opening this issue, sorry.

There is also a small difference that I did not turn on #![feature(generic_associated_types)]

@Centril Centril added F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 19, 2019
@Centril
Copy link
Contributor

Centril commented Dec 20, 2019

cc #67160 & @matthewjasper

@matthewjasper matthewjasper added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated labels Dec 22, 2019
@matthewjasper
Copy link
Contributor

This should be fixed in the next nightly

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 22, 2019
Centril added a commit to Centril/rust that referenced this issue Dec 23, 2019
…-DPC

Add regression tests for fixed ICEs

Closes rust-lang#61747 (fixed from 1.41.0-nightly (4007d4e 2019-12-01))
Closes rust-lang#66205 (fixed from 1.41.0-nightly (4007d4e 2019-12-01))
Closes rust-lang#66270 (fixed by rust-lang#66246)
Closes rust-lang#66868 (fixed by rust-lang#67071)
Closes rust-lang#67424 (fixed by rust-lang#67160)

Also picking a minor nit up from rust-lang#67071 with 101dd7b

r? @Centril
Centril added a commit to Centril/rust that referenced this issue Dec 23, 2019
…-DPC

Add regression tests for fixed ICEs

Closes rust-lang#61747 (fixed from 1.41.0-nightly (4007d4e 2019-12-01))
Closes rust-lang#66205 (fixed from 1.41.0-nightly (4007d4e 2019-12-01))
Closes rust-lang#66270 (fixed by rust-lang#66246)
Closes rust-lang#66868 (fixed by rust-lang#67071)
Closes rust-lang#67424 (fixed by rust-lang#67160)

Also picking a minor nit up from rust-lang#67071 with 101dd7b

r? @Centril
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Dec 24, 2019
Add regression tests for fixed ICEs

Closes rust-lang#61747 (fixed from 1.41.0-nightly (4007d4e 2019-12-01))
Closes rust-lang#66205 (fixed from 1.41.0-nightly (4007d4e 2019-12-01))
Closes rust-lang#66270 (fixed by rust-lang#66246)
Closes rust-lang#67424 (fixed by rust-lang#67160)

Also picking a minor nit up from rust-lang#67071 with 101dd7b

r? @Centril
@bors bors closed this as completed in 07effe1 Dec 24, 2019
@fmease fmease added the A-GATs Area: Generic associated types (GATs) label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-GATs Area: Generic associated types (GATs) E-needs-test 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 glacier ICE tracked in rust-lang/glacier. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants