Rollup merge of #110510 - bryangarza:issue-110467-safe-transmute, r=compiler-errors
Fix ICE for transmutability in candidate assembly Don't skip transmutability check just because there may be generics in the ParamEnv. Fixes #110467
This commit is contained in:
commit
fdd2f4bde8
@ -775,7 +775,7 @@ fn assemble_candidates_for_transmutability(
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
candidates: &mut SelectionCandidateSet<'tcx>,
|
||||
) {
|
||||
if obligation.has_non_region_param() {
|
||||
if obligation.predicate.has_non_region_param() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
17
tests/ui/transmutability/issue-110467.rs
Normal file
17
tests/ui/transmutability/issue-110467.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// check-pass
|
||||
#![crate_type = "lib"]
|
||||
#![feature(transmutability)]
|
||||
use std::mem::BikeshedIntrinsicFrom;
|
||||
pub struct Context;
|
||||
|
||||
pub fn is_maybe_transmutable<Src, Dst>()
|
||||
where
|
||||
Dst: BikeshedIntrinsicFrom<Src, Context>,
|
||||
{
|
||||
}
|
||||
|
||||
// The `T` here should not have any effect on checking
|
||||
// if transmutability is allowed or not.
|
||||
fn function_with_generic<T>() {
|
||||
is_maybe_transmutable::<(), ()>();
|
||||
}
|
Loading…
Reference in New Issue
Block a user