]>
git.proxmox.com Git - rustc.git/blob - tests/ui/traits/elaborate-type-region.rs
4 // Test that we elaborate `Type: 'region` constraints and infer various important things.
6 trait Master
<'a
, T
: ?Sized
> {
11 impl<'a
, U
> Master
<'a
, [U
]> for () {
12 fn foo() where U
: 'a { }
15 // &'b U: 'a => 'b: 'a, U: 'a
16 impl<'a
, 'b
, U
> Master
<'a
, &'b U
> for () {
17 fn foo() where 'b
: 'a
, U
: 'a { }
20 // &'b [U]: 'a => 'b: 'a, U: 'a
21 impl<'a
, 'b
, U
> Master
<'a
, &'b
[U
]> for () {
22 fn foo() where 'b
: 'a
, U
: 'a { }
25 // Foo<'b>: 'a => 'b: 'a
26 struct Foo
<'a
> { x: &'a () }
27 impl<'a
, 'b
> Master
<'a
, Foo
<'b
>> for () {
28 fn foo() where 'b
: 'a { }
31 // Bar<'b, T>: 'a => 'b: 'a, T: 'a
32 struct Bar
<'a
, T
: 'a
> { x: &'a T }
33 impl<'a
, 'b
, T
> Master
<'a
, Bar
<'b
, T
>> for () {
34 fn foo() where 'b
: 'a
, T
: 'a { }
38 impl<'a
, T
> Master
<'a
, fn(T
)> for () {
39 fn foo() where T
: 'a { }
42 // fn() -> T: 'a => T: 'a
43 impl<'a
, T
> Master
<'a
, fn() -> T
> for () {
44 fn foo() where T
: 'a { }
48 println
!("Hello, world!");