rust/tests/ui/lint/non-local-defs/exhaustive-trait.stderr

89 lines
4.1 KiB
Plaintext

warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:7:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
LL | impl PartialEq<()> for Dog {
| ^^^^^---------^^^^^^^^^---
| | |
| | `Dog` is not local
| `PartialEq` is not local
|
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
= note: `#[warn(non_local_definitions)]` on by default
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:14:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
...
LL | impl PartialEq<()> for &Dog {
| ^^^^^---------^^^^^^^^^^---
| | |
| | `Dog` is not local
| `PartialEq` is not local
|
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:21:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
...
LL | impl PartialEq<Dog> for () {
| ^^^^^---------^---^^^^^^^^
| | |
| | `Dog` is not local
| `PartialEq` is not local
|
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:28:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
...
LL | impl PartialEq<&Dog> for () {
| ^^^^^---------^^---^^^^^^^^
| | |
| | `Dog` is not local
| `PartialEq` is not local
|
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:35:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
...
LL | impl PartialEq<Dog> for &Dog {
| ^^^^^---------^---^^^^^^^---
| | | |
| | | `Dog` is not local
| | `Dog` is not local
| `PartialEq` is not local
|
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
--> $DIR/exhaustive-trait.rs:42:5
|
LL | fn main() {
| --------- move the `impl` block outside of this function `main`
...
LL | impl PartialEq<&Dog> for &Dog {
| ^^^^^---------^^---^^^^^^^---
| | | |
| | | `Dog` is not local
| | `Dog` is not local
| `PartialEq` is not local
|
= note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
warning: 6 warnings emitted