Skip to content

ICE: ty::Const::eval called on a non-valtree-compatible type #118098

Closed
@saethlin

Description

@saethlin

cargo build https://github.com/JonathanWoollett-Light/rust-ad on commit 304c2e744f88971fba2a0fc1f00bd9f7a6c874ed

error[E0741]: `&'static [for<'a> fn(&'a [derivatives::Arg]) -> std::string::String]` can't be used as a const parameter type
   --> core/src/derivatives/mod.rs:233:70
    |
233 | pub fn fgd<const DEFAULT: &'static str, const TRANSLATION_FUNCTIONS: &'static [DFn]>(
    |                                                                      ^^^^^^^^^^^^^^
    |
    = note: `for<'a> fn(&'a [derivatives::Arg]) -> std::string::String` must implement `ConstParamTy`, but it does not
    = note: `[for<'a> fn(&'a [derivatives::Arg]) -> std::string::String]` must implement `ConstParamTy`, but it does not

error[E0741]: `&'static [for<'a> fn(&'a [derivatives::Arg]) -> std::string::String]` can't be used as a const parameter type
   --> core/src/derivatives/mod.rs:342:70
    |
342 | pub fn rgd<const DEFAULT: &'static str, const TRANSLATION_FUNCTIONS: &'static [DFn]>(
    |                                                                      ^^^^^^^^^^^^^^
    |
    = note: `for<'a> fn(&'a [derivatives::Arg]) -> std::string::String` must implement `ConstParamTy`, but it does not
    = note: `[for<'a> fn(&'a [derivatives::Arg]) -> std::string::String]` must implement `ConstParamTy`, but it does not

thread 'rustc' panicked at /rustc/9a66e4471f71283fd54d80ef8147630d34756332/compiler/rustc_middle/src/ty/consts.rs:295:22:
`ty::Const::eval` called on a non-valtree-compatible type

rustc-ice-2023-11-20T17_06_52-1771645.txt

rustc 1.76.0-nightly (9a66e4471 2023-11-19)
binary: rustc
commit-hash: 9a66e4471f71283fd54d80ef8147630d34756332
commit-date: 2023-11-19
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleF-adt_const_params`#![feature(adt_const_params)]`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.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions