rust/tests/ui/error-codes/E0746.rs
2023-01-11 09:32:08 +00:00

19 lines
266 B
Rust

// run-rustfix
#![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() {}