Skip to content

Const Bound crashing the compiler in workspace context #134836

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
conorpo opened this issue Dec 28, 2024 · 3 comments
Closed

Const Bound crashing the compiler in workspace context #134836

conorpo opened this issue Dec 28, 2024 · 3 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

@conorpo
Copy link

conorpo commented Dec 28, 2024

Code

Really did try to make a minimal example, but it always seemed to work when I recreated it, however I have isolated the issue quite a bit.

This test in the 'corrida' package works as expected.

mod test {
    use super::{BlockMeta, Corrida};

    #[test]
    fn test_isolated_arena() {
        dbg!(size_of::<BlockMeta>());
        dbg!(align_of::<BlockMeta>());

        let arena = Corrida::<{1 << 16}>::new();
        {
            let a = arena.alloc(1);
            let b = arena.alloc(2);
            let c = arena.alloc(3);
            assert_eq!(*a, 1);
            assert_eq!(*b, 2);
            assert_eq!(*c, 3);
        }
    }
}

but when I try calling new on the Corrida struct from another package in the same workspace

#[cfg(test)]
mod test {
    // #![macro_use]
    use super::DFA_BLOCK_SIZE_BYTES;

    //use crate::DfaVertex;

    use std::ptr::NonNull;

    use corrida::*;

    //use crate::dfa::{CompleteState, State};

    #[test]
    pub fn test_basics() {
        let arena = Corrida::<DFA_BLOCK_SIZE_BYTES>::new();
    }
}

I don't get any errors from cargo-check, but running cargo-test gives me:

error: internal compiler error: Encountered anon const with inference variable args but no error reported
  |
  = note: delayed at compiler\rustc_trait_selection\src\traits\mod.rs:605:27 - disabled backtrace

Here is the full backtrace

Meta

In the corrida package im using:

#![feature(allocator_api)]
#![feature(slice_ptr_get)]
#![feature(slice_from_ptr_range)]
#![feature(generic_const_exprs)]

in the other package im not using any features.

rustc --version --verbose:

rustc 1.85.0-nightly (21fe748be 2024-12-11)
binary: rustc
commit-hash: 21fe748be15271ea5804e0507cd699b675efe038
commit-date: 2024-12-11
host: x86_64-pc-windows-msvc
release: 1.85.0-nightly
LLVM version: 19.1.5
@conorpo conorpo 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 Dec 28, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 28, 2024
@conorpo
Copy link
Author

conorpo commented Dec 28, 2024

Ahh just fixed it, needed to add the generic_const_expr feature to the other crate, but still should probably be mentioned by the compiler.

@jieyouxu
Copy link
Member

Maybe duplicate of #133199?

@jieyouxu
Copy link
Member

Closing as a duplicate of #133199.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 14, 2025
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

3 participants