Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cuviper opened this issue Apr 20, 2018 · 4 comments
Closed
Labels
A-borrow-checker Area: The borrow checker A-NLL Area: Non-lexical lifetimes (NLL) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cuviper
Copy link
Member

cuviper commented Apr 20, 2018

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`.
@cuviper cuviper added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-borrow-checker Area: The borrow checker T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-NLL Area: Non-lexical lifetimes (NLL) C-bug Category: This is a bug. labels Apr 20, 2018
@cuviper
Copy link
Member Author

cuviper commented Apr 20, 2018

// 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
Copy link
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
Copy link
Member Author

cuviper commented Apr 24, 2018

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

@pnkfelix
Copy link
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
Labels
A-borrow-checker Area: The borrow checker A-NLL Area: Non-lexical lifetimes (NLL) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants