summaryrefslogtreecommitdiff
path: root/rust/pin-init/src
diff options
context:
space:
mode:
authorBenno Lossin <lossin@kernel.org>2026-01-16 11:54:19 +0100
committerBenno Lossin <lossin@kernel.org>2026-01-17 10:51:21 +0100
commit26bd9402389eaebed086755afb03453dcae6617a (patch)
tree0d1b89786d5e701eb0167ecef9dabe07e0aef82d /rust/pin-init/src
parent514e4ed2c9da9112fcd378b1bd9b9d120edf7ca9 (diff)
rust: pin-init: internal: add utility API for syn error handling
The API is similar to diagnostics handling in rustc and uses a `ErrorGuaranteed` value to signify that an error has been emitted. It supports both fatal errors (which abort the macro expansion immediately by returning `Err(ErrorGuaranteed)`) and non-fatal ones at generation time. These errors are appended to the token stream after generation has finished normally. This allows giving good errors while still expanding most of the code as expected to avoid the user encountering additional errors (for example missing definitions). Suggested-by: Gary Guo <gary@garyguo.net> Tested-by: Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> [ remove duplicate word in commit message - Benno ] Signed-off-by: Benno Lossin <lossin@kernel.org>
Diffstat (limited to 'rust/pin-init/src')
0 files changed, 0 insertions, 0 deletions