Skip to content

intern.rs:182: const qualif failed to prevent mutable references #62045

@whitequark

Description

@whitequark
Member

The build of smoltcp on nightly started failing recently with an ICE: https://travis-ci.org/m-labs/smoltcp/jobs/549023810#L789-L804.

I suspect this might be caused by E0713, but it shouldn't be an ICE in any case.

Activity

whitequark

whitequark commented on Jun 22, 2019

@whitequark
Author
added
C-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.
on Jun 22, 2019
whitequark

whitequark commented on Jun 22, 2019

@whitequark
Author
added
E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
on Jun 22, 2019
eddyb

eddyb commented on Jun 23, 2019

@eddyb
Member

cc @oli-obk @RalfJung (also, such an ICE should say "const checking" or similar - we should maybe even rename the pass itself in the compiler - the "qualify" part isn't as primary for MIR as it is for the AST side).

added
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)
on Jun 23, 2019
whitequark

whitequark commented on Jun 23, 2019

@whitequark
Author
whitequark

whitequark commented on Jun 23, 2019

@whitequark
MemberAuthor

MCVE:

fn main() {
    assert_eq!(&mut [0; 1][..], &mut []);
}

I'm bisecting it now.

whitequark

whitequark commented on Jun 23, 2019

@whitequark
MemberAuthor
removed
E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
on Jun 23, 2019
oli-obk

oli-obk commented on Jun 23, 2019

@oli-obk
Contributor

Oh, I forgot about the ZST trickery, sorry, will have a fix tomorrow

self-assigned this
on Jun 23, 2019
whitequark

whitequark commented on Jun 23, 2019

@whitequark
MemberAuthor

What's the ZST here? [] in &mut []?

RalfJung

RalfJung commented on Jun 23, 2019

@RalfJung
Member

Yes. That's a &mut [0; i32] that gets unsized to &mut [].

added a commit that references this issue on Jun 25, 2019
10deeae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @whitequark@eddyb@RalfJung@oli-obk@jonas-schievink

    Issue actions

      intern.rs:182: const qualif failed to prevent mutable references · Issue #62045 · rust-lang/rust