diff options
| author | Gary Guo <gary@garyguo.net> | 2026-09-16 13:11:34 +0100 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2026-09-18 12:21:06 +0100 |
| commit | fb3d5c6b4cca465c68472a918b861b2296768dad (patch) | |
| tree | 5b0ab9819b72b43ee4907f587496491610201c7a /tools/lib/python/kdoc/python_version.py | |
| parent | 7f849c19e22f105c756b32a6a00dfee9cc1a2c2c (diff) | |
| download | linux-next-fb3d5c6b4cca465c68472a918b861b2296768dad.tar.gz linux-next-fb3d5c6b4cca465c68472a918b861b2296768dad.zip | |
rust: pin-init: internal: init: provide span for slot projection
When initializing a field, pin-init first projects the full slot to a slot
of the field, then initialize it by invoking a method. Currently the span
location is not explicitly set, so the error message points to the full
macro invocation.
Improve it by provide a span, so Rust will point to the specific fields
causing the error when type check fails.
Old error message:
error[E0308]: mismatched types
--> tests/ui/compile-fail/init/field_value_wrong_type.rs:8:28
|
8 | let _ = init!(Foo { a: () });
| ---------------^^---
| | |
| | expected `usize`, found `()`
| arguments to this method are incorrect
New error message:
error[E0308]: mismatched types
--> tests/ui/compile-fail/init/field_value_wrong_type.rs:8:28
|
8 | let _ = init!(Foo { a: () });
| ---^^
| | |
| | expected `usize`, found `()`
| arguments to this method are incorrect
Link: https://patch.msgid.link/20260916-dev-hygiene-v1-3-dfb6ae2588ba@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
