Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
It's coming from calling at this line: I can take a look at it later, doesn't seem to be related to recent changes. Nice find. We're mistakenly assuming that the const has always already been evaluated by the time is called. claim
This one also seems to be regressing in :thinking: cc

Discussion:
Self::from_bits(tcx, n as u128, ParamEnv::empty().and(tcx.types.usize)) } <ins> /// Attempts to convert to a `ValTree` pub fn try_to_valtree(self) -> Option<ty::ValTree<'tcx>> { match self.kind() { ty::ConstKind::Value(valtree) => Some(valtree), _ => None, } } </ins> #[inline] /// Attempts to evaluate the given constant to bits. Can fail to evaluate in the presence of /// generics (or erroneous code) or if the value can't be represented as bits (e.g. because it

use rustc_middle::ty::ParamEnv; use rustc_middle::ty::Ty; use rustc_middle::ty::TyCtxt; <ins> use rustc_middle::ty::ValTree; </ins> /// The source and destination types of a transmutation. #[derive(TypeVisitable, Debug, Clone, Copy)]

); let variant = adt_def.non_enum_variant(); <del> let fields = c.to_valtree().unwrap_branch(); </del> <ins> let fields = match c.try_to_valtree() { Some(ValTree::Branch(branch)) => branch, _ => { return Some(Self { alignment: true, lifetimes: true, safety: true, validity: true, }); } }; </ins> let get_field = |name| { let (field_idx, _) = variant

<ins> // check-fail #![feature(generic_const_exprs, transmutability)] #![allow(incomplete_features)] mod assert { use std::mem::{Assume, BikeshedIntrinsicFrom}; pub fn is_transmutable< Src, Dst, Context, const ASSUME_ALIGNMENT: bool, const ASSUME_LIFETIMES: bool, const ASSUME_SAFETY: bool, const ASSUME_VALIDITY: bool, >() where Dst: BikeshedIntrinsicFrom< Src, Context, { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) } >, {} // This should not cause an ICE const fn from_options( , //~ ERROR expected parameter name, found `,` , //~ ERROR expected parameter name, found `,` , //~ ERROR expected parameter name, found `,` , //~ ERROR expected parameter name, found `,` ) -> Assume {} //~ ERROR mismatched types } fn main() { struct Context; #[repr(C)] struct Src; #[repr(C)] struct Dst; assert::is_transmutable::<Src, Dst, Context, false, false, { true }, false>(); } </ins>

<ins> error: expected parameter name, found `,` --> $DIR/issue-110892.rs:27:9 | LL |         , |         ^ expected parameter name error: expected parameter name, found `,` --> $DIR/issue-110892.rs:28:9 | LL |         , |         ^ expected parameter name error: expected parameter name, found `,` --> $DIR/issue-110892.rs:29:9 | LL |         , |         ^ expected parameter name error: expected parameter name, found `,` --> $DIR/issue-110892.rs:30:9 | LL |         , |         ^ expected parameter name error[E0308]: mismatched types --> $DIR/issue-110892.rs:31:10 | LL |     const fn from_options( |              ------------ implicitly returns `()` as its body has no tail or `return` expression ... LL |     ) -> Assume {} |          ^^^^^^ expected `Assume`, found `()` error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0308`. </ins>