Skip to content

src/librustc/ich/impls_ty.rs:209: ty::TyKind::hash_stable() - can't hash a TyVid _#1t. #64863

Closed
@jrmuizel

Description

@jrmuizel

The following

#![feature(const_generics)]

struct A<T, const N: usize>([T; N]);

impl<T, const N: usize> A<T, {N}> {
    fn bar() -> Self {
        panic!()
    }

    fn foo() -> Self {
        A::bar()
    }
}

fn main() {
    println!("Hello, world!");
}

gives

warning: the feature `const_generics` is incomplete and may cause the compiler to crash
 --> src/main.rs:1:12
  |
1 | #![feature(const_generics)]
  |            ^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default

error: internal compiler error: src/librustc/ich/impls_ty.rs:209: ty::TyKind::hash_stable() - can't hash a TyVid _#1t.

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:912: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.40.0-nightly (084beb83e 2019-09-27) running on x86_64-apple-darwin

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

error: could not compile `o`.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.F-const_generics`#![feature(const_generics)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions