2020-01-13 18:13:51 -06:00
|
|
|
// run-rustfix
|
|
|
|
#![allow(dead_code)]
|
2020-01-13 15:13:12 -06:00
|
|
|
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 {
|
2020-01-13 18:12:44 -06:00
|
|
|
return 0;
|
2020-01-13 15:13:12 -06:00
|
|
|
}
|
2020-01-13 18:12:44 -06:00
|
|
|
42
|
2020-01-13 15:13:12 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|