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

internal compiler error: encountered incremental compilation error with predicates_of(core[460f]::cmp::PartialOrd) #88487

Open
scambier opened this issue Aug 30, 2021 · 2 comments
Labels
A-incr-comp Area: Incremental compilation 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

@scambier
Copy link

scambier commented Aug 30, 2021

Related to #84970, I'm filling this because cargo asked nicely :)

Code

Context: this is an excerpt from a roguelike game that uses Legion as its ECS lib. I guess the bug was there, since it's the only place I'm using .partial_cmp(). It crashed after I added the .sort_by(distance) part.

    // Collect all entities into the player's FOV
    let mut entities = <(Entity, &Point, &Renderable, &Name, Option<&CombatStats>)>::query()
        .iter(world)
        .collect::<Vec<(&Entity, &Point, &Renderable, &Name, Option<&CombatStats>)>>();

    // Sort them by distance from the player
    entities.sort_by(|&a, &b| {
        DistanceAlg::Pythagoras
            .distance2d(*a.1, *player_pos)
            .partial_cmp(&DistanceAlg::Pythagoras.distance2d(*b.1, *player_pos))
            .unwrap_or(Ordering::Equal)
    });

Meta

rustc --version --verbose:

rustc 1.54.0 (a178d0322 2021-07-26)
binary: rustc
commit-hash: a178d0322ce20e33eac124758e837cbd80a6f633
commit-date: 2021-07-26
host: x86_64-pc-windows-msvc
release: 1.54.0
LLVM version: 12.0.1

Error output

thread 'rustc' panicked at 'Found unstable fingerprints for predicates_of(core[460f]::cmp::PartialOrd):
GenericPredicates { parent: None, predicates: [(Binder(TraitPredicate(<Self as std::cmp::PartialEq<Rhs>>), []),
C:\[redacted]\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\cmp.rs:936:43: 936:57
(#80706 (Binder(TraitPredicate(<Self as std::cmp::PartialOrd<Rhs>>), []),
C:\[redacted]\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\cmp.rs:936:1: 1041:2 (#0))] }',
/rustc/a178d0322ce20e33eac124758e837cbd80a6f633\compiler\rustc_query_system\src\query\plumbing.rs:620:9
Backtrace

<sorry no backtrace, I cleaned before that>

@scambier scambier 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 Aug 30, 2021
@Aaron1011
Copy link
Member

This should be fixed by #88414

@JohnTitor
Copy link
Member

@scambier Could you check if it's fixed by updating rustc? 1.56, which is the latest stable, should contain the mentioned PR.

@cjgillot cjgillot added the A-incr-comp Area: Incremental compilation label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation 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

4 participants