mirror of https://github.com/rust-lang/rust
24 lines
495 B
Rust
24 lines
495 B
Rust
#![feature(type_alias_impl_trait)]
|
|
|
|
type Foo = impl std::fmt::Debug;
|
|
|
|
fn foo(b: bool) -> Foo {
|
|
if b {
|
|
return vec![];
|
|
}
|
|
let mut x = foo(false);
|
|
x = std::iter::empty().collect(); //~ ERROR `Foo` cannot be built from an iterator
|
|
vec![]
|
|
}
|
|
|
|
fn bar(b: bool) -> impl std::fmt::Debug {
|
|
if b {
|
|
return vec![];
|
|
}
|
|
let mut x = bar(false);
|
|
x = std::iter::empty().collect(); //~ ERROR `impl Debug` cannot be built from an iterator
|
|
vec![]
|
|
}
|
|
|
|
fn main() {}
|