mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-08-27 20:00:03 -04:00
19 lines
268 B
Rust
19 lines
268 B
Rust
// run-rustfix
|
|
#![allow(dead_code)]
|
|
struct Struct;
|
|
trait Trait {}
|
|
impl Trait for Struct {}
|
|
impl Trait for u32 {}
|
|
|
|
fn foo() -> impl Trait { Struct }
|
|
//~^ ERROR E0746
|
|
|
|
fn bar() -> impl Trait { //~ ERROR E0746
|
|
if true {
|
|
return 0;
|
|
}
|
|
42
|
|
}
|
|
|
|
fn main() {}
|