diff options
| author | Gary Guo <gary@garyguo.net> | 2026-09-28 18:32:21 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2026-09-30 15:56:22 +0100 |
| commit | b2cb983f9d59ddc0ede2a4976443fda6297778af (patch) | |
| tree | 1418b6aecc17e3392175cfac5da3a732ee7ac894 /tools/lib/python/kdoc/python_version.py | |
| parent | d99668f5ed5839a1a8f061dd5a47ab5d0c7dac74 (diff) | |
| download | linux-next-b2cb983f9d59ddc0ede2a4976443fda6297778af.tar.gz linux-next-b2cb983f9d59ddc0ede2a4976443fda6297778af.zip | |
rust: pin-init: internal: init: use span of `<-` or `:` for the init/write call.
Currently we use the full span of the field initializer as the span of the
generated init call. This produces overlapping spans for type mismatch
errors, which is hard to read.
Use the span of `<-` or `:` for the method name, which wll cause type
mismatch errors or trait bound not implemented error to be appear from the
`<-` or `:` token, which declutter the output a bit and make it easier to
read.
Before the change:
error[E0277]: `impl pin_init::PinInit<Bar>` cannot be used to movably initialize `Bar` with error `_`
--> tests/ui/compile-fail/init/invalid_init.rs:19:16
|
19 | bar <- Bar::new(),
| -------^^^^^^^^^^
| | |
| | the trait `Init<Bar, _>` is not implemented for `impl pin_init::PinInit<Bar>`
| required by a bound introduced by this call
|
= note: if your type implements `PinInit` but not `Init`, you might be forgetting a `#[pin]` annotation on fields
After the change:
error[E0277]: `impl pin_init::PinInit<Bar>` cannot be used to movably initialize `Bar` with error `_`
--> tests/ui/compile-fail/init/invalid_init.rs:19:16
|
19 | bar <- Bar::new(),
| -- ^^^^^^^^^^ the trait `Init<Bar, _>` is not implemented for `impl pin_init::PinInit<Bar>`
| |
| required by a bound introduced by this call
|
= note: if your type implements `PinInit` but not `Init`, you might be forgetting a `#[pin]` annotation on fields
Suggested-by: Benno Lossin <lossin@kernel.org>
Link: https://patch.msgid.link/20260928-dev-pin-init-sync-v1-3-e591c8e9cf0e@garyguo.net
Signed-off-by: Gary Guo <gary@garyguo.net>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
