Skip to content

Commit

Permalink
Add 79690
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo committed Dec 4, 2020
1 parent 5ee5092 commit 66163e4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ices/79674.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl<T> MiniTypeId for T {
enum Lift<const V: bool> {}

trait IsFalse {}
impl IsFalse for Lift<false> {}
impl IsFalse for Lift<false> {}

const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
T::TYPE_ID == U::TYPE_ID
Expand All @@ -25,4 +25,4 @@ fn requires_distinct<A, B>(_a: A, _b: B) where

fn main() {
requires_distinct("str", 12);
}
}
28 changes: 28 additions & 0 deletions ices/79690.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
union Transmute<T: Copy, U: Copy> {
t: T,
u: U,
}
trait Bar {
fn bar(&self) -> u32;
}
struct Foo {
foo: u32,
bar: bool,
}
impl Bar for Foo {
fn bar(&self) -> u32 {
self.foo
}
}
#[derive(Copy, Clone)]
struct Fat<'a>(&'a Foo, &'static VTable);
struct VTable {
size: Foo,
}
const FOO: &Bar = &Foo {
foo: 128,
bar: false,
};
const G: Fat = unsafe { Transmute { t: FOO }.u };

fn main() {}

0 comments on commit 66163e4

Please sign in to comment.