Closed
Description
Following code sample causes a compiler panic. <32>
should be <u32>
.
use std::convert::TryInto;
fn main() {
let x: u32 = 5i32.try_into::<32>().unwrap();
}
error: internal compiler error: src/librustc_typeck/collect.rs:1320: unexpected const parent in type_of_def_id(): Expr(expr(2289: entry.portfolio_id.try_into::<>()))
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
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.34.0 (91856ed52 2019-04-10) running on x86_64-unknown-linux-gnu
note: compiler flags: -C opt-level=3 -C debuginfo=2 -C linker=external/ts_cc/gcc5/bin/x86_64-unknown-linux-gnu-gcc -C link-args=-lstdc++ -lm -Wl,-no-as-needed -Wl,-z,relro,-z,now -pass-exit-codes -Wl,-fuse-ld=gold -L/usr/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -Wl,--gc-sections -static-libgcc --crate-type rlib