Skip to content

Rustc bug:cannot convert ReEmpty to a region vid #68550

Closed
@lispc

Description

@lispc

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

Metadata

Metadata

Assignees

Labels

A-borrow-checkerArea: The borrow checkerC-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.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions