mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Fix an ICE on transmute goals with placeholders in param_env
This commit is contained in:
@@ -659,7 +659,7 @@ fn consider_builtin_transmute_candidate(
|
||||
}
|
||||
|
||||
// `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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {}
|
||||
Reference in New Issue
Block a user