Closed
Description
When compiling my code, I saw cargo/rustc panicked.
I tried this code:
pub struct Data<A> {
pub a: A,
}
impl<A> Data<A>
where
A: 'static,
&'static A: ,
{
pub fn run() {
let mut entries: Vec<A> = Vec::new();
if !entries.is_empty() {}
}
}
pub type DataA = Data<i32>;
fn main() {
println!("Hello, world!");
}
The output is
$ cargo build
Compiling rustc-crash v0.1.0 (/Users/zhangzhuo/repos/personal/rustc-crash)
error: internal compiler error: src/librustc_mir/borrow_check/universal_regions.rs:729: cannot convert `ReEmpty` to a region vid
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:883: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.42.0-nightly (6d3f4e0aa 2020-01-25) 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 `rustc-crash`.
To learn more, run the command again with --verbose.
Meta
rustc --version --verbose
:
rustc 1.42.0-nightly (6d3f4e0aa 2020-01-25)
binary: rustc
commit-hash: 6d3f4e0aab3e36ceb8b83d1e9467514685f6b751
commit-date: 2020-01-25
host: x86_64-apple-darwin
release: 1.42.0-nightly
LLVM version: 9.0