From 35b87f57920d75321f4f64389d3f6105d6f1b8a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 29 May 2022 08:39:39 +0200 Subject: [PATCH 1/2] add 4 ices https://github.com/rust-lang/rust/issues/97501 https://github.com/rust-lang/rust/issues/97491 https://github.com/rust-lang/rust/issues/97490 https://github.com/rust-lang/rust/issues/97484 --- ices/97484.rs | 13 +++++++++++++ ices/97490.rs | 8 ++++++++ ices/97491.rs | 22 ++++++++++++++++++++++ ices/97501.rs | 20 ++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 ices/97484.rs create mode 100644 ices/97490.rs create mode 100644 ices/97491.rs create mode 100644 ices/97501.rs diff --git a/ices/97484.rs b/ices/97484.rs new file mode 100644 index 00000000..15d16314 --- /dev/null +++ b/ices/97484.rs @@ -0,0 +1,13 @@ +struct A; +struct B; +struct C; +struct D; +struct E; +struct F; +struct G; + +fn foo(a: &A, d: D, e: &E, g: G) {} + +fn main() { + foo(&&A, B, C, D, E, F, G); +} diff --git a/ices/97490.rs b/ices/97490.rs new file mode 100644 index 00000000..76553eab --- /dev/null +++ b/ices/97490.rs @@ -0,0 +1,8 @@ +pub type Yes = extern "sysv64" fn(&'static u8) -> !; + +fn main() { + unsafe { + let yes = &6 as *const _ as *const Yes; + core::arch::asm!("call {}", in(reg) yes, options(noreturn)); + } +} diff --git a/ices/97491.rs b/ices/97491.rs new file mode 100644 index 00000000..0a468e25 --- /dev/null +++ b/ices/97491.rs @@ -0,0 +1,22 @@ +use std::ops::Sub; + +trait Vector2 { + type ScalarType; + fn from_values(x: Self::ScalarType, y: Self::ScalarType) -> Self + where Self: Sized; + fn x(&self) -> Self::ScalarType; + fn y(&self) -> Self::ScalarType; +} + +impl Sub for dyn Vector2 +where T: Sub, +(dyn Vector2): Sized{ + type Output = dyn Vector2; + fn sub(self, rhs: Self) -> Self::Output { + Self::from_values(self.x()-rhs.x(), self.y() - rhs.y()) + } +} + +fn main() { + +} diff --git a/ices/97501.rs b/ices/97501.rs new file mode 100644 index 00000000..aec4938a --- /dev/null +++ b/ices/97501.rs @@ -0,0 +1,20 @@ +#![feature(core_intrinsics)] +use std::intrinsics::wrapping_add; + +#[derive(Clone, Copy)] +struct WrapInt8 { + value: u8 +} + +impl std::ops::Add for WrapInt8 { + type Output = WrapInt8; + fn add(self, other: WrapInt8) -> WrapInt8 { + wrapping_add(self, other) + } +} + +fn main() { + let p = WrapInt8 { value: 123 }; + let q = WrapInt8 { value: 234 }; + println!("{}", (p + q).value); +} From 3951fe6d8678f6ca10899cfa0321c5ac828c045a Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 29 May 2022 15:50:03 +0900 Subject: [PATCH 2/2] Update ices/97491.rs --- ices/97491.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ices/97491.rs b/ices/97491.rs index 0a468e25..751c36ba 100644 --- a/ices/97491.rs +++ b/ices/97491.rs @@ -17,6 +17,4 @@ where T: Sub, } } -fn main() { - -} +fn main() {}