Skip to content

let a: Vec<&str, "aaa"> = Vec::new(); emits internal compiler error #58811

Closed
@rchaser53

Description

@rchaser53

The below code emits unexpectedly panicked in 1.34.0-nightly(2019-02-27).

let a: Vec<&str, "aaa"> = Vec::new();

Error message:

error: internal compiler error: src/librustc_typeck/collect.rs:1321: unexpected const parent in type_of_def_id(): Ty(type(Vec<&str, >))

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:620:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error

Playground link:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=916dc66418a31a3a104e88b0e070b6c8

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions