mirror of https://github.com/rust-lang/rust
17 lines
408 B
Rust
17 lines
408 B
Rust
#![feature(type_alias_impl_trait)]
|
|
|
|
fn main() {
|
|
let y = 42;
|
|
let x = wrong_generic(&y);
|
|
let z: i32 = x;
|
|
//~^ ERROR expected generic type parameter, found `&i32`
|
|
|
|
type WrongGeneric<T> = impl 'static;
|
|
//~^ ERROR: at least one trait must be specified
|
|
|
|
fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
|
|
t
|
|
//~^ ERROR the parameter type `T` may not live long enough
|
|
}
|
|
}
|