Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 3 additions & 39 deletions tests/assembly-llvm/rust-abi-arg-attr.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ add-minicore
//@ assembly-output: emit-asm
//@ revisions: riscv64 riscv64-zbb loongarch64
//@ compile-flags: -C opt-level=3
Expand All @@ -14,45 +15,8 @@
#![no_std]
#![no_core]
// FIXME: Migrate these code after PR #130693 is landed.

#[lang = "pointee_sized"]
pub trait PointeeSized {}

#[lang = "meta_sized"]
pub trait MetaSized: PointeeSized {}

#[lang = "sized"]
pub trait Sized: MetaSized {}

#[lang = "copy"]
trait Copy {}

impl Copy for i8 {}
impl Copy for u32 {}
impl Copy for i32 {}

#[lang = "neg"]
trait Neg {
type Output;

fn neg(self) -> Self::Output;
}

impl Neg for i8 {
type Output = i8;

fn neg(self) -> Self::Output {
-self
}
}

#[lang = "Ordering"]
#[repr(i8)]
enum Ordering {
Less = -1,
Equal = 0,
Greater = 1,
}
extern crate minicore;
use minicore::*;

#[rustc_intrinsic]
fn three_way_compare<T: Copy>(lhs: T, rhs: T) -> Ordering;
Expand Down
18 changes: 18 additions & 0 deletions tests/auxiliary/minicore.rs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why there is also the move of the Clone trait into this file in this PR, and it doesn't make other things match the Clone impl either. Clone does not seem to actually be needed for Copy, so don't include it.

Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ impl Neg for isize {
}
}

impl Neg for i8 {
type Output = i8;

fn neg(self) -> i8 {
loop {}
}
}

#[lang = "sync"]
trait Sync {}
impl_marker_trait!(
Expand Down Expand Up @@ -280,6 +288,16 @@ pub enum c_void {
__variant2,
}

#[lang = "Ordering"]
#[repr(i8)]
pub enum Ordering {
Less = -1,
Equal = 0,
Greater = 1,
}

impl Copy for Ordering {}

#[lang = "const_param_ty"]
#[diagnostic::on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
pub trait ConstParamTy_ {}
Expand Down
Loading