Fix an ICE on transmute goals with placeholders in param_env

This commit is contained in:
Shoyu Vanilla 2026-01-19 21:35:14 +09:00
parent 53b6f89be2
commit 328893e1a6
2 changed files with 22 additions and 1 deletions

View file

@ -659,7 +659,7 @@ where
}
// `rustc_transmute` does not have support for type or const params
if goal.has_non_region_placeholders() {
if goal.predicate.has_non_region_placeholders() {
return Err(NoSolution);
}

View file

@ -0,0 +1,21 @@
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@ [next] compile-flags: -Znext-solver
//@ check-pass
// A regression test for https://github.com/rust-lang/rust/issues/151300
#![feature(transmutability)]
use std::mem::TransmuteFrom;
pub fn is_maybe_transmutable<Src, Dst>()
where
Dst: TransmuteFrom<Src>,
{
}
fn function_with_generic<T>() {
is_maybe_transmutable::<(), ()>();
}
fn main() {}