diff options
Diffstat (limited to 'tests/ui/error-codes/E0746.rs')
-rw-r--r-- | tests/ui/error-codes/E0746.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/error-codes/E0746.rs b/tests/ui/error-codes/E0746.rs new file mode 100644 index 000000000..bf5ba8fff --- /dev/null +++ b/tests/ui/error-codes/E0746.rs @@ -0,0 +1,18 @@ +// 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() {} |