Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #554 from rustbot/triagebot-ice-79674
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexendoo authored Dec 4, 2020
2 parents f0d8818 + c68bf46 commit 5ee5092
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ices/79674.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#![feature(const_generics)]
#![feature(const_evaluatable_checked)]
#![feature(const_fn)]

trait MiniTypeId {
const TYPE_ID: u64;
}

impl<T> MiniTypeId for T {
const TYPE_ID: u64 = 0;
}

enum Lift<const V: bool> {}

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

const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
T::TYPE_ID == U::TYPE_ID
}

fn requires_distinct<A, B>(_a: A, _b: B) where
A: MiniTypeId, B: MiniTypeId,
Lift<{is_same_type::<A, B>()}>: IsFalse {}

fn main() {
requires_distinct("str", 12);
}

0 comments on commit 5ee5092

Please sign in to comment.