Skip to content

rustc panics on compile-fail/borrowck/two-phase-reservation-sharing-interference #50128

Closed
@cuviper

Description

@cuviper
Member

This is another non-ICE panic revealed by #49891:

$ rustc +dev1 src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs -Z borrowck=mir -Z two-phase-borrows -Z two-phase-beyond-autoref
error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
  --> src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs:46:9
   |
41 |         let shared = &vec;
   |                      ---- immutable borrow occurs here
...
46 |         delay = &mut vec;
   |         ^^^^^^^^^^^^^^^^ mutable borrow occurs here
...
50 |         shared[0];
   |         ------ borrow later used here

thread 'main' panicked at 'assertion failed: match borrow.kind {{
    BorrowKind::Shared => false,
    BorrowKind::Unique | BorrowKind::Mut {{ .. }} => true,
}}', librustc_mir/borrow_check/mod.rs:1252:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0502`.

Activity

added
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
A-NLLArea: Non-lexical lifetimes (NLL)
C-bugCategory: This is a bug.
on Apr 20, 2018
cuviper

cuviper commented on Apr 20, 2018

@cuviper
MemberAuthor
// The following revisions are disabled due to missing support from two-phase beyond autorefs
//[nll_beyond]compile-flags: -Z borrowck=mir -Z two-phase-borrows -Z two-phase-beyond-autoref
//[nll_beyond] should-fail

I'm not sure if should-fail is supposed to catch compiler panics, but I doubt it.

sapphire-arches

sapphire-arches commented on Apr 24, 2018

@sapphire-arches
Contributor

Anything involving two-phase-borrow-beyond-autoref is likely completely broken right now. We're not exactly sure if we're ever going to enable it (see #49434 for some context). That test variant should have been disabled, either you can go ahead and do it (by removing nll_beyond from this line) or I'll submit a PR doing exactly that.

cuviper

cuviper commented on Apr 24, 2018

@cuviper
MemberAuthor

@bobtwinkles thanks, I added a commit to #49891 removing the bit you suggested.

pnkfelix

pnkfelix commented on Dec 19, 2018

@pnkfelix
Member

Re-triaging for #56754. Seems like PR #49891 addressed this. Closing as "fixed."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-borrow-checkerArea: The borrow checkerC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cuviper@pnkfelix@sapphire-arches

        Issue actions

          rustc panics on compile-fail/borrowck/two-phase-reservation-sharing-interference · Issue #50128 · rust-lang/rust