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
Copy file name to clipboardexpand all lines: compiler/rustc_lint/messages.ftl
+19-10
Original file line number
Diff line number
Diff line change
@@ -542,17 +542,21 @@ lint_non_local_definitions_cargo_update = the {$macro_kind} `{$macro_name}` may
542
542
543
543
lint_non_local_definitions_deprecation = 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>
544
544
545
-
lint_non_local_definitions_impl = non-local `impl` definition, they should be avoided as they go against expectation
546
-
.help =
547
-
move this `impl` block outside the of the current {$body_kind_descr}{$depth->
548
-
[one] `{$body_name}`
549
-
*[other] `{$body_name}` and up {$depth} bodies
550
-
}
551
-
.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`
552
-
.exception = one exception to the rule are anon-const (`const _: () = {"{"} ... {"}"}`) at top-level module and anon-const at the same nesting as the trait or type
545
+
lint_non_local_definitions_impl = non-local `impl` definition, `impl` blocks should be written at the same level as their item
546
+
.remove_help = remove `{$may_remove_part}` to make the `impl` local
547
+
.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`
548
+
.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`
549
+
.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
550
+
.exception = items in an anonymous const item (`const _: () = {"{"} ... {"}"}`) are treated as in the same scope as the anonymous const's declaration
553
551
.const_anon = use a const-anon item to suppress this lint
554
552
555
-
lint_non_local_definitions_macro_rules = non-local `macro_rules!` definition, they should be avoided as they go against expectation
553
+
lint_non_local_definitions_impl_move_help =
554
+
move the `impl` block outside of this {$body_kind_descr}{$depth->
555
+
[one] `{$body_name}`
556
+
*[other] `{$body_name}` and up {$depth} bodies
557
+
}
558
+
559
+
lint_non_local_definitions_macro_rules = non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
556
560
.help =
557
561
remove the `#[macro_export]` or move this `macro_rules!` outside the of the current {$body_kind_descr}{$depth->
0 commit comments