mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
45 lines
578 B
Rust
45 lines
578 B
Rust
//@ build-pass (FIXME(62277): could be check-pass?)
|
|
|
|
#![feature(type_alias_impl_trait)]
|
|
|
|
fn main() {}
|
|
|
|
// two definitions with different types
|
|
type Foo = impl std::fmt::Debug;
|
|
|
|
fn foo() -> Foo {
|
|
""
|
|
}
|
|
|
|
fn bar(arg: bool) -> Foo {
|
|
if arg {
|
|
panic!()
|
|
} else {
|
|
"bar"
|
|
}
|
|
}
|
|
|
|
fn boo(arg: bool) -> Foo {
|
|
if arg {
|
|
loop {}
|
|
} else {
|
|
"boo"
|
|
}
|
|
}
|
|
|
|
fn bar2(arg: bool) -> Foo {
|
|
if arg {
|
|
"bar2"
|
|
} else {
|
|
panic!()
|
|
}
|
|
}
|
|
|
|
fn boo2(arg: bool) -> Foo {
|
|
if arg {
|
|
"boo2"
|
|
} else {
|
|
loop {}
|
|
}
|
|
}
|