Skip to content

ICE: jump threading: 2 != 1 #131451

Open
Open
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

fn check_multiple_lints_3(terminate: bool) {
    while true {}

    while !terminate {}
}
original code

original:

//@ check-pass

#![warn(unused)]

// This expect attribute should catch all lint triggers
#[expect(unused_variables)]
fn check_multiple_lints_1() {
    let value_i = 0xff00ff;
    let value_ii = 0xff00ff;
    let value_iii = 0xff00ff;
    let value_iiii = 0xff00ff;
    let value_iiiii = 0xff00ff;
}

// This expect attribute should catch all lint triggers
#[expect(unused_mut)]
fn check_multiple_lints_2() {
    let mut a = 0xa;
    let mut b = 0xb;
    let mut c = 0xc;
    println!(
    unused_mut,
    //~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
    //~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
    //~| NOTE this `expect` is overridden by a `allow` attribute before the `unused_mut` lint is triggered
    reason = "this `expect` is overridden by a `allow` attribute before the `unused_mut` lint is triggered"
);
}

// This expect attribute should catch all lint triggers
#[warn(
        unused_mut,
        //~^ NOTE the lint level is defined here
        reason = "this overrides the previous `expect` lint level and warns about the `unused_mut` lint here"
    )]
fn check_multiple_lints_3(terminate: bool) {
    // `while_true` is an early lint
    while true {}

    while true {}

    while true {
        println!("I never stop")
    }

    while !terminate {
        println!("Do you know what a spin lock is?")
    }

    while true {}
}

fn main() {
    check_multiple_lints_1();
    check_multiple_lints_2();
    check_multiple_lints_3();
}

Version information

rustc 1.83.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.83.0-dev
LLVM version: 19.1.1

Command:
/home/gh-matthiaskrgr/.rustup/toolchains/local-debug-assertions/bin/rustc -Zmir-opt-level=5 -Zvalidate-mir

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions