short-circuit the easy cases in is_copy_modulo_regions
This change is somewhat extensive, since it affects MIR -- since this is called to determine Copy vs Move -- so any test that's `no_core` needs to actually have the normal `impl`s it uses.
This commit is contained in:
parent
b5a54d8777
commit
54408f0963
11 changed files with 18 additions and 2 deletions
|
@ -704,7 +704,7 @@ impl<'tcx> Ty<'tcx> {
|
||||||
tcx_at: TyCtxtAt<'tcx>,
|
tcx_at: TyCtxtAt<'tcx>,
|
||||||
param_env: ty::ParamEnv<'tcx>,
|
param_env: ty::ParamEnv<'tcx>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
tcx_at.is_copy_raw(param_env.and(self))
|
self.is_trivially_pure_clone_copy() || tcx_at.is_copy_raw(param_env.and(self))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks whether values of this type `T` have a size known at
|
/// Checks whether values of this type `T` have a size known at
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
pub trait Sized {}
|
pub trait Sized {}
|
||||||
#[lang = "copy"]
|
#[lang = "copy"]
|
||||||
pub trait Copy {}
|
pub trait Copy {}
|
||||||
|
impl Copy for f32 {}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct Franta {
|
pub struct Franta {
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
trait Sized {}
|
trait Sized {}
|
||||||
#[lang = "copy"]
|
#[lang = "copy"]
|
||||||
trait Copy {}
|
trait Copy {}
|
||||||
|
impl Copy for u32 {}
|
||||||
|
|
||||||
// Use of these requires target features to be enabled
|
// Use of these requires target features to be enabled
|
||||||
extern "unadjusted" {
|
extern "unadjusted" {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
trait Sized {}
|
trait Sized {}
|
||||||
#[lang = "copy"]
|
#[lang = "copy"]
|
||||||
trait Copy {}
|
trait Copy {}
|
||||||
|
impl Copy for i64 {}
|
||||||
|
|
||||||
// CHECK: define x86_64_sysvcc i64 @has_sysv64_abi
|
// CHECK: define x86_64_sysvcc i64 @has_sysv64_abi
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
trait Sized {}
|
trait Sized {}
|
||||||
#[lang = "copy"]
|
#[lang = "copy"]
|
||||||
trait Copy {}
|
trait Copy {}
|
||||||
|
impl Copy for i64 {}
|
||||||
|
|
||||||
// CHECK: define x86_intrcc i64 @has_x86_interrupt_abi
|
// CHECK: define x86_intrcc i64 @has_x86_interrupt_abi
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
trait Sized { }
|
trait Sized { }
|
||||||
#[lang="copy"]
|
#[lang="copy"]
|
||||||
trait Copy { }
|
trait Copy { }
|
||||||
|
impl Copy for u32 {}
|
||||||
|
|
||||||
|
|
||||||
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
|
// CHECK: define i32 @peach{{.*}}[[PEACH_ATTRS:\#[0-9]+]] {
|
||||||
|
|
|
@ -10,6 +10,14 @@
|
||||||
trait Sized {}
|
trait Sized {}
|
||||||
#[lang = "copy"]
|
#[lang = "copy"]
|
||||||
trait Copy {}
|
trait Copy {}
|
||||||
|
impl Copy for bool {}
|
||||||
|
impl Copy for i8 {}
|
||||||
|
impl Copy for u8 {}
|
||||||
|
impl Copy for i32 {}
|
||||||
|
impl Copy for i64 {}
|
||||||
|
impl Copy for u64 {}
|
||||||
|
impl Copy for f32 {}
|
||||||
|
impl Copy for f64 {}
|
||||||
|
|
||||||
// CHECK: define void @f_void()
|
// CHECK: define void @f_void()
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
pub trait Sized { }
|
pub trait Sized { }
|
||||||
#[lang="copy"]
|
#[lang="copy"]
|
||||||
pub trait Copy { }
|
pub trait Copy { }
|
||||||
|
impl Copy for u32 {}
|
||||||
|
|
||||||
extern "rust-intrinsic" {
|
extern "rust-intrinsic" {
|
||||||
pub fn transmute<T, U>(e: T) -> U;
|
pub fn transmute<T, U>(e: T) -> U;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
pub trait Sized { }
|
pub trait Sized { }
|
||||||
#[lang="copy"]
|
#[lang="copy"]
|
||||||
pub trait Copy { }
|
pub trait Copy { }
|
||||||
|
impl Copy for u32 {}
|
||||||
|
|
||||||
extern "rust-intrinsic" {
|
extern "rust-intrinsic" {
|
||||||
pub fn transmute<T, U>(e: T) -> U;
|
pub fn transmute<T, U>(e: T) -> U;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
trait Sized { }
|
trait Sized { }
|
||||||
#[lang="copy"]
|
#[lang="copy"]
|
||||||
trait Copy { }
|
trait Copy { }
|
||||||
|
impl Copy for u32 {}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[cmse_nonsecure_entry]
|
#[cmse_nonsecure_entry]
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
trait Sized { }
|
trait Sized { }
|
||||||
#[lang="copy"]
|
#[lang="copy"]
|
||||||
trait Copy { }
|
trait Copy { }
|
||||||
|
impl Copy for u32 {}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[cmse_nonsecure_entry]
|
#[cmse_nonsecure_entry]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue