serde
serde copied to clipboard
Emit an error if a variant of an untagged enum is annoted with `#[serde(rename)]` or `#[serde(alias)]`
Fixes #2787.
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?)
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.