2024-04-08 12:12:47 -05:00
|
|
|
//@ check-pass
|
|
|
|
//@ edition:2021
|
|
|
|
|
2024-06-27 01:05:07 -05:00
|
|
|
#![warn(non_local_definitions)]
|
|
|
|
|
2024-04-08 12:12:47 -05:00
|
|
|
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!() }
|
|
|
|
}
|