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
.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
551
+
.without_trait = methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
552
552
.with_trait = 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`
553
553
.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
554
554
.exception = items in an anonymous const item (`const _: () = {"{"} ... {"}"}`) are treated as in the same scope as the anonymous const's declaration
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
@@ -56,7 +56,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
56
56
LL | impl Test {
57
57
| ^^^^^^^^^
58
58
|
59
-
= 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
59
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
60
60
help: move this `impl` block outside of the current function `main`
61
61
--> $DIR/consts.rs:43:5
62
62
|
@@ -73,7 +73,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
73
73
LL | impl Test {
74
74
| ^^^^^^^^^
75
75
|
76
-
= 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
76
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
77
77
help: move this `impl` block outside of the current inline constant `<unnameable>` and up 2 bodies
78
78
--> $DIR/consts.rs:50:9
79
79
|
@@ -90,7 +90,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
90
90
LL | impl Test {
91
91
| ^^^^^^^^^
92
92
|
93
-
= 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
93
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
94
94
help: move this `impl` block outside of the current constant `_` and up 2 bodies
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
@@ -4,7 +4,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
4
4
LL | impl Test {
5
5
| ^^^^^^^^^
6
6
|
7
-
= 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
7
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
8
8
help: move this `impl` block outside of the current function `main`
9
9
--> $DIR/exhaustive.rs:10:5
10
10
|
@@ -42,7 +42,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
42
42
LL | impl dyn Trait {}
43
43
| ^^^^^^^^^^^^^^
44
44
|
45
-
= 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
45
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
46
46
help: move this `impl` block outside of the current function `main`
47
47
--> $DIR/exhaustive.rs:22:5
48
48
|
@@ -313,7 +313,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
313
313
LL | impl InsideMain {
314
314
| ^^^^^^^^^^^^^^^
315
315
|
316
-
= 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
316
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
317
317
help: move this `impl` block outside of the current function `inside_inside` and up 2 bodies
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
@@ -35,7 +35,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam
35
35
LL | impl Test {
36
36
| ^^^^^^^^^
37
37
|
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
38
+
= note: methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
39
39
help: move this `impl` block outside of the current constant expression `<unnameable>` and up 2 bodies
0 commit comments