Consider inputs like
|
//! Test that closures only implement `Clone` if all captured values implement `Clone`. |
, the diagnostics is:
|
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}` |
|
--> $DIR/closure-clone-requires-captured-clone.rs:17:13 |
|
| |
|
LL | let closure = move || { |
|
| ------- within this `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}` |
|
... |
|
LL | closure.clone(); |
|
| ^^^^^ within `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}`, the trait `Clone` is not implemented for `NonClone` |
The message mentioning the closure uses a format like
LL | let closure = move || {
| ------- within this `{closure@$DIR/closure-clone-requires-captured-clone.rs:13:19: 13:26}`
which feels quite verbose. I guess the span [lo, hi) (in terms of (start, end) line/col) and file path do make it clear which closure is being referred to when there are multiple closures. So not a priority, just tracking this in case there's ways to perhaps make this a bit more concise without losing info -- or assess if that info is actually fully needed).
Consider inputs like
rust/tests/ui/closures/closure-clone-requires-captured-clone.rs
Line 1 in 278a909
rust/tests/ui/closures/closure-clone-requires-captured-clone.stderr
Lines 1 to 8 in 278a909
The message mentioning the closure uses a format like
which feels quite verbose. I guess the span [lo, hi) (in terms of (start, end) line/col) and file path do make it clear which closure is being referred to when there are multiple closures. So not a priority, just tracking this in case there's ways to perhaps make this a bit more concise without losing info -- or assess if that info is actually fully needed).