mirror of https://github.com/rust-lang/rust
22 lines
483 B
Rust
22 lines
483 B
Rust
#![feature(type_alias_impl_trait)]
|
|
|
|
type Foo<'a> = impl Sized;
|
|
|
|
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> (Foo<'a>, Foo<'b>) {
|
|
(x, y)
|
|
//~^ ERROR opaque type used twice with different lifetimes
|
|
}
|
|
|
|
type Bar<'a, 'b> = impl std::fmt::Debug;
|
|
|
|
fn bar<'x, 'y>(i: &'x i32, j: &'y i32) -> (Bar<'x, 'y>, Bar<'y, 'x>) {
|
|
(i, j)
|
|
//~^ ERROR opaque type used twice with different lifetimes
|
|
}
|
|
|
|
fn main() {
|
|
let meh = 42;
|
|
let muh = 69;
|
|
println!("{:?}", bar(&meh, &muh));
|
|
}
|