259 Commits

Author SHA1 Message Date
David Tolnay
e757a3d881
Switch from ryu -> zmij for float formatting 2025-12-23 14:02:16 -08:00
David Tolnay
caef3c6ea6
Ignore uninlined_format_args pedantic clippy lint
warning: variables can be used directly in the `format!` string
       --> src/ser.rs:448:15
        |
    448 |         match write!(adapter, "{}", value) {
        |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
        = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
    help: change this to
        |
    448 -         match write!(adapter, "{}", value) {
    448 +         match write!(adapter, "{value}") {
        |

    warning: variables can be used directly in the `format!` string
       --> src/value/mod.rs:182:37
        |
    182 |             Value::Bool(boolean) => write!(formatter, "Bool({})", boolean),
        |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    182 -             Value::Bool(boolean) => write!(formatter, "Bool({})", boolean),
    182 +             Value::Bool(boolean) => write!(formatter, "Bool({boolean})"),
        |

    warning: variables can be used directly in the `format!` string
       --> src/value/mod.rs:184:38
        |
    184 |             Value::String(string) => write!(formatter, "String({:?})", string),
        |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    184 -             Value::String(string) => write!(formatter, "String({:?})", string),
    184 +             Value::String(string) => write!(formatter, "String({string:?})"),
        |

    warning: variables can be used directly in the `format!` string
       --> src/number.rs:365:9
        |
    365 |         write!(formatter, "Number({})", self)
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    help: change this to
        |
    365 -         write!(formatter, "Number({})", self)
    365 +         write!(formatter, "Number({self})")
        |
2025-09-13 16:34:07 -07:00
David Tolnay
76cd4fb383
Ignore elidable_lifetime_names pedantic clippy lint
warning: the following explicit lifetimes could be elided: 'a
        --> src/de.rs:2189:11
         |
    2189 | impl<'de, 'a, R> MapKey<'a, R>
         |           ^^            ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
         = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
         = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
         |
    2189 - impl<'de, 'a, R> MapKey<'a, R>
    2189 + impl<'de, R> MapKey<'_, R>
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/de.rs:2196:11
         |
    2196 | impl<'de, 'a, R> de::Deserializer<'de> for MapKey<'a, R>
         |           ^^                                      ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    2196 - impl<'de, 'a, R> de::Deserializer<'de> for MapKey<'a, R>
    2196 + impl<'de, R> de::Deserializer<'de> for MapKey<'_, R>
         |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/error.rs:467:6
        |
    467 | impl<'a> Display for JsonUnexpected<'a> {
        |      ^^                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    467 - impl<'a> Display for JsonUnexpected<'a> {
    467 + impl Display for JsonUnexpected<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/map.rs:601:6
        |
    601 | impl<'de> de::IntoDeserializer<'de, Error> for Map<String, Value> {
        |      ^^^                       ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    601 - impl<'de> de::IntoDeserializer<'de, Error> for Map<String, Value> {
    601 + impl de::IntoDeserializer<'_, Error> for Map<String, Value> {
        |

    warning: the following explicit lifetimes could be elided: 'a
      --> src/ser.rs:31:6
       |
    31 | impl<'a, W> Serializer<W, PrettyFormatter<'a>>
       |      ^^                                   ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
       |
    31 - impl<'a, W> Serializer<W, PrettyFormatter<'a>>
    31 + impl<W> Serializer<W, PrettyFormatter<'_>>
       |

    warning: the following explicit lifetimes could be elided: 'ser
       --> src/ser.rs:420:14
        |
    420 |         impl<'ser, W, F> Write for Adapter<'ser, W, F>
        |              ^^^^                          ^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    420 -         impl<'ser, W, F> Write for Adapter<'ser, W, F>
    420 +         impl<W, F> Write for Adapter<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:480:6
        |
    480 | impl<'a, W, F> ser::SerializeSeq for Compound<'a, W, F>
        |      ^^                                       ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    480 - impl<'a, W, F> ser::SerializeSeq for Compound<'a, W, F>
    480 + impl<W, F> ser::SerializeSeq for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:527:6
        |
    527 | impl<'a, W, F> ser::SerializeTuple for Compound<'a, W, F>
        |      ^^                                         ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    527 - impl<'a, W, F> ser::SerializeTuple for Compound<'a, W, F>
    527 + impl<W, F> ser::SerializeTuple for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:549:6
        |
    549 | impl<'a, W, F> ser::SerializeTupleStruct for Compound<'a, W, F>
        |      ^^                                               ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    549 - impl<'a, W, F> ser::SerializeTupleStruct for Compound<'a, W, F>
    549 + impl<W, F> ser::SerializeTupleStruct for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:571:6
        |
    571 | impl<'a, W, F> ser::SerializeTupleVariant for Compound<'a, W, F>
        |      ^^                                                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    571 - impl<'a, W, F> ser::SerializeTupleVariant for Compound<'a, W, F>
    571 + impl<W, F> ser::SerializeTupleVariant for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:609:6
        |
    609 | impl<'a, W, F> ser::SerializeMap for Compound<'a, W, F>
        |      ^^                                       ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    609 - impl<'a, W, F> ser::SerializeMap for Compound<'a, W, F>
    609 + impl<W, F> ser::SerializeMap for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:681:6
        |
    681 | impl<'a, W, F> ser::SerializeStruct for Compound<'a, W, F>
        |      ^^                                          ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    681 - impl<'a, W, F> ser::SerializeStruct for Compound<'a, W, F>
    681 + impl<W, F> ser::SerializeStruct for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:727:6
        |
    727 | impl<'a, W, F> ser::SerializeStructVariant for Compound<'a, W, F>
        |      ^^                                                 ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    727 - impl<'a, W, F> ser::SerializeStructVariant for Compound<'a, W, F>
    727 + impl<W, F> ser::SerializeStructVariant for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:793:6
        |
    793 | impl<'a, W, F> ser::Serializer for MapKeySerializer<'a, W, F>
        |      ^^                                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    793 - impl<'a, W, F> ser::Serializer for MapKeySerializer<'a, W, F>
    793 + impl<W, F> ser::Serializer for MapKeySerializer<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1979:6
         |
    1979 | impl<'a> Default for PrettyFormatter<'a> {
         |      ^^                              ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    1979 - impl<'a> Default for PrettyFormatter<'a> {
    1979 + impl Default for PrettyFormatter<'_> {
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1985:6
         |
    1985 | impl<'a> Formatter for PrettyFormatter<'a> {
         |      ^^                                ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    1985 - impl<'a> Formatter for PrettyFormatter<'a> {
    1985 + impl Formatter for PrettyFormatter<'_> {
         |

    warning: the following explicit lifetimes could be elided: 'a, 'b
       --> src/value/mod.rs:227:14
        |
    227 |         impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> {
        |              ^^  ^^                                ^^  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    227 -         impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> {
    227 +         impl io::Write for WriterFormatter<'_, '_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/value/de.rs:526:6
        |
    526 | impl<'de> IntoDeserializer<'de, Error> for Value {
        |      ^^^                   ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    526 - impl<'de> IntoDeserializer<'de, Error> for Value {
    526 + impl IntoDeserializer<'_, Error> for Value {
        |

    warning: the following explicit lifetimes could be elided: 'de
        --> src/value/de.rs:1343:6
         |
    1343 | impl<'de> Visitor<'de> for KeyClassifier {
         |      ^^^          ^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
         |
    1343 - impl<'de> Visitor<'de> for KeyClassifier {
    1343 + impl Visitor<'_> for KeyClassifier {
         |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/value/index.rs:146:6
        |
    146 | impl<'a> Display for Type<'a> {
        |      ^^                   ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    146 - impl<'a> Display for Type<'a> {
    146 + impl Display for Type<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/number.rs:403:14
        |
    403 |         impl<'de> Visitor<'de> for NumberVisitor {
        |              ^^^          ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    403 -         impl<'de> Visitor<'de> for NumberVisitor {
    403 +         impl Visitor<'_> for NumberVisitor {
        |

    warning: the following explicit lifetimes could be elided: 'b, 'c
       --> src/read.rs:132:6
        |
    132 | impl<'b, 'c, T> Deref for Reference<'b, 'c, T>
        |      ^^  ^^                         ^^  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    132 - impl<'b, 'c, T> Deref for Reference<'b, 'c, T>
    132 + impl<T> Deref for Reference<'_, '_, T>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:541:6
        |
    541 | impl<'a> private::Sealed for SliceRead<'a> {}
        |      ^^                                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    541 - impl<'a> private::Sealed for SliceRead<'a> {}
    541 + impl private::Sealed for SliceRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:679:6
        |
    679 | impl<'a> private::Sealed for StrRead<'a> {}
        |      ^^                              ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    679 - impl<'a> private::Sealed for StrRead<'a> {}
    679 + impl private::Sealed for StrRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:833:6
        |
    833 | impl<'a> Fused for SliceRead<'a> {}
        |      ^^                      ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    833 - impl<'a> Fused for SliceRead<'a> {}
    833 + impl Fused for SliceRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:834:6
        |
    834 | impl<'a> Fused for StrRead<'a> {}
        |      ^^                    ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
        |
    834 - impl<'a> Fused for StrRead<'a> {}
    834 + impl Fused for StrRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'de
      --> tests/regression/issue845.rs:12:6
       |
    12 | impl<'de, T> serde:🇩🇪:Visitor<'de> for NumberVisitor<T>
       |      ^^^                        ^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
       = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
       |
    12 - impl<'de, T> serde:🇩🇪:Visitor<'de> for NumberVisitor<T>
    12 + impl<T> serde:🇩🇪:Visitor<'_> for NumberVisitor<T>
       |
2025-03-03 00:02:55 -08:00
David Tolnay
87f78da0f5
More precise gitignore patterns 2025-01-23 01:40:57 -08:00
David Tolnay
2ccb5b67ca
Disable question_mark clippy lint in lexical test
Serde_json uses #![deny(clippy::question_mark_used)].

    warning: this `match` expression can be replaced with `?`
      --> tests/../src/lexical/algorithm.rs:54:21
       |
    54 |           let value = match mantissa.checked_mul(power) {
       |  _____________________^
    55 | |             None => return None,
    56 | |             Some(value) => value,
    57 | |         };
       | |_________^ help: try instead: `mantissa.checked_mul(power)?`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
       = note: `-W clippy::question-mark` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::question_mark)]`
2024-11-15 18:50:53 -08:00
David Tolnay
42ab31feac
Update ui test suite to nightly-2024-10-31 2024-10-30 19:18:57 -07:00
David Tolnay
faab2e8d2f
Ignore needless_lifetimes clippy lint
warning: the following explicit lifetimes could be elided: 'a
        --> src/de.rs:2169:11
         |
    2169 | impl<'de, 'a, R> MapKey<'a, R>
         |           ^^            ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
         = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]`
    help: elide the lifetimes
         |
    2169 - impl<'de, 'a, R> MapKey<'a, R>
    2169 + impl<'de, R> MapKey<'_, R>
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/de.rs:2176:11
         |
    2176 | impl<'de, 'a, R> de::Deserializer<'de> for MapKey<'a, R>
         |           ^^                                      ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
         |
    2176 - impl<'de, 'a, R> de::Deserializer<'de> for MapKey<'a, R>
    2176 + impl<'de, R> de::Deserializer<'de> for MapKey<'_, R>
         |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/error.rs:467:6
        |
    467 | impl<'a> Display for JsonUnexpected<'a> {
        |      ^^                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    467 - impl<'a> Display for JsonUnexpected<'a> {
    467 + impl Display for JsonUnexpected<'_> {
        |

    warning: the following explicit lifetimes could be elided: 'a
      --> src/ser.rs:31:6
       |
    31 | impl<'a, W> Serializer<W, PrettyFormatter<'a>>
       |      ^^                                   ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
       |
    31 - impl<'a, W> Serializer<W, PrettyFormatter<'a>>
    31 + impl<W> Serializer<W, PrettyFormatter<'_>>
       |

    warning: the following explicit lifetimes could be elided: 'ser
       --> src/ser.rs:420:14
        |
    420 |         impl<'ser, W, F> Write for Adapter<'ser, W, F>
        |              ^^^^                          ^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    420 -         impl<'ser, W, F> Write for Adapter<'ser, W, F>
    420 +         impl<W, F> Write for Adapter<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:480:6
        |
    480 | impl<'a, W, F> ser::SerializeSeq for Compound<'a, W, F>
        |      ^^                                       ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    480 - impl<'a, W, F> ser::SerializeSeq for Compound<'a, W, F>
    480 + impl<W, F> ser::SerializeSeq for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:527:6
        |
    527 | impl<'a, W, F> ser::SerializeTuple for Compound<'a, W, F>
        |      ^^                                         ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    527 - impl<'a, W, F> ser::SerializeTuple for Compound<'a, W, F>
    527 + impl<W, F> ser::SerializeTuple for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:549:6
        |
    549 | impl<'a, W, F> ser::SerializeTupleStruct for Compound<'a, W, F>
        |      ^^                                               ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    549 - impl<'a, W, F> ser::SerializeTupleStruct for Compound<'a, W, F>
    549 + impl<W, F> ser::SerializeTupleStruct for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:571:6
        |
    571 | impl<'a, W, F> ser::SerializeTupleVariant for Compound<'a, W, F>
        |      ^^                                                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    571 - impl<'a, W, F> ser::SerializeTupleVariant for Compound<'a, W, F>
    571 + impl<W, F> ser::SerializeTupleVariant for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:609:6
        |
    609 | impl<'a, W, F> ser::SerializeMap for Compound<'a, W, F>
        |      ^^                                       ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    609 - impl<'a, W, F> ser::SerializeMap for Compound<'a, W, F>
    609 + impl<W, F> ser::SerializeMap for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:681:6
        |
    681 | impl<'a, W, F> ser::SerializeStruct for Compound<'a, W, F>
        |      ^^                                          ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    681 - impl<'a, W, F> ser::SerializeStruct for Compound<'a, W, F>
    681 + impl<W, F> ser::SerializeStruct for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:727:6
        |
    727 | impl<'a, W, F> ser::SerializeStructVariant for Compound<'a, W, F>
        |      ^^                                                 ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    727 - impl<'a, W, F> ser::SerializeStructVariant for Compound<'a, W, F>
    727 + impl<W, F> ser::SerializeStructVariant for Compound<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/ser.rs:793:6
        |
    793 | impl<'a, W, F> ser::Serializer for MapKeySerializer<'a, W, F>
        |      ^^                                             ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    793 - impl<'a, W, F> ser::Serializer for MapKeySerializer<'a, W, F>
    793 + impl<W, F> ser::Serializer for MapKeySerializer<'_, W, F>
        |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1157:6
         |
    1157 | impl<'a, W: io::Write, F: Formatter> ser::Serializer for NumberStrEmitter<'a, W, F> {
         |      ^^                                                                   ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
         |
    1157 - impl<'a, W: io::Write, F: Formatter> ser::Serializer for NumberStrEmitter<'a, W, F> {
    1157 + impl<W: io::Write, F: Formatter> ser::Serializer for NumberStrEmitter<'_, W, F> {
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1334:6
         |
    1334 | impl<'a, W: io::Write, F: Formatter> ser::Serializer for RawValueStrEmitter<'a, W, F> {
         |      ^^                                                                     ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
         |
    1334 - impl<'a, W: io::Write, F: Formatter> ser::Serializer for RawValueStrEmitter<'a, W, F> {
    1334 + impl<W: io::Write, F: Formatter> ser::Serializer for RawValueStrEmitter<'_, W, F> {
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1951:6
         |
    1951 | impl<'a> Default for PrettyFormatter<'a> {
         |      ^^                              ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
         |
    1951 - impl<'a> Default for PrettyFormatter<'a> {
    1951 + impl Default for PrettyFormatter<'_> {
         |

    warning: the following explicit lifetimes could be elided: 'a
        --> src/ser.rs:1957:6
         |
    1957 | impl<'a> Formatter for PrettyFormatter<'a> {
         |      ^^                                ^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
         |
    1957 - impl<'a> Formatter for PrettyFormatter<'a> {
    1957 + impl Formatter for PrettyFormatter<'_> {
         |

    warning: the following explicit lifetimes could be elided: 'a, 'b
       --> src/value/mod.rs:227:14
        |
    227 |         impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> {
        |              ^^  ^^                                ^^  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    227 -         impl<'a, 'b> io::Write for WriterFormatter<'a, 'b> {
    227 +         impl io::Write for WriterFormatter<'_, '_> {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/value/de.rs:479:6
        |
    479 | impl<'de> IntoDeserializer<'de, Error> for Value {
        |      ^^^                   ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    479 - impl<'de> IntoDeserializer<'de, Error> for Value {
    479 + impl IntoDeserializer<'_, Error> for Value {
        |

    warning: the following explicit lifetimes could be elided: 'de
        --> src/value/de.rs:1266:6
         |
    1266 | impl<'de> Visitor<'de> for KeyClassifier {
         |      ^^^          ^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
         |
    1266 - impl<'de> Visitor<'de> for KeyClassifier {
    1266 + impl Visitor<'_> for KeyClassifier {
         |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/value/index.rs:146:6
        |
    146 | impl<'a> Display for Type<'a> {
        |      ^^                   ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    146 - impl<'a> Display for Type<'a> {
    146 + impl Display for Type<'_> {
        |

        Checking toml v0.8.19
    warning: the following explicit lifetimes could be elided: 'de
       --> src/number.rs:460:14
        |
    460 |         impl<'de> de::Visitor<'de> for FieldVisitor {
        |              ^^^              ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    460 -         impl<'de> de::Visitor<'de> for FieldVisitor {
    460 +         impl de::Visitor<'_> for FieldVisitor {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/number.rs:497:14
        |
    497 |         impl<'de> de::Visitor<'de> for Visitor {
        |              ^^^              ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    497 -         impl<'de> de::Visitor<'de> for Visitor {
    497 +         impl de::Visitor<'_> for Visitor {
        |

    warning: the following explicit lifetimes could be elided: 'b, 'c
       --> src/read.rs:132:6
        |
    132 | impl<'b, 'c, T> Deref for Reference<'b, 'c, T>
        |      ^^  ^^                         ^^  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    132 - impl<'b, 'c, T> Deref for Reference<'b, 'c, T>
    132 + impl<T> Deref for Reference<'_, '_, T>
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:535:6
        |
    535 | impl<'a> private::Sealed for SliceRead<'a> {}
        |      ^^                                ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    535 - impl<'a> private::Sealed for SliceRead<'a> {}
    535 + impl private::Sealed for SliceRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:673:6
        |
    673 | impl<'a> private::Sealed for StrRead<'a> {}
        |      ^^                              ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    673 - impl<'a> private::Sealed for StrRead<'a> {}
    673 + impl private::Sealed for StrRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:827:6
        |
    827 | impl<'a> Fused for SliceRead<'a> {}
        |      ^^                      ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    827 - impl<'a> Fused for SliceRead<'a> {}
    827 + impl Fused for SliceRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'a
       --> src/read.rs:828:6
        |
    828 | impl<'a> Fused for StrRead<'a> {}
        |      ^^                    ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    828 - impl<'a> Fused for StrRead<'a> {}
    828 + impl Fused for StrRead<'_> {}
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/raw.rs:374:14
        |
    374 |         impl<'de> Visitor<'de> for FieldVisitor {
        |              ^^^          ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    374 -         impl<'de> Visitor<'de> for FieldVisitor {
    374 +         impl Visitor<'_> for FieldVisitor {
        |

    warning: the following explicit lifetimes could be elided: 'de
       --> src/raw.rs:439:6
        |
    439 | impl<'de> Visitor<'de> for BoxedFromString {
        |      ^^^          ^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    help: elide the lifetimes
        |
    439 - impl<'de> Visitor<'de> for BoxedFromString {
    439 + impl Visitor<'_> for BoxedFromString {
        |

    warning: the following explicit lifetimes could be elided: 'de
      --> tests/regression/issue845.rs:12:6
       |
    12 | impl<'de, T> serde:🇩🇪:Visitor<'de> for NumberVisitor<T>
       |      ^^^                        ^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
       = note: `-W clippy::needless-lifetimes` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]`
    help: elide the lifetimes
       |
    12 - impl<'de, T> serde:🇩🇪:Visitor<'de> for NumberVisitor<T>
    12 + impl<T> serde:🇩🇪:Visitor<'_> for NumberVisitor<T>
       |
2024-10-07 20:45:41 +02:00
David Tolnay
d254281184
Replace str::to_string with to_owned 2024-09-04 15:31:51 -07:00
David Tolnay
ffc4a43453
Improve cfg names for fast arithmetic 2024-08-23 12:43:27 -07:00
David Tolnay
f268173a9f
Unify chunk size choice between float and string parsing 2024-08-23 12:36:49 -07:00
David Tolnay
0f942e5b52
Merge pull request 1175 from iex-rs/faster-backslash-u 2024-08-14 22:23:30 -07:00
Alisa Sireneva
96ae60445d Correct WTF-8 parsing
Closes #877.

This is a good time to make ByteBuf parsing more consistent as I'm
rewriting it anyway. This commit integrates the changes from #877 and
also handles a leading surrogate followed by a surrogate pair correctly.

This does not affect performance significantly.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-08-12 21:12:03 +03:00
Alisa Sireneva
86d0e114e1 Parse \uXXXX escapes faster
When ignoring *War and Peace* (in Russian), this increases performance
from 640 MB/s to 1080 MB/s (+70%).

When parsing into String, the savings are moderate but still
significant: 275 MB/s to 320 MB/s (+15%).
2024-08-12 12:00:41 +03:00
Alisa Sireneva
8eba7863b1 Fix skip_to_escape on BE architectures 2024-08-11 23:45:41 +03:00
David Tolnay
346189a524
Fix needless_borrow clippy lint in new control character test
warning: this expression creates a reference which is immediately dereferenced by the compiler
        --> tests/test.rs:2515:9
         |
    2515 |         &"\"\t\n\r\"",
         |         ^^^^^^^^^^^^^ help: change this to: `"\"\t\n\r\""`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
         = note: `-W clippy::needless-borrow` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
2024-08-11 10:45:43 -07:00
David Tolnay
859ead8e6d
Merge pull request #1161 from iex-rs/vectorized-string-parsing
Vectorize string parsing
2024-08-11 10:44:24 -07:00
David Tolnay
7633cb7f05
Eliminate local_inner_macros in favor of non-ident macro paths 2024-08-01 14:18:05 -07:00
Alisa Sireneva
3063d69fd5 Add better tests 2024-07-29 13:23:01 +03:00
David Tolnay
3f1c6de4af
Ignore byte_char_slices clippy lint in test
warning: can be more succinctly written as a byte str
        --> tests/test.rs:1108:13
         |
    1108 |             &[b'"', b'\n', b'"'],
         |             ^^^^^^^^^^^^^^^^^^^^ help: try: `b"\"\n\""`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices
         = note: `-W clippy::byte-char-slices` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::byte_char_slices)]`

    warning: can be more succinctly written as a byte str
        --> tests/test.rs:1112:13
         |
    1112 |             &[b'"', b'\x1F', b'"'],
         |             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `b"\"\x1F\""`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices
2024-07-11 20:09:16 -07:00
Josh McKinney
309ef6b887
Add Map::shift_insert()
This method inserts a key-value pair in the map at the given index. If
the map did not have this key present, `None` is returned. If the map
did have this key present, the key is moved to the new position, the
value is updated, and the old value is returned.

This is useful when you want to insert a key-value pair at a specific
position in the map, and is a necessary method when writing a JSON
editor that can mutate the keys in a JSON object.
2024-06-30 09:53:12 -07:00
David Tolnay
24d868f4e9
Another lexical const that is unused, though not in test
warning: associated constant `SIGN_MASK` is never used
       --> src/lexical/num.rs:210:11
        |
    175 | pub trait Float: Number {
        |           ----- associated constant in this trait
    ...
    210 |     const SIGN_MASK: Self::Unsigned;
        |           ^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default
2024-06-07 20:24:01 -07:00
David Tolnay
fa8aa223c6
Fill in ignore reasons in all #[ignore] attributes 2024-06-01 22:13:43 -07:00
David Tolnay
c9b9f88c1a
Run more of test suite in preserve_order mode 2024-06-01 21:32:54 -07:00
David Tolnay
b83d243e71
Ignore large_digit_groups pedantic clippy lint in test
warning: digit groups should be smaller
       --> tests/test.rs:962:9
        |
    962 |         51.24817837550540_4,  // 51.2481783755054_1
        |         ^^^^^^^^^^^^^^^^^^^ help: consider: `51.248_178_375_505_404`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups
        = note: `-W clippy::large-digit-groups` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::large_digit_groups)]`

    warning: digit groups should be smaller
       --> tests/test.rs:963:10
        |
    963 |         -93.3113703768803_3,  // -93.3113703768803_2
        |          ^^^^^^^^^^^^^^^^^^ help: consider: `93.311_370_376_880_33`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups

    warning: digit groups should be smaller
       --> tests/test.rs:964:10
        |
    964 |         -36.5739948427534_36, // -36.5739948427534_4
        |          ^^^^^^^^^^^^^^^^^^^ help: consider: `36.573_994_842_753_436`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups

    warning: digit groups should be smaller
       --> tests/test.rs:965:9
        |
    965 |         52.31400820410624_4,  // 52.31400820410624_
        |         ^^^^^^^^^^^^^^^^^^^ help: consider: `52.314_008_204_106_244`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups

    warning: digit groups should be smaller
       --> tests/test.rs:966:9
        |
    966 |         97.4536532003468_5,   // 97.4536532003468_4
        |         ^^^^^^^^^^^^^^^^^^ help: consider: `97.453_653_200_346_85`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_digit_groups
2024-06-01 21:32:54 -07:00
David Tolnay
18e9b89acb
Resolve needless_raw_string_hashes pedantic clippy lint in test
warning: unnecessary hashes around raw string literal
        --> tests/test.rs:2313:16
         |
    2313 |     assert_eq!(r#"42"#, array_from_str[1].get());
         |                ^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
         = note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::pedantic`
         = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the string literal
         |
    2313 -     assert_eq!(r#"42"#, array_from_str[1].get());
    2313 +     assert_eq!(r"42", array_from_str[1].get());
         |

    warning: unnecessary hashes around raw string literal
        --> tests/test.rs:2315:16
         |
    2315 |     assert_eq!(r#"null"#, array_from_str[3].get());
         |                ^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the string literal
         |
    2315 -     assert_eq!(r#"null"#, array_from_str[3].get());
    2315 +     assert_eq!(r"null", array_from_str[3].get());
         |

    warning: unnecessary hashes around raw string literal
        --> tests/test.rs:2392:16
         |
    2392 |     assert_eq!(r#"42"#, array_from_str[1].get());
         |                ^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the string literal
         |
    2392 -     assert_eq!(r#"42"#, array_from_str[1].get());
    2392 +     assert_eq!(r"42", array_from_str[1].get());
         |

    warning: unnecessary hashes around raw string literal
        --> tests/test.rs:2394:16
         |
    2394 |     assert_eq!(r#"null"#, array_from_str[3].get());
         |                ^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the string literal
         |
    2394 -     assert_eq!(r#"null"#, array_from_str[3].get());
    2394 +     assert_eq!(r"null", array_from_str[3].get());
         |

    warning: unnecessary hashes around raw string literal
        --> tests/test.rs:2399:16
         |
    2399 |     assert_eq!(r#"42"#, array_from_reader[1].get());
         |                ^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the string literal
         |
    2399 -     assert_eq!(r#"42"#, array_from_reader[1].get());
    2399 +     assert_eq!(r"42", array_from_reader[1].get());
         |

    warning: unnecessary hashes around raw string literal
        --> tests/test.rs:2401:16
         |
    2401 |     assert_eq!(r#"null"#, array_from_reader[3].get());
         |                ^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
    help: remove all the hashes around the string literal
         |
    2401 -     assert_eq!(r#"null"#, array_from_reader[3].get());
    2401 +     assert_eq!(r"null", array_from_reader[3].get());
         |
2024-06-01 21:32:54 -07:00
David Tolnay
4517c7a2d9
PartialEq is not implemented between Value and 128-bit ints 2024-05-07 17:00:26 -07:00
David Tolnay
fdf99c7c38
Combine number PartialEq tests 2024-05-07 16:51:35 -07:00
David Tolnay
0baba28775
Resolve legacy_numeric_constants clippy lints
warning: usage of a legacy numeric method
       --> src/de.rs:484:73
        |
    484 | ...                   if overflow!(significand * 10 + digit, u64::max_value()) {
        |                                                                   ^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
        = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
    help: use the associated constant instead
        |
    484 |                             if overflow!(significand * 10 + digit, u64::MAX) {
        |                                                                         ~~~

    warning: usage of a legacy numeric method
       --> src/de.rs:536:57
        |
    536 |             if overflow!(significand * 10 + digit, u64::max_value()) {
        |                                                         ^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    536 |             if overflow!(significand * 10 + digit, u64::MAX) {
        |                                                         ~~~

    warning: usage of a legacy numeric method
       --> src/de.rs:600:49
        |
    600 |             if overflow!(exp * 10 + digit, i32::max_value()) {
        |                                                 ^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    600 |             if overflow!(exp * 10 + digit, i32::MAX) {
        |                                                 ~~~

    warning: usage of a legacy numeric method
       --> src/number.rs💯39
        |
    100 |             N::PosInt(v) => v <= i64::max_value() as u64,
        |                                       ^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    100 |             N::PosInt(v) => v <= i64::MAX as u64,
        |                                       ~~~

    warning: usage of a legacy numeric method
       --> src/number.rs:192:30
        |
    192 |                 if n <= i64::max_value() as u64 {
        |                              ^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    192 |                 if n <= i64::MAX as u64 {
        |                              ~~~

    warning: usage of a legacy numeric method
      --> tests/../src/lexical/exponent.rs:11:21
       |
    11 |     if value > i32::max_value() as usize {
       |                     ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
       = note: `#[warn(clippy::legacy_numeric_constants)]` on by default
    help: use the associated constant instead
       |
    11 |     if value > i32::MAX as usize {
       |                     ~~~

    warning: usage of a legacy numeric method
      --> tests/../src/lexical/exponent.rs:12:14
       |
    12 |         i32::max_value()
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    12 |         i32::MAX
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/../src/lexical/rounding.rs:28:14
       |
    28 |         u64::max_value()
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    28 |         u64::MAX
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:21:34
       |
    21 |         scientific_exponent(i32::min_value(), 0, 0),
       |                                  ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    21 |         scientific_exponent(i32::MIN, 0, 0),
       |                                  ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:22:14
       |
    22 |         i32::min_value()
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    22 |         i32::MIN
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:25:34
       |
    25 |         scientific_exponent(i32::min_value(), 0, 5),
       |                                  ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    25 |         scientific_exponent(i32::MIN, 0, 5),
       |                                  ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:26:14
       |
    26 |         i32::min_value()
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    26 |         i32::MIN
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:31:34
       |
    31 |         scientific_exponent(i32::max_value(), 0, 0),
       |                                  ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    31 |         scientific_exponent(i32::MAX, 0, 0),
       |                                  ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:32:14
       |
    32 |         i32::max_value() - 1
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    32 |         i32::MAX - 1
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:35:34
       |
    35 |         scientific_exponent(i32::max_value(), 5, 0),
       |                                  ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    35 |         scientific_exponent(i32::MAX, 5, 0),
       |                                  ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:36:14
       |
    36 |         i32::max_value()
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    36 |         i32::MAX
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:45:32
       |
    45 |         mantissa_exponent(i32::max_value(), 5, 0),
       |                                ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    45 |         mantissa_exponent(i32::MAX, 5, 0),
       |                                ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:46:14
       |
    46 |         i32::max_value() - 5
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    46 |         i32::MAX - 5
       |              ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:48:39
       |
    48 |     assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::max_value());
       |                                       ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    48 |     assert_eq!(mantissa_exponent(i32::MAX, 0, 5), i32::max_value());
       |                                       ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:48:64
       |
    48 |     assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::max_value());
       |                                                                ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    48 |     assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::MAX);
       |                                                                ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:49:39
       |
    49 |     assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::min_value());
       |                                       ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    49 |     assert_eq!(mantissa_exponent(i32::MIN, 5, 0), i32::min_value());
       |                                       ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:49:64
       |
    49 |     assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::min_value());
       |                                                                ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    49 |     assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::MIN);
       |                                                                ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:51:32
       |
    51 |         mantissa_exponent(i32::min_value(), 0, 5),
       |                                ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    51 |         mantissa_exponent(i32::MIN, 0, 5),
       |                                ~~~

    warning: usage of a legacy numeric method
      --> tests/lexical/exponent.rs:52:14
       |
    52 |         i32::min_value() + 5
       |              ^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
       |
    52 |         i32::MIN + 5
       |              ~~~

    warning: importing legacy numeric constants
      --> tests/test.rs:47:11
       |
    47 | use std::{i16, i32, i64, i8};
       |           ^^^
       |
       = help: remove this import
       = note: then `i16::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
       = note: `#[warn(clippy::legacy_numeric_constants)]` on by default

    warning: importing legacy numeric constants
      --> tests/test.rs:47:16
       |
    47 | use std::{i16, i32, i64, i8};
       |                ^^^
       |
       = help: remove this import
       = note: then `i32::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: importing legacy numeric constants
      --> tests/test.rs:47:21
       |
    47 | use std::{i16, i32, i64, i8};
       |                     ^^^
       |
       = help: remove this import
       = note: then `i64::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: importing legacy numeric constants
      --> tests/test.rs:47:26
       |
    47 | use std::{i16, i32, i64, i8};
       |                          ^^
       |
       = help: remove this import
       = note: then `i8::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: importing legacy numeric constants
      --> tests/test.rs:48:11
       |
    48 | use std::{u16, u32, u64, u8};
       |           ^^^
       |
       = help: remove this import
       = note: then `u16::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: importing legacy numeric constants
      --> tests/test.rs:48:16
       |
    48 | use std::{u16, u32, u64, u8};
       |                ^^^
       |
       = help: remove this import
       = note: then `u32::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: importing legacy numeric constants
      --> tests/test.rs:48:21
       |
    48 | use std::{u16, u32, u64, u8};
       |                     ^^^
       |
       = help: remove this import
       = note: then `u64::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: importing legacy numeric constants
      --> tests/test.rs:48:26
       |
    48 | use std::{u16, u32, u64, u8};
       |                          ^^
       |
       = help: remove this import
       = note: then `u8::<CONST>` will resolve to the respective associated constant
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

    warning: usage of a legacy numeric constant
       --> tests/test.rs:161:22
        |
    161 |     let v = to_value(::std::f64::NAN.copysign(1.0)).unwrap();
        |                      ^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    161 |     let v = to_value(f64::NAN.copysign(1.0)).unwrap();
        |                      ~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:164:22
        |
    164 |     let v = to_value(::std::f64::NAN.copysign(-1.0)).unwrap();
        |                      ^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    164 |     let v = to_value(f64::NAN.copysign(-1.0)).unwrap();
        |                      ~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:167:22
        |
    167 |     let v = to_value(::std::f64::INFINITY).unwrap();
        |                      ^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    167 |     let v = to_value(f64::INFINITY).unwrap();
        |                      ~~~~~~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:170:23
        |
    170 |     let v = to_value(-::std::f64::INFINITY).unwrap();
        |                       ^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    170 |     let v = to_value(-f64::INFINITY).unwrap();
        |                       ~~~~~~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:173:22
        |
    173 |     let v = to_value(::std::f32::NAN.copysign(1.0)).unwrap();
        |                      ^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    173 |     let v = to_value(f32::NAN.copysign(1.0)).unwrap();
        |                      ~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:176:22
        |
    176 |     let v = to_value(::std::f32::NAN.copysign(-1.0)).unwrap();
        |                      ^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    176 |     let v = to_value(f32::NAN.copysign(-1.0)).unwrap();
        |                      ~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:179:22
        |
    179 |     let v = to_value(::std::f32::INFINITY).unwrap();
        |                      ^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    179 |     let v = to_value(f32::INFINITY).unwrap();
        |                      ~~~~~~~~~~~~~

    warning: usage of a legacy numeric constant
       --> tests/test.rs:182:23
        |
    182 |     let v = to_value(-::std::f32::INFINITY).unwrap();
        |                       ^^^^^^^^^^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
        |
    182 |     let v = to_value(-f32::INFINITY).unwrap();
        |                       ~~~~~~~~~~~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2243:26
         |
    2243 |     let signed = &[i128::min_value(), -1, 0, 1, i128::max_value()];
         |                          ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2243 |     let signed = &[i128::MIN, -1, 0, 1, i128::max_value()];
         |                          ~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2243:55
         |
    2243 |     let signed = &[i128::min_value(), -1, 0, 1, i128::max_value()];
         |                                                       ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2243 |     let signed = &[i128::min_value(), -1, 0, 1, i128::MAX];
         |                                                       ~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2244:34
         |
    2244 |     let unsigned = &[0, 1, u128::max_value()];
         |                                  ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2244 |     let unsigned = &[0, 1, u128::MAX];
         |                                  ~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2280:36
         |
    2280 |     let signed = &[i128::from(i64::min_value()), i128::from(u64::max_value())];
         |                                    ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2280 |     let signed = &[i128::from(i64::MIN), i128::from(u64::max_value())];
         |                                    ~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2280:66
         |
    2280 |     let signed = &[i128::from(i64::min_value()), i128::from(u64::max_value())];
         |                                                                  ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2280 |     let signed = &[i128::from(i64::min_value()), i128::from(u64::MAX)];
         |                                                                  ~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2281:41
         |
    2281 |     let unsigned = &[0, u128::from(u64::max_value())];
         |                                         ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2281 |     let unsigned = &[0, u128::from(u64::MAX)];
         |                                         ~~~

    warning: usage of a legacy numeric method
        --> tests/test.rs:2294:44
         |
    2294 |         let err = to_value(u128::from(u64::max_value()) + 1).unwrap_err();
         |                                            ^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    help: use the associated constant instead
         |
    2294 |         let err = to_value(u128::from(u64::MAX) + 1).unwrap_err();
         |                                            ~~~
2024-04-05 19:10:44 -07:00
David Tolnay
4a0be88b5a
Format regression tests with rustfmt 2024-03-23 20:24:22 -07:00
David Tolnay
d2dbbf7055
Ignore dead code lint in tests
New in nightly-2024-03-24 from https://github.com/rust-lang/rust/pull/119552.

    warning: field `x` is never read
      --> tests/regression/issue795.rs:11:15
       |
    11 |     Variant { x: u8 },
       |     -------   ^
       |     |
       |     field in this variant
       |
       = note: `#[warn(dead_code)]` on by default

    warning: field `i` is never read
      --> tests/regression/issue845.rs:63:9
       |
    61 | pub struct Struct {
       |            ------ field in this struct
    62 |     #[serde(deserialize_with = "deserialize_integer_or_string")]
    63 |     pub i: i64,
       |         ^
       |
       = note: `Struct` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
2024-03-23 20:19:20 -07:00
David Tolnay
fedf8341ee
Ignore non_local_definitions false positive in test
https://github.com/rust-lang/rust/issues/121621

    warning: non-local `impl` definition, they should be avoided as they go against expectation
        --> tests/test.rs:2338:5
         |
    2338 | /     impl<'de> Deserialize<'de> for &'de RawMapKey {
    2339 | |         fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    2340 | |         where
    2341 | |             D: serde::Deserializer<'de>,
    ...    |
    2345 | |         }
    2346 | |     }
         | |_____^
         |
         = help: move this `impl` block outside the of the current function `test_raw_value_in_map_key`
         = note: an `impl` definition is non-local if it is nested inside an item and neither the type nor the trait are at the same nesting level as the `impl` block
         = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type
         = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
         = note: `#[warn(non_local_definitions)]` on by default
2024-02-25 19:50:26 -08:00
David Tolnay
6fb70262e8
Work around prelude redundant import warnings
https://github.com/rust-lang/rust/pull/117772

    warning: the item `String` is imported redundantly
       --> src/de.rs:8:5
        |
    8   | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here
        |
        = note: `#[warn(unused_imports)]` on by default

    warning: the item `Vec` is imported redundantly
       --> src/de.rs:9:5
        |
    9   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `Box` is imported redundantly
       --> src/error.rs:4:5
        |
    4   | use alloc::boxed::Box;
        |     ^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Box` is already defined here

    warning: the item `String` is imported redundantly
       --> src/error.rs:5:21
        |
    5   | use alloc::string::{String, ToString};
        |                     ^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToString` is imported redundantly
       --> src/error.rs:5:29
        |
    5   | use alloc::string::{String, ToString};
        |                             ^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here

    warning: the item `String` is imported redundantly
       --> src/map.rs:10:5
        |
    10  | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `indexmap` is imported redundantly
      --> src/map.rs:23:16
       |
    23 | use indexmap::{self, IndexMap};
       |                ^^^^ the item `indexmap` is already defined here
       |
       = note: `#[warn(unused_imports)]` on by default

    warning: the item `String` is imported redundantly
       --> src/ser.rs:5:21
        |
    5   | use alloc::string::{String, ToString};
        |                     ^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToString` is imported redundantly
       --> src/ser.rs:5:29
        |
    5   | use alloc::string::{String, ToString};
        |                             ^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/ser.rs:6:5
        |
    6   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `String` is imported redundantly
       --> src/value/mod.rs:95:5
        |
    95  | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/value/mod.rs:96:5
        |
    96  | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `ToOwned` is imported redundantly
       --> src/value/de.rs:5:26
        |
    5   | use alloc::borrow::{Cow, ToOwned};
        |                          ^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToOwned` is already defined here

    warning: the item `String` is imported redundantly
       --> src/value/de.rs:6:5
        |
    6   | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/value/de.rs:9:24
        |
    9   | use alloc::vec::{self, Vec};
        |                        ^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `String` is imported redundantly
       --> src/value/from.rs:5:21
        |
    5   | use alloc::string::{String, ToString};
        |                     ^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToString` is imported redundantly
       --> src/value/from.rs:5:29
        |
    5   | use alloc::string::{String, ToString};
        |                             ^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/value/from.rs:6:5
        |
    6   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `ToOwned` is imported redundantly
       --> src/value/index.rs:3:5
        |
    3   | use alloc::borrow::ToOwned;
        |     ^^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToOwned` is already defined here

    warning: the item `String` is imported redundantly
       --> src/value/index.rs:4:5
        |
    4   | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `String` is imported redundantly
       --> src/value/partial_eq.rs:2:5
        |
    2   | use alloc::string::String;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToOwned` is imported redundantly
       --> src/value/ser.rs:4:5
        |
    4   | use alloc::borrow::ToOwned;
        |     ^^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToOwned` is already defined here

    warning: the item `String` is imported redundantly
       --> src/value/ser.rs:5:21
        |
    5   | use alloc::string::{String, ToString};
        |                     ^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `String` is already defined here

    warning: the item `ToString` is imported redundantly
       --> src/value/ser.rs:5:29
        |
    5   | use alloc::string::{String, ToString};
        |                             ^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/value/ser.rs:6:5
        |
    6   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `Vec` is imported redundantly
       --> src/read.rs:2:5
        |
    2   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here

    warning: the item `ToString` is imported redundantly
       --> tests/test.rs:46:5
        |
    46  | use std::string::ToString;
        |     ^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `ToString` is already defined here
        |
        = note: `#[warn(unused_imports)]` on by default

    warning: the item `Vec` is imported redundantly
       --> tests/../src/lexical/bignum.rs:6:5
        |
    6   | use alloc::vec::Vec;
        |     ^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:125:13
        |
    125 |     pub use super::v1::*;
        |             --------- the item `Vec` is already defined here
        |
        = note: `#[warn(unused_imports)]` on by default
2024-02-19 16:11:47 -08:00
David Tolnay
34a04c5f7f
Ignore incompatible_msrv clippy false positives in test
https://github.com/rust-lang/rust-clippy/issues/12257

    warning: current MSRV (Minimum Supported Rust Version) is `1.56.0` but this item is stable since `1.71.0`
        --> tests/test.rs:2500:25
         |
    2500 |         assert_ne!(rand.hash_one(k1), rand.hash_one(k2));
         |                         ^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
         = note: `-W clippy::incompatible-msrv` implied by `-W clippy::all`
         = help: to override `-W clippy::all` add `#[allow(clippy::incompatible_msrv)]`

    warning: current MSRV (Minimum Supported Rust Version) is `1.56.0` but this item is stable since `1.71.0`
        --> tests/test.rs:2500:44
         |
    2500 |         assert_ne!(rand.hash_one(k1), rand.hash_one(k2));
         |                                            ^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv

    warning: current MSRV (Minimum Supported Rust Version) is `1.56.0` but this item is stable since `1.71.0`
        --> tests/test.rs:2503:25
         |
    2503 |         assert_eq!(rand.hash_one(k1), rand.hash_one(k2));
         |                         ^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv

    warning: current MSRV (Minimum Supported Rust Version) is `1.56.0` but this item is stable since `1.71.0`
        --> tests/test.rs:2503:44
         |
    2503 |         assert_eq!(rand.hash_one(k1), rand.hash_one(k2));
         |                                            ^^^^^^^^^^^^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
2024-02-09 18:58:51 -08:00
David Tolnay
b328ee7df4
Eliminate hash closure in favor of calling hash_one directly 2023-12-28 15:43:44 -08:00
David Tolnay
b9bcbad3c0
Use BuildHasher::hash_one 2023-12-28 15:43:44 -08:00
David Tolnay
7ff6c9e30c
Use random hasher state for number hashing test 2023-12-28 15:37:25 -08:00
David Tolnay
fe031cd1de
Delete trace_macros! functionality from test 2023-12-28 15:29:20 -08:00
David Tolnay
05196caf16
Update ui test suite to nightly-2023-11-19 2023-11-18 18:14:15 -08:00
David Tolnay
4e091d5d6d
Add test of negative NaN and negative infinity 2023-10-25 10:41:10 -07:00
David Tolnay
421a70d1a6
Fix unused imports
warning: unused imports: `parse_concise_float`, `parse_truncated_float`
      --> tests/../src/lexical/mod.rs:38:23
       |
    38 | pub use self::parse::{parse_concise_float, parse_truncated_float};
       |                       ^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^
       |
       = note: `#[warn(unused_imports)]` on by default

    warning: unused import: `std::vec::Vec`
      --> tests/lexical.rs:30:13
       |
    30 |     pub use std::vec::Vec;
       |             ^^^^^^^^^^^^^

    warning: unused imports: `cmp`, `iter`, `mem`, `ops`
      --> tests/lexical.rs:31:19
       |
    31 |     pub use std::{cmp, iter, mem, ops};
       |                   ^^^  ^^^^  ^^^  ^^^
2023-10-24 23:35:42 -07:00
Piotr Osiewicz
89a2741956 Revert "Remove limb_width32 and limb_width64 features"
This reverts commit c754f0344b61bf20fe76c205fd8d7a3d46138a96.
2023-09-11 11:19:34 +02:00
Piotr Osiewicz
16e04ceedd fixup! Remove limb_width32 and limb_width64 features 2023-09-03 23:17:27 +02:00
Piotr Osiewicz
d0c979aaf1 chore: Remove no_btreemap_retain feature from build.rs 2023-09-03 22:55:57 +02:00
David Tolnay
9b69f16813
Delete test_serialize_rejects_bool_keys 2023-08-15 14:58:56 -07:00
David Tolnay
58dd8d9b89
Add test for boolean keys in map 2023-08-15 09:49:25 -07:00
Daria Sukhonina
8e8db8ce0c Implement IntoDeserializer for &Value 2023-07-26 22:04:37 +03:00
David Tolnay
8f90eacf6c
Delete inline attributes throughout test suite 2023-07-16 18:13:57 -07:00
David Tolnay
3ddda759cf
Format PR 1037 with rustfmt 2023-07-11 15:54:24 -07:00
David Tolnay
98c4db1279
Add test of leading and trailing whitespace in integer key in from_value 2023-07-11 15:37:42 -07:00
David Tolnay
51b1bd02b3
Add test of trailing whitespace in integer key 2023-07-10 23:42:19 -07:00