tokio-rs / axum

Ergonomic and modular web framework built with Tokio, Tower, and Hyper
18.35k stars 1.03k forks source link

Fix clippy warning on `FromRef` derive macro #2827

Closed AlphaKeks closed 2 months ago

AlphaKeks commented 2 months ago

Motivation

Fixes a clippy warning caused by the FromRef derive macro.

See #2826.

Solution

Add the lint to the #[allow(…)] attribute above the generated function that triggers it.

AlphaKeks commented 2 months ago

The test is failing because of the latest serde release where they leverage the new #[diagnostic::on_unimplemented] feature to give better error messages.

jplatte commented 2 months ago

Would you mind running TRYBUILD=overwrite cargo test from axum-macros to fix this? Just add that as a separate commit to this PR, or open another PR.

AlphaKeks commented 2 months ago

It seems like CI is running a very old version of nightly (from ~4 months ago). Running the tests on a newer release (from the past few days) results in a lot more failing tests, not only in axum-macros. I could fix just this particular case by switching to the exact same release that CI is using, but I think it's noteworthy that these tests and nightly CI should be updated at some point.

jplatte commented 2 months ago

Yeah, I tried to bump nightly in #2805, I guess locally the trybuild tests generated different output from CI because of lockfile differences. Also David isn't currently around much to approve my PRs.

If you care, I would be happy to merge a PR that bumps nightly, and passes CI unlike mine 😄