-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-prettyArea: Pretty printing (including `-Z unpretty`)Area: Pretty printing (including `-Z unpretty`)D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Consider inputs like
| //! Test that closures only implement `Clone` if all captured values implement `Clone`. |
| 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).
Metadata
Metadata
Assignees
Labels
A-closuresArea: Closures (`|…| { … }`)Area: Closures (`|…| { … }`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-prettyArea: Pretty printing (including `-Z unpretty`)Area: Pretty printing (including `-Z unpretty`)D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of incorrect code.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.