summaryrefslogtreecommitdiffstats
path: root/tests/ui/implied-bounds/normalization-preserve-equality.rs
blob: 557c171e515a3caf1f165c9beeb7f477b14ea4c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Both revisions should pass. `borrowck` revision is a bug!
//
// revisions: wfcheck borrowck
// [wfcheck] check-pass
// [borrowck] check-fail
// [borrowck] known-bug: #106569

struct Equal<'a, 'b>(&'a &'b (), &'b &'a ()); // implies 'a == 'b

trait Trait {
    type Ty;
}

impl<'x> Trait for Equal<'x, 'x> {
    type Ty = ();
}

trait WfCheckTrait {}

#[cfg(wfcheck)]
impl<'a, 'b> WfCheckTrait for (<Equal<'a, 'b> as Trait>::Ty, Equal<'a, 'b>) {}

#[cfg(borrowck)]
fn test_borrowck<'a, 'b>(_: (<Equal<'a, 'b> as Trait>::Ty, Equal<'a, 'b>)) {
    let _ = None::<Equal<'a, 'b>>;
}

fn main() {}