You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.non_local = an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
449
+
.without_trait = methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
450
+
.with_trait = an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
450
451
.bounds = `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
451
452
.exception = anon-const (`const _: () = {"{"} ... {"}"}`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
452
453
.const_anon = use a const-anon item to suppress this lint
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/consts.stderr
+3-3
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ LL | | }
48
48
| |_____^
49
49
|
50
50
= help: move this `impl` block outside the of the current function `main`
51
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
51
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
52
52
= 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>
53
53
54
54
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -61,7 +61,7 @@ LL | | }
61
61
| |_________^
62
62
|
63
63
= help: move this `impl` block outside the of the current inline constant `<unnameable>` and up 2 bodies
64
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
64
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
65
65
= 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>
66
66
67
67
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -74,7 +74,7 @@ LL | | }
74
74
| |_________^
75
75
|
76
76
= help: move this `impl` block outside the of the current constant `_` and up 2 bodies
77
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
77
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
78
78
= note: anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type are consider to be transparent regarding the nesting level
79
79
= 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>
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/exhaustive.stderr
+3-3
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ LL | | }
8
8
| |_____^
9
9
|
10
10
= help: move this `impl` block outside the of the current function `main`
11
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
11
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
12
12
= 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>
13
13
= note: `#[warn(non_local_definitions)]` on by default
14
14
@@ -35,7 +35,7 @@ LL | impl dyn Trait {}
35
35
| ^^^^^^^^^^^^^^^^^
36
36
|
37
37
= help: move this `impl` block outside the of the current function `main`
38
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
38
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
39
39
= 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>
40
40
41
41
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
@@ -229,7 +229,7 @@ LL | | }
229
229
| |_________^
230
230
|
231
231
= help: move this `impl` block outside the of the current function `inside_inside` and up 2 bodies
232
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
232
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
233
233
= 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>
Copy file name to clipboardExpand all lines: tests/ui/lint/non-local-defs/weird-exprs.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ LL | | }
31
31
| |_________^
32
32
|
33
33
= help: move this `impl` block outside the of the current constant expression `<unnameable>` and up 2 bodies
34
-
= note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl`
34
+
= note: methods and assoc const are still usable outside the current expression, only `impl Local` and `impl dyn Local` are local and only if the `Local` type is at the same nesting as the `impl` block
35
35
= 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>
36
36
37
37
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
0 commit comments