Stream: t-compiler/wg-prioritization/alerts

Topic: #81700 [ICE] With closure on mutable ref


triagebot (Feb 03 2021 at 10:24, on Zulip):

@WG-prioritization/alerts issue #81700 has been requested for prioritization.

Procedure

apiraino (Feb 03 2021 at 16:29, on Zulip):

beta returns an actionable error, in nightly we have an ICE. So I would say P-medium

Camelid (Feb 03 2021 at 16:30, on Zulip):

regression-from-beta-to-nightly?

Camelid (Feb 03 2021 at 16:30, on Zulip):

@apiraino this actually seems P-high

Camelid (Feb 03 2021 at 16:32, on Zulip):

Yeah, this seems like a major regression that we wouldn't want on beta (or stable).

triagebot (Feb 03 2021 at 16:33, on Zulip):

Issue #81700's prioritization request has been removed.

Camelid (Feb 03 2021 at 16:34, on Zulip):

(Marked as P-high)

apiraino (Feb 03 2021 at 16:36, on Zulip):

I agree but I don't understand the implication. You mean the regression on the error shown is too much or that is there something more behind? I'm afraid I'm missing the context here

Camelid (Feb 03 2021 at 16:41, on Zulip):

one sec, I'll explain

Camelid (Feb 03 2021 at 16:42, on Zulip):

On stable (and beta), the MCVE gives:

error[E0596]: cannot borrow `bar` as mutable, as it is not declared as mutable
 --> src/main.rs:3:5
  |
2 |     let bar = || { foo(x); };
  |         --- help: consider changing this to be mutable: `mut bar`
3 |     bar();
  |     ^^^ cannot borrow as mutable

error: aborting due to previous error

On nightly, it gives:

error: internal compiler error: compiler/rustc_mir/src/borrow_check/diagnostics/mutability_errors.rs:525:22: upvar `x` borrowed, but not mutably

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:958: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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (368275062 2021-02-02) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [mir_borrowck] borrow-checking `foo`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `playground`

No user-friendly error whatsoever!

Camelid (Feb 03 2021 at 16:42, on Zulip):

This error seems really easy to trigger, and is completely inscrutable.

Camelid (Feb 03 2021 at 16:43, on Zulip):

I might even say P-critical, except that that's usually reserved for miscompiles and unwarranted errors.

apiraino (Feb 03 2021 at 17:41, on Zulip):

oh ok, thanks for explaining :thumbs_up:

Last update: Apr 11 2021 at 18:45UTC