Ignore mismatched_lifetime_syntaxes lint

warning: lifetime flowing from input to output with different syntax can be confusing
       --> serde/src/private/de.rs:266:23
        |
    266 |         fn unexpected(&self) -> Unexpected {
        |                       ^^^^^     ---------- the lifetime gets resolved as `'_`
        |                       |
        |                       this lifetime flows to the output
        |
        = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    266 |         fn unexpected(&self) -> Unexpected<'_> {
        |                                           ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
      --> serde/src/private/mod.rs:27:35
       |
    27 |     pub fn from_utf8_lossy(bytes: &[u8]) -> Cow<str> {
       |                                   ^^^^^     -------- the lifetime gets resolved as `'_`
       |                                   |
       |                                   this lifetime flows to the output
       |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
       |
    27 |     pub fn from_utf8_lossy(bytes: &[u8]) -> Cow<'_, str> {
       |                                                 +++

    warning: lifetime flowing from input to output with different syntax can be confusing
       --> serde_derive/src/internals/attr.rs:612:23
        |
    612 |     pub fn serde_path(&self) -> Cow<syn::Path> {
        |                       ^^^^^     -------------- the lifetime gets resolved as `'_`
        |                       |
        |                       this lifetime flows to the output
        |
        = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
        |
    612 |     pub fn serde_path(&self) -> Cow<'_, syn::Path> {
        |                                     +++

    warning: lifetime flowing from input to output with different syntax can be confusing
      --> serde_derive/src/internals/case.rs:45:37
       |
    45 |     pub fn from_str(rename_all_str: &str) -> Result<Self, ParseError> {
       |                                     ^^^^                  ---------- the lifetime gets resolved as `'_`
       |                                     |
       |                                     this lifetime flows to the output
       |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
       |
    45 |     pub fn from_str(rename_all_str: &str) -> Result<Self, ParseError<'_>> {
       |                                                                     ++++

    warning: lifetime flowing from input to output with different syntax can be confusing
        --> serde_derive/src/de.rs:3228:13
         |
    3228 |     params: &Parameters,
         |             ^^^^^^^^^^^ this lifetime flows to the output
    3229 | ) -> (
    3230 |     DeImplGenerics,
         |     -------------- the lifetimes get resolved as `'_`
    3231 |     DeTypeGenerics,
         |     -------------- the lifetimes get resolved as `'_`
    3232 |     syn::TypeGenerics,
         |     ----------------- the lifetimes get resolved as `'_`
    3233 |     Option<&syn::WhereClause>,
         |            ----------------- the lifetimes get resolved as `'_`
         |
    help: one option is to remove the lifetime for references and use the anonymous lifetime for paths
         |
    3230 ~     DeImplGenerics<'_>,
    3231 ~     DeTypeGenerics<'_>,
    3232 ~     syn::TypeGenerics<'_>,
         |
This commit is contained in:
David Tolnay 2025-06-05 22:09:58 -07:00
parent a1ddb18c92
commit 2130ba5788
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,7 @@
// //
// https://github.com/serde-rs/serde/issues/812 // https://github.com/serde-rs/serde/issues/812
#![cfg_attr(feature = "unstable", feature(never_type))] #![cfg_attr(feature = "unstable", feature(never_type))]
#![allow(unknown_lints, bare_trait_objects, deprecated)] #![allow(unknown_lints, bare_trait_objects, deprecated, mismatched_lifetime_syntaxes)]
// Ignored clippy and clippy_pedantic lints // Ignored clippy and clippy_pedantic lints
#![allow( #![allow(
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704 // clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704

View File

@ -64,6 +64,7 @@
clippy::wildcard_imports clippy::wildcard_imports
)] )]
#![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))] #![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]
#![allow(unknown_lints, mismatched_lifetime_syntaxes)]
extern crate proc_macro2; extern crate proc_macro2;
extern crate quote; extern crate quote;

View File

@ -41,6 +41,7 @@
clippy::unused_self, clippy::unused_self,
clippy::wildcard_imports clippy::wildcard_imports
)] )]
#![allow(unknown_lints, mismatched_lifetime_syntaxes)]
extern crate proc_macro2; extern crate proc_macro2;
extern crate quote; extern crate quote;