Skip to content

error: internal compiler error: "inference variables in ..." on packed type #61402

@zao

Description

@zao

Given the following source code in both release 1.35.0 and 1.36.0-nightly (e305df184 2019-04-24), I encounter an internal compiler error using nalgebra 0.18.0.

The code is probably not legal to begin with as I ran into it as I was moving from my own homebrewn math code to nalgebra. I have the impression that the compiler probably shouldn't ICE regardless of what junk you feed it, so I'm still reporting this.

use nalgebra::Vector3; #[derive(Debug, Clone, Copy)] #[repr(C, packed)] struct Vertex { pos: Vector3<f32>, clr: Vector3<f32>, }

Build output from cargo +nightly build:

 Compiling nalgebra v0.18.0 Compiling nalgebra-repro v0.1.0 (F:\Temp\nalgebra-repro) error: internal compiler error: inference variables in nalgebra::base::matrix::Matrix<f32, nalgebra::base::dimension::U3, nalgebra::base::dimension::U1, nalgebra::base::array_storage::ArrayStorage<_, _, _>> --> src\lib.rs:5:1 | 5 | / struct Vertex { 6 | | pos: Vector3<f32>, 7 | | clr: Vector3<f32>, 8 | | } | |_^ thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src\librustc_errors\lib.rs:355:17 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. error: internal compiler error: unexpected panic 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.36.0-nightly (e305df184 2019-04-24) running on x86_64-pc-windows-msvc note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib note: some of the compiler flags provided by cargo are hidden error: Could not compile `nalgebra-repro`. To learn more, run the command again with --verbose. 

I unfortunately do not have a newer nightly to test with due to the lack of a more recent RLS blocking the rustup attempt.

Metadata

Metadata

Assignees

Labels

A-inferenceArea: Type inferenceC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions