mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
54 lines
816 B
Rust
54 lines
816 B
Rust
//@ check-pass
|
|
//@ edition:2021
|
|
|
|
trait Uto {}
|
|
struct Test;
|
|
|
|
type A = [u32; {
|
|
impl Uto for *mut Test {}
|
|
//~^ WARN non-local `impl` definition
|
|
|
|
1
|
|
}];
|
|
|
|
enum Enum {
|
|
Discr = {
|
|
impl Uto for Test {}
|
|
//~^ WARN non-local `impl` definition
|
|
|
|
1
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let _array = [0i32; {
|
|
impl Test {
|
|
//~^ WARN non-local `impl` definition
|
|
fn bar() {}
|
|
}
|
|
|
|
1
|
|
}];
|
|
|
|
type A = [u32; {
|
|
impl Uto for &Test {}
|
|
//~^ WARN non-local `impl` definition
|
|
|
|
1
|
|
}];
|
|
|
|
fn a(_: [u32; {
|
|
impl Uto for &(Test,) {}
|
|
//~^ WARN non-local `impl` definition
|
|
|
|
1
|
|
}]) {}
|
|
|
|
fn b() -> [u32; {
|
|
impl Uto for &(Test,Test) {}
|
|
//~^ WARN non-local `impl` definition
|
|
|
|
1
|
|
}] { todo!() }
|
|
}
|