]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-upcasting/type-checking-test-3.rs
1 #![feature(trait_upcasting)]
2 #![allow(incomplete_features)]
4 trait Foo
<'a
>: Bar
<'a
> {}
7 fn test_correct(x
: &dyn Foo
<'
static>) {
8 let _
= x
as &dyn Bar
<'
static>;
11 fn test_wrong1
<'a
>(x
: &dyn Foo
<'
static>, y
: &'a
u32) {
12 let _
= x
as &dyn Bar
<'a
>; // Error
13 //~^ ERROR lifetime may not live long enough
16 fn test_wrong2
<'a
>(x
: &dyn Foo
<'a
>) {
17 let _
= x
as &dyn Bar
<'
static>; // Error
18 //~^ ERROR lifetime may not live long enough