serde icon indicating copy to clipboard operation
serde copied to clipboard

Emit an error if a variant of an untagged enum is annoted with `#[serde(rename)]` or `#[serde(alias)]`

Open devnetsec opened this issue 1 year ago • 2 comments

Fixes #2787.

devnetsec avatar Aug 12 '24 23:08 devnetsec

Can someone run crater-at-home on this to gauge the impact? I worry someone accidentally is using it in a crate that will impact many other crates.

Or switch it to emitting a warning instead (can we do that from proc macros?)

oli-obk avatar Sep 03 '24 13:09 oli-obk

Unfortunately, I don't think this can be switched to a warning. Compile errors are handled by serde::internals::ctxt, which holds Syn errors. Syn uses Rust's compile_error! macro to print them. It looks like we're waiting on the nightly-only Diagnostic API to stabilize. See this Stack Overflow thread. Also, the test suite only compares expected and actual output when compilation fails.

devnetsec avatar Oct 12 '24 01:10 devnetsec