]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/pass/specialization.rs
Auto merge of #104915 - weihanglo:update-cargo, r=ehuss
[rust.git] / src / tools / miri / tests / pass / specialization.rs
1 #![allow(incomplete_features)]
2 #![feature(specialization)]
3
4 trait IsUnit {
5     fn is_unit() -> bool;
6 }
7
8 impl<T> IsUnit for T {
9     default fn is_unit() -> bool {
10         false
11     }
12 }
13
14 impl IsUnit for () {
15     fn is_unit() -> bool {
16         true
17     }
18 }
19
20 fn specialization() -> (bool, bool) {
21     (i32::is_unit(), <()>::is_unit())
22 }
23
24 fn main() {
25     assert_eq!(specialization(), (false, true));
26 }