
- Restrict const-anon exception diag to relevant places - Invoke bounds (and type-inference) in non_local_defs - Specialize diagnostic for impl without Trait
14 lines
970 B
Text
14 lines
970 B
Text
warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item
|
|
--> $DIR/trait-solver-overflow-123573.rs:12:5
|
|
|
|
|
LL | impl Test for &Local {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: move this `impl` block outside the of the current function `main`
|
|
= 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`
|
|
= 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: 1 warning emitted
|
|
|