188 lines
9.5 KiB
Text
188 lines
9.5 KiB
Text
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:9:5
|
|
|
|
|
LL | impl<T: Local> Global for Vec<T> { }
|
|
| ^^^^^^^^^^^^^^^------^^^^^---^^^
|
|
| | |
|
|
| | `Vec` is not local
|
|
| `Global` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `main`
|
|
--> $DIR/generics.rs:9:5
|
|
|
|
|
LL | impl<T: Local> Global for Vec<T> { }
|
|
| ^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| may need to be moved as well
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
= 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/generics.rs:20:5
|
|
|
|
|
LL | impl Uto7 for Test where Local: std::any::Any {}
|
|
| ^^^^^----^^^^^----
|
|
| | |
|
|
| | `Test` is not local
|
|
| `Uto7` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `bad`
|
|
--> $DIR/generics.rs:20:5
|
|
|
|
|
LL | impl Uto7 for Test where Local: std::any::Any {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| may need to be moved as well
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:23:5
|
|
|
|
|
LL | impl<T> Uto8 for T {}
|
|
| ^^^^^^^^----^^^^^-
|
|
| | |
|
|
| | `T` is not local
|
|
| `Uto8` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `bad`
|
|
--> $DIR/generics.rs:23:5
|
|
|
|
|
LL | impl<T> Uto8 for T {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:32:5
|
|
|
|
|
LL | impl Default for UwU<OwO> {
|
|
| ^^^^^-------^^^^^---^^^^^
|
|
| | |
|
|
| | `UwU` is not local
|
|
| `Default` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `fun`
|
|
--> $DIR/generics.rs:32:5
|
|
|
|
|
LL | impl Default for UwU<OwO> {
|
|
| ^ --- may need to be moved as well
|
|
| _____|
|
|
| |
|
|
LL | |
|
|
LL | | fn default() -> Self {
|
|
LL | | UwU(OwO)
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:43:5
|
|
|
|
|
LL | impl AsRef<Cat> for () {
|
|
| ^^^^^-----^^^^^^^^^^--
|
|
| | |
|
|
| | `()` is not local
|
|
| `AsRef` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `meow`
|
|
--> $DIR/generics.rs:43:5
|
|
|
|
|
LL | impl AsRef<Cat> for () {
|
|
| ^ --- may need to be moved as well
|
|
| _____|
|
|
| |
|
|
LL | |
|
|
LL | | fn as_ref(&self) -> &Cat { &Cat }
|
|
LL | | }
|
|
| |_____^
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:54:5
|
|
|
|
|
LL | impl PartialEq<B> for G {
|
|
| ^^^^^---------^^^^^^^^-
|
|
| | |
|
|
| | `G` is not local
|
|
| `PartialEq` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `fun2`
|
|
--> $DIR/generics.rs:54:5
|
|
|
|
|
LL | impl PartialEq<B> for G {
|
|
| ^ - may need to be moved as well
|
|
| _____|
|
|
| |
|
|
LL | |
|
|
LL | | fn eq(&self, _: &B) -> bool {
|
|
LL | | true
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:69:5
|
|
|
|
|
LL | impl From<Wrap<Wrap<Lion>>> for () {
|
|
| ^^^^^----^^^^^^^^^^^^^^^^^^^^^^^--
|
|
| | |
|
|
| `From` is not local `()` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `rawr`
|
|
--> $DIR/generics.rs:69:5
|
|
|
|
|
LL | impl From<Wrap<Wrap<Lion>>> for () {
|
|
| ^ ---- may need to be moved as well
|
|
| _____|
|
|
| |
|
|
LL | |
|
|
LL | | fn from(_: Wrap<Wrap<Lion>>) -> Self {
|
|
LL | | todo!()
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/generics.rs:76:5
|
|
|
|
|
LL | impl From<()> for Wrap<Lion> {
|
|
| ^^^^^----^^^^^^^^^----^^^^^^
|
|
| | |
|
|
| | `Wrap` is not local
|
|
| `From` is not local
|
|
|
|
|
= note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
|
|
= 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`
|
|
help: move this `impl` block outside of the current function `rawr`
|
|
--> $DIR/generics.rs:76:5
|
|
|
|
|
LL | impl From<()> for Wrap<Lion> {
|
|
| ^ ---- may need to be moved as well
|
|
| _____|
|
|
| |
|
|
LL | |
|
|
LL | | fn from(_: ()) -> Self {
|
|
LL | | todo!()
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
|
|
|
|
warning: 8 warnings emitted
|
|
|