Commit Graph

947 Commits

Author SHA1 Message Date
David Tolnay 2009506d33
Release 0.9.34 2024-03-24 17:50:04 -07:00
David Tolnay 3ba8462f7d
Add unmaintained note 2024-03-24 17:40:08 -07:00
David Tolnay 77236b0d50
Ignore dead code lint in tests
New in nightly-2024-03-24 from https://github.com/rust-lang/rust/pull/119552.

    warning: field `b` is never read
      --> tests/test_error.rs:53:13
       |
    52 |     pub struct A {
       |                - field in this struct
    53 |         pub b: Vec<B>,
       |             ^
       |
       = note: `A` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
       = note: `#[warn(dead_code)]` on by default

    warning: field `0` is never read
      --> tests/test_error.rs:57:11
       |
    57 |         C(C),
       |         - ^
       |         |
       |         field in this variant
       |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
       |
    57 |         C(()),
       |           ~~

    warning: field `d` is never read
      --> tests/test_error.rs:61:13
       |
    60 |     pub struct C {
       |                - field in this struct
    61 |         pub d: bool,
       |             ^
       |
       = note: `C` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: fields `v` and `w` are never read
      --> tests/test_error.rs:82:13
       |
    81 |     pub struct Basic {
       |                ----- fields in this struct
    82 |         pub v: bool,
       |             ^
    83 |         pub w: bool,
       |             ^
       |
       = note: `Basic` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: field `c` is never read
       --> tests/test_error.rs:107:13
        |
    106 |     pub struct Wrapper {
        |                ------- field in this struct
    107 |         pub c: (),
        |             ^
        |
        = note: `Wrapper` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: field `0` is never read
       --> tests/test_error.rs:160:11
        |
    160 |         V(usize),
        |         - ^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    160 |         V(()),
        |           ~~

    warning: field `0` is never read
       --> tests/test_error.rs:212:15
        |
    212 |         Inner(Inner),
        |         ----- ^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    212 |         Inner(()),
        |               ~~

    warning: field `0` is never read
       --> tests/test_error.rs:216:17
        |
    216 |         Variant(Vec<usize>),
        |         ------- ^^^^^^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    216 |         Variant(()),
        |                 ~~

    warning: field `0` is never read
       --> tests/test_error.rs:245:11
        |
    245 |         V(usize),
        |         - ^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    245 |         V(()),
        |           ~~

    warning: fields `x` and `y` are never read
       --> tests/test_error.rs:260:13
        |
    259 |     pub struct Struct {
        |                ------ fields in this struct
    260 |         pub x: usize,
        |             ^
    261 |         pub y: usize,
        |             ^
        |
        = note: `Struct` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: field `x` is never read
       --> tests/test_error.rs:334:13
        |
    333 |     pub struct S {
        |                - field in this struct
    334 |         pub x: [i32; 1],
        |             ^
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: field `x` is never read
       --> tests/test_error.rs:347:13
        |
    346 |     pub struct S {
        |                - field in this struct
    347 |         pub x: Option<Box<S>>,
        |             ^
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: fields `0` and `1` are never read
       --> tests/test_error.rs:359:18
        |
    359 |     pub struct S(pub usize, pub Option<Box<S>>);
        |                - ^^^^^^^^^  ^^^^^^^^^^^^^^^^^^
        |                |
        |                fields in this struct
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
        |
    359 |     pub struct S((), ());
        |                  ~~  ~~

    warning: field `0` is never read
       --> tests/test_error.rs:370:18
        |
    370 |     pub struct S(pub Option<Box<S>>);
        |                - ^^^^^^^^^^^^^^^^^^
        |                |
        |                field in this struct
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    370 |     pub struct S(());
        |                  ~~

    warning: field `x` is never read
       --> tests/test_error.rs:382:13
        |
    381 |     pub struct S {
        |                - field in this struct
    382 |         pub x: Option<Box<S>>,
        |             ^
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis

    warning: fields `0` and `1` are never read
       --> tests/test_error.rs:394:18
        |
    394 |     pub struct S(pub usize, pub Option<Box<S>>);
        |                - ^^^^^^^^^  ^^^^^^^^^^^^^^^^^^
        |                |
        |                fields in this struct
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
        |
    394 |     pub struct S((), ());
        |                  ~~  ~~
2024-03-23 20:04:05 -07:00
David Tolnay f4c9ed9238
Release 0.9.33 2024-03-16 22:56:45 -07:00
David Tolnay b4edaee907
Pull in yaml_parser_fetch_more_tokens fix from libyaml 2024-03-16 22:55:31 -07:00
David Tolnay 8a5542ced6
Resolve non_local_definitions warning in test
warning: non-local `impl` definition, they should be avoided as they go against expectation
       --> tests/test_error.rs:412:13
        |
    412 | /             impl<'de> Visitor<'de> for X {
    413 | |                 type Value = X;
    414 | |
    415 | |                 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
    ...   |
    429 | |                 }
    430 | |             }
        | |_____________^
        |
        = help: move this `impl` block outside the of the current associated function `deserialize` and up 2 bodies
        = 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 22:11:19 -08:00
David Tolnay ea57d8cdeb
Release 0.9.32 2024-02-18 21:26:37 -08:00
David Tolnay a52b7ac3f4
Resolve prelude redundant import warnings
warning: the item `FromIterator` is imported redundantly
       --> src/mapping.rs:10:5
        |
    10  | use std::iter::FromIterator;
        |     ^^^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13
        |
    129 |     pub use core::prelude::rust_2021::*;
        |             ------------------------ the item `FromIterator` is already defined here
        |
        = note: `#[warn(unused_imports)]` on by default

    warning: the item `FromIterator` is imported redundantly
       --> src/value/from.rs:148:5
        |
    148 | use std::iter::FromIterator;
        |     ^^^^^^^^^^^^^^^^^^^^^^^
        |
       ::: nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13
        |
    129 |     pub use core::prelude::rust_2021::*;
        |             ------------------------ the item `FromIterator` is already defined here
2024-02-18 21:21:09 -08:00
David Tolnay 9e0b8d337b
Replace curly quotes with ascii straight quotes
Markdown takes care of rendering these to a curly quote.
2024-01-28 19:31:09 -08:00
David Tolnay 2a77483b23
Release 0.9.31 2024-01-28 19:25:04 -08:00
David Tolnay d8d1a839cf
Merge pull request #408 from dtolnay/remove
Add swap_remove and shift_remove methods on Mapping
2024-01-28 19:24:38 -08:00
David Tolnay f8a99a4968
Add swap_remove and shift_remove methods on Mapping 2024-01-28 19:21:02 -08:00
David Tolnay 8b26413e33
Work around dead_code warning in tests
warning: field `0` is never read
      --> tests/test_error.rs:58:11
       |
    58 |         C(C),
       |         - ^
       |         |
       |         field in this variant
       |
       = note: `#[warn(dead_code)]` on by default
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
       |
    58 |         C(()),
       |           ~~

    warning: field `0` is never read
       --> tests/test_error.rs:165:11
        |
    165 |         V(usize),
        |         - ^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    165 |         V(()),
        |           ~~

    warning: field `0` is never read
       --> tests/test_error.rs:217:15
        |
    217 |         Inner(Inner),
        |         ----- ^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    217 |         Inner(()),
        |               ~~

    warning: field `0` is never read
       --> tests/test_error.rs:221:17
        |
    221 |         Variant(Vec<usize>),
        |         ------- ^^^^^^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    221 |         Variant(()),
        |                 ~~

    warning: field `0` is never read
       --> tests/test_error.rs:250:11
        |
    250 |         V(usize),
        |         - ^^^^^
        |         |
        |         field in this variant
        |
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    250 |         V(()),
        |           ~~

    warning: fields `0` and `1` are never read
       --> tests/test_error.rs:367:14
        |
    367 |     struct S(usize, Option<Box<S>>);
        |            - ^^^^^  ^^^^^^^^^^^^^^
        |            |
        |            fields in this struct
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
        |
    367 |     struct S((), ());
        |              ~~  ~~

    warning: field `0` is never read
       --> tests/test_error.rs:378:14
        |
    378 |     struct S(Option<Box<S>>);
        |            - ^^^^^^^^^^^^^^
        |            |
        |            field in this struct
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
        |
    378 |     struct S(());
        |              ~~

    warning: fields `0` and `1` are never read
       --> tests/test_error.rs:403:14
        |
    403 |     struct S(usize, Option<Box<S>>);
        |            - ^^^^^  ^^^^^^^^^^^^^^
        |            |
        |            fields in this struct
        |
        = note: `S` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
        |
    403 |     struct S((), ());
        |              ~~  ~~
2024-01-05 18:40:29 -08:00
David Tolnay 09ee25156f
Release 0.9.30 2024-01-01 23:24:38 -08:00
David Tolnay caea939ece
Pull in proc-macro2 sccache fix 2024-01-01 23:24:08 -08:00
David Tolnay d255918c14
Merge pull request #403 from dtolnay/optionifletelse
Remove option_if_let_else clippy suppression
2023-12-30 14:45:44 -08:00
David Tolnay 8cfeedd766
Remove option_if_let_else clippy suppression 2023-12-30 14:42:54 -08:00
David Tolnay b957d2b15d
Release 0.9.29 2023-12-21 12:19:40 -08:00
David Tolnay 007fc2d5c1
Merge pull request #401 from dtolnay/unsafeop
Turn on deny(unsafe_op_in_unsafe_fn)
2023-12-21 12:18:59 -08:00
David Tolnay 5bac2475b0
Fill in unsafe blocks inside unsafe functions 2023-12-21 12:16:18 -08:00
David Tolnay 0f6dba18ab
Turn on deny(unsafe_op_in_unsafe_fn) 2023-12-21 12:12:02 -08:00
David Tolnay 1b6e44837f
Release 0.9.28 2023-12-20 12:06:20 -08:00
David Tolnay ec1a3145d7
Force unsafe-libyaml version that contains unaligned write fix 2023-12-20 12:05:47 -08:00
David Tolnay a6b2dc075a
Update name of blocks_in_if_conditions clippy lint
warning: lint `clippy::blocks_in_if_conditions` has been renamed to `clippy::blocks_in_conditions`
       --> src/lib.rs:141:5
        |
    141 |     clippy::blocks_in_if_conditions,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::blocks_in_conditions`
        |
        = note: `#[warn(renamed_and_removed_lints)]` on by default
2023-12-16 18:22:23 -08:00
David Tolnay 66ec2cf755
Release 0.9.27 2023-10-25 22:21:09 -07:00
David Tolnay 23069f2b84
Merge pull request #394 from dtolnay/numbernan
Deterministically destroy sign of NaN when converted to Number
2023-10-25 22:20:42 -07:00
David Tolnay 1cda03f896
Destroy NaN signaling and payload too 2023-10-25 22:14:05 -07:00
David Tolnay 88c032fd21
Deterministically destroy sign of NaN when converted to Number 2023-10-25 22:07:59 -07:00
David Tolnay 22116b6707
Expand from_float macro 2023-10-25 22:06:51 -07:00
David Tolnay 1e2a89cadd
Format PR 393 with rustfmt 2023-10-25 22:03:57 -07:00
David Tolnay 8032b5c6f3
Release 0.9.26 2023-10-25 20:27:04 -07:00
David Tolnay d07a63c724
Merge pull request #393 from dtolnay/nansign
Add test of NaN sign when deserializing to primitive
2023-10-25 20:26:31 -07:00
David Tolnay 13e2610360
Pull in serde NaN fix 2023-10-25 20:21:01 -07:00
David Tolnay 8fa21e5e27
Add test of NaN sign when deserializing to primitive 2023-10-25 20:20:57 -07:00
David Tolnay d094ba1783
Merge pull request #392 from dtolnay/positivenan
Ensure that .nan deserialization produces positive NaN
2023-10-25 10:44:35 -07:00
David Tolnay fe45569b75
Ensure that .nan deserialization produces positive NaN 2023-10-25 10:36:55 -07:00
David Tolnay 81b2d76745
Remove 'remember to update' reminder from Cargo.toml 2023-10-17 21:05:31 -07:00
David Tolnay 25f218b873
Clean up unneeded raw strings in test 2023-09-26 19:08:55 -07:00
David Tolnay a777ab2028
Resolve needless_raw_string_hashes clippy lint in test
warning: unnecessary hashes around raw string literal
       --> tests/test_error.rs:252:24
        |
    252 |       let yaml = indoc! {r#"
        |  ________________________^
    253 | |         ---
    254 | |         !V
    255 | |         value: 0
    256 | |     "#};
        | |______^
        |
        = 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::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the literal
        |
    252 ~     let yaml = indoc! {r"
    253 |         ---
    254 |         !V
    255 |         value: 0
    256 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:249:24
        |
    249 |       let yaml = indoc! {r#"
        |  ________________________^
    250 | |         ascii
    251 | |     "#};
        | |______^
        |
        = 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::all`
        = help: to override `-W clippy::all` add `#[allow(clippy::needless_raw_string_hashes)]`
    help: remove all the hashes around the literal
        |
    249 ~     let yaml = indoc! {r"
    250 |         ascii
    251 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:267:24
        |
    267 |       let yaml = indoc! {r#"
        |  ________________________^
    268 | |         🎉
    269 | |     "#};
        | |______^
        |
        = 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 literal
        |
    267 ~     let yaml = indoc! {r"
    268 |         🎉
    269 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:284:24
        |
    284 |       let yaml = indoc! {r#"
        |  ________________________^
    285 | |         trailing_newline: |
    286 | |           aaa
    287 | |           bbb
    ...   |
    290 | |           bbb
    291 | |     "#};
        | |______^
        |
        = 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 literal
        |
    284 ~     let yaml = indoc! {r"
    285 |         trailing_newline: |
      ...
    290 |           bbb
    291 ~     "};
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_serde.rs:310:24
        |
    310 |       let yaml = indoc! {r#"
        |  ________________________^
    311 | |         boolean: 'true'
    312 | |         integer: '1'
    313 | |         void: 'null'
    314 | |         leading_zeros: '007'
    315 | |     "#};
        | |______^
        |
        = 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 literal
        |
    310 ~     let yaml = indoc! {r"
    311 |         boolean: 'true'
      ...
    314 |         leading_zeros: '007'
    315 ~     "};
        |
2023-09-26 19:07:41 -07:00
David Tolnay 635e4ff7a1
Test docs.rs documentation build in CI 2023-09-24 10:53:43 -07:00
David Tolnay bb7e683593
Update actions/checkout@v3 -> v4 2023-09-04 22:35:01 -07:00
David Tolnay 8facc53cd6
Revert "Temporarily disable -Zrandomize-layout due to rustc ICE"
Fixed in nightly-2023-07-23.

This reverts commit 6875bc7c7d.
2023-07-22 18:41:37 -07:00
David Tolnay 6875bc7c7d
Temporarily disable -Zrandomize-layout due to rustc ICE
https://github.com/rust-lang/rust/issues/113941
2023-07-21 20:22:42 -07:00
David Tolnay f26dac4b3a
Release 0.9.25 2023-07-20 15:04:31 -07:00
David Tolnay fda96c77eb
Merge pull request #383 from dtolnay/leadingzero
Use quoted style for strings consisting of digits with leading zero
2023-07-20 15:04:07 -07:00
David Tolnay a38768fc52
Quoted style for string consisting of digits with leading zero 2023-07-20 15:00:35 -07:00
David Tolnay cd1fd90f23
Add test of quoting of number with leading zeros 2023-07-20 14:59:43 -07:00
David Tolnay c1b1eac970
Resolve incorrect_partial_ord_impl_on_ord_type clippy lint
warning: incorrect implementation of `partial_cmp` on an `Ord` type
       --> src/value/tagged.rs:150:1
        |
    150 | /  impl PartialOrd for Tag {
    151 | |      fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        | | _____________________________________________________________-
    152 | ||         Some(Ord::cmp(self, other))
    153 | ||     }
        | ||_____- help: change this to: `{ Some(self.cmp(other)) }`
    154 | |  }
        | |__^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
        = note: `-W clippy::incorrect-partial-ord-impl-on-ord-type` implied by `-W clippy::all`
2023-07-17 21:11:16 -07:00
David Tolnay da99545d4b
Release 0.9.24 2023-07-17 16:19:52 -07:00
David Tolnay 053af6fefc
Merge pull request #382 from dtolnay/parsenumber
Implement FromStr for serde_yaml::Number
2023-07-17 16:19:29 -07:00