mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
19 lines
252 B
Rust
19 lines
252 B
Rust
#![allow(dead_code)]
|
|
|
|
struct Struct;
|
|
trait Trait {}
|
|
impl Trait for Struct {}
|
|
impl Trait for u32 {}
|
|
|
|
fn foo() -> dyn Trait { Struct }
|
|
//~^ ERROR E0746
|
|
|
|
fn bar() -> dyn Trait { //~ ERROR E0746
|
|
if true {
|
|
return 0;
|
|
}
|
|
42
|
|
}
|
|
|
|
fn main() {}
|