mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
fced23053c
Also duplicate `#[expect]` attribute in `#[derive]`-ed code This PR updates our derive logic to also duplicate any `#[expect]` attribute in the `#[derive]`-ed code, as we already do for all the other lint attribute (`#[allow]`, `#[warn]`, `#[deny]`, ...). The original and duplicated attribute share the same attribute id, which due to the way [`check_expectations`](https://github.com/rust-lang/rust/blob/56aaf58ec02b6ac974e8364269fbb33a8a806e28/compiler/rustc_lint/src/expect.rs#L28-L46) is implemented makes the expectation fulfilled if the lint is either trigger in the original code or the derived code. This was discussed by T-lang in https://github.com/rust-lang/rust/issues/150553#issuecomment-3780810363. cc @rust-lang/lang-ops (in case you want to do an FCP) Fixes rust-lang/rust#150553