]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/important-higher-ranked-regions.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / mir / important-higher-ranked-regions.rs
1 // check-pass
2 // compile-flags: -Zvalidate-mir
3
4 // This test checks that bivariant parameters are handled correctly
5 // in the mir.
6 #![allow(coherence_leak_check)]
7 trait Trait {
8     type Assoc;
9 }
10
11 struct Foo<T, U>(T)
12 where
13     T: Trait<Assoc = U>;
14
15 impl Trait for for<'a> fn(&'a ()) {
16     type Assoc = u32;
17 }
18 impl Trait for fn(&'static ()) {
19     type Assoc = String;
20 }
21
22 fn foo(x: Foo<for<'a> fn(&'a ()), u32>) -> Foo<fn(&'static ()), String> {
23     x
24 }
25
26 fn main() {}