mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Remove crashes, add comment
This commit is contained in:
parent
5b1a2b8712
commit
bc5f9520c1
@ -2224,6 +2224,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
|
||||
) -> GetSafeTransmuteErrorAndReason {
|
||||
use rustc_transmute::Answer;
|
||||
|
||||
// We don't assemble a transmutability candidate for types that are generic
|
||||
// and we should have ambiguity for types that still have non-region infer.
|
||||
if obligation.predicate.has_non_region_param() || obligation.has_non_region_infer() {
|
||||
return GetSafeTransmuteErrorAndReason::Default;
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
//@ known-bug: rust-lang/rust#125881
|
||||
#![crate_type = "lib"]
|
||||
#![feature(transmutability)]
|
||||
#![feature(unboxed_closures,effects)]
|
||||
|
||||
const fn test() -> impl std::mem::TransmuteFrom() {
|
||||
|| {}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
//@ known-bug: rust-lang/rust#126377
|
||||
|
||||
#![feature(effects)]
|
||||
#![feature(generic_const_exprs)]
|
||||
|
||||
mod assert {
|
||||
use std::mem::{Assume, TransmuteFrom};
|
||||
|
||||
pub fn is_transmutable<
|
||||
Src,
|
||||
Dst,
|
||||
const ASSUME_ALIGNMENT: bool,
|
||||
const ASSUME_LIFETIMES: bool,
|
||||
const ASSUME_SAFETY: bool,
|
||||
const ASSUME_VALIDITY: bool,
|
||||
>()
|
||||
where
|
||||
Dst: TransmuteFrom<
|
||||
Src,
|
||||
{ }
|
||||
>,
|
||||
{}
|
||||
}
|
||||
|
||||
const fn from_options() -> Assume {
|
||||
#[repr(C)] struct Src;
|
||||
#[repr(C)] struct Dst;
|
||||
assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>();
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
//@ known-bug: #130413
|
||||
|
||||
#![feature(transmutability)]
|
||||
trait Aaa {
|
||||
type Y;
|
||||
}
|
||||
|
||||
trait Bbb {
|
||||
type B: std::mem::TransmuteFrom<()>;
|
||||
}
|
||||
|
||||
impl<T> Bbb for T
|
||||
where
|
||||
T: Aaa,
|
||||
{
|
||||
type B = T::Y;
|
||||
}
|
Loading…
Reference in New Issue
Block a user