Closed
Description
This code results in an ICE on the playground:
#![feature(impl_trait_in_bindings)]
use std::ops::Add;
fn main() {
let i: i32 = 0;
let j: &impl Add = &i;
}
This may be a duplicate of #54600, but I can't really tell. Error message:
Compiling playground v0.0.1 (/playground)
warning: unused variable: `j`
--> src/main.rs:7:9
|
7 | let j: &impl Add = &i;
| ^ help: consider using `_j` instead
|
= note: #[warn(unused_variables)] on by default
error: internal compiler error: broken MIR in DefId(0/0:4 ~ playground[bf48]::main[0]) (_2 = &(*_3)): bad assignment (&impl std::ops::Add = &i32): NoSolution
--> src/main.rs:7:24
|
7 | let j: &impl Add = &i;
| ^^
thread 'main' panicked at 'no errors encountered even though `delay_span_bug` issued', librustc_errors/lib.rs:334:17
note: Run with `RUST_BACKTRACE=1` for 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.31.0-nightly (8c4ad4e9e 2018-10-04) running on x86_64-unknown-linux-gnu
note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Category: This is a bug.`#![feature(impl_trait_in_bindings)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.