Fix an ICE on transmute goals with placeholders in param_env
This commit is contained in:
parent
53b6f89be2
commit
328893e1a6
2 changed files with 22 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
21
tests/ui/transmutability/transmute-with-type-params.rs
Normal file
21
tests/ui/transmutability/transmute-with-type-params.rs
Normal 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue