Skip to content

ICE in rustc 1.59.0-beta.2 #93131

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

Closed
coriolinus opened this issue Jan 20, 2022 · 5 comments
Closed

ICE in rustc 1.59.0-beta.2 #93131

coriolinus opened this issue Jan 20, 2022 · 5 comments
Labels
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

@coriolinus
Copy link

Code

src/lib.rs

#[derive(Debug, PartialEq, Eq)]
pub enum Classification {
    Abundant,
    Perfect,
    Deficient,
}


pub fn classify(num: u64) -> Option<Classification> {
    unimplemented!("classify {}", num);
}

tests/perfect-numbers.rs

use perfect_numbers::{classify, Classification};


macro_rules! tests {
    ($property_test_func:ident {
        $( $(#[$attr:meta])* $test_name:ident( $( $param:expr ),* ); )+
    }) => {
        $(
            $(#[$attr])*
            #[test]
            fn $test_name() {
                $property_test_func($( $param ),* )
            }
        )+
    }
}


fn test_classification(num: u64, result: Classification) {
    assert_eq!(classify(num), Some(result));
}


#[test]
fn basic() {
    assert_eq!(classify(0), None);
}


tests! {
    test_classification {
        #[ignore] test_1(1, Classification::Deficient);
        #[ignore] test_2(2, Classification::Deficient);
        #[ignore] test_4(4, Classification::Deficient);
        #[ignore] test_6(6, Classification::Perfect);
        #[ignore] test_12(12, Classification::Abundant);
        #[ignore] test_28(28, Classification::Perfect);
        #[ignore] test_30(30, Classification::Abundant);
        #[ignore] test_32(32, Classification::Deficient);
        #[ignore] test_33550335(33_550_335, Classification::Abundant);
        #[ignore] test_33550336(33_550_336, Classification::Perfect);
        #[ignore] test_33550337(33_550_337, Classification::Deficient);
    }
}

Meta

  • Occurs with beta-x86_64-unknown-linux-gnu - rustc 1.59.0-beta.2 (98a701b42 2022-01-19)
  • Command: cargo test --quiet --no-run here
  • Executed in CI environment; log here.
  • Not encountered with rustc 1.58.0 (02072b482 2022-01-11)

Error output

thread 'rustc' panicked at 'index out of bounds: the len is 11 but the index is 14', compiler/rustc_query_impl/src/on_disk_cache.rs:726:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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.59.0-beta.2 (98a701b42 2022-01-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental

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

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `basic::promoted[0]`
#1 [optimized_mir] optimizing MIR for `basic`
end of query stack
error: could not compile `perfect_numbers`
error: build failed

No backtrace as yet because I don't have the beta version installed locally.

@coriolinus coriolinus added 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. labels Jan 20, 2022
@5225225
Copy link
Contributor

5225225 commented Jan 20, 2022

Looks like a form of incremental compilation bug, seeing as I can't reproduce it after installing beta on my machine, so it's not deterministic in any case.

See: #93029 , looks to have been already fixed, just the fix isn't on beta. Error message is the same, in any case.

@coriolinus
Copy link
Author

Incremental compilation makes some sense; we encounter it in the middle of a fairly large build of a number of semi-related projects. Glad to hear it's already fixed! Any idea how to fix CI, or is the best bet to wait until the version bumps in a month?

@5225225
Copy link
Contributor

5225225 commented Jan 20, 2022

Running cargo clean (maybe with -p for just the package you're compiling, maybe the whole thing is needed) seemed to work for the last incremental compilation issues.

Would slow down compilation a fair bit though. But I guess it would be bearable until the fix goes out. I'd start off with just cleaning your own package, and then if it still ICEs, just start running cargo clean and watching your CPU waste time rebuilding the packages over and over :D

(but no, I don't have any better advice than cargo clean -p <package> before every build)

@bjorn3 bjorn3 added the regression-from-stable-to-beta Performance or correctness regression from stable to beta. label Jan 21, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 21, 2022
@bjorn3 bjorn3 removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jan 21, 2022
@LoganDark
Copy link

Also experiencing this error. Happens whenever I do a git checkout to a slightly different version of the same overall codebase. Annoying.

@workingjubilee
Copy link
Member

Closing as a duplicate of #94124
Or that's a duplicate of this? Either way. Two issues enter, one issue leaves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

6 participants