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

Commit 5ee5092

Browse files
authored
Merge pull request #554 from rustbot/triagebot-ice-79674
ICE - rust-lang/rust#79674
2 parents f0d8818 + c68bf46 commit 5ee5092

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

ices/79674.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#![feature(const_generics)]
2+
#![feature(const_evaluatable_checked)]
3+
#![feature(const_fn)]
4+
5+
trait MiniTypeId {
6+
const TYPE_ID: u64;
7+
}
8+
9+
impl<T> MiniTypeId for T {
10+
const TYPE_ID: u64 = 0;
11+
}
12+
13+
enum Lift<const V: bool> {}
14+
15+
trait IsFalse {}
16+
impl IsFalse for Lift<false> {}
17+
18+
const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
19+
T::TYPE_ID == U::TYPE_ID
20+
}
21+
22+
fn requires_distinct<A, B>(_a: A, _b: B) where
23+
A: MiniTypeId, B: MiniTypeId,
24+
Lift<{is_same_type::<A, B>()}>: IsFalse {}
25+
26+
fn main() {
27+
requires_distinct("str", 12);
28+
}

0 commit comments

Comments
 (0)