1641 Commits

Author SHA1 Message Date
Alisa Sireneva
63cb04d74b Bring MSRV down 2024-07-29 13:05:39 +03:00
Alisa Sireneva
03ceee9eb1 Replace ESCAPE array with is_escape fn
This is not backed by benchmarks, but it seems reasonable that we'd be
more starved for cache than CPU in IO-bound tasks. It also simplifies
code a bit and frees up some memory, which is probably a good thing.
2024-07-29 12:23:38 +03:00
Alisa Sireneva
3faae037e9 Vectorize string parsing 2024-07-29 11:54:22 +03:00
David Tolnay
eca2658a22
Release 1.0.121 v1.0.121 2024-07-28 14:03:27 -07:00
David Tolnay
b0d678cfb4
Merge pull request #1160 from iex-rs/efficient-position
Optimize position search in error path
2024-07-28 14:02:33 -07:00
Alisa Sireneva
b1edc7d13f Optimize position search in error path
Translating index into a line/column pair takes considerable time.
Notably, the JSON benchmark modified to run on malformed data spends
around 50% of the CPU time generating the error object.

While it is generally assumed that the cold path is quite slow, such a
drastic pessimization may be unexpected, especially when a faster
implementation exists.

Using vectorized routines provided by the memchr crate increases
performance of the failure path by 2x on average.

Old implementation:
				DOM         STRUCT
	data/canada.json        122 MB/s    168 MB/s
	data/citm_catalog.json  135 MB/s    195 MB/s
	data/twitter.json       142 MB/s    226 MB/s

New implementation:
				DOM         STRUCT
	data/canada.json        216 MB/s    376 MB/s
	data/citm_catalog.json  238 MB/s    736 MB/s
	data/twitter.json       210 MB/s    492 MB/s

In comparison, the performance of the happy path is:

				DOM         STRUCT
	data/canada.json        283 MB/s    416 MB/s
	data/citm_catalog.json  429 MB/s    864 MB/s
	data/twitter.json       275 MB/s    541 MB/s

While this introduces a new dependency, memchr is much faster to compile
than serde, so compile time does not increase significantly.
Additionally, memchr provides a more efficient SWAR-based implementation
of both the memchr and count routines even without std, providing
benefits for embedded uses as well.
2024-07-27 01:31:00 +03:00
David Tolnay
40dd7f5e86
Merge pull request #1159 from iex-rs/fix-recursion
Move call to tri! out of check_recursion!
2024-07-26 12:24:57 -07:00
Alisa Sireneva
6a306e6ee9 Move call to tri! out of check_recursion! 2024-07-26 20:00:43 +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
David Tolnay
3fd6f5f49d
Merge pull request #1153 from dpathakj/master
Correct documentation URL for Value's Index impl.
2024-07-02 17:24:09 -07:00
David Pathakjee
fcb5e83e44 Correct documentation URL for Value's Index impl.
The current id doesn't exist, so the link just goes to the top of the docs for
Value, rather than to the intended section covering `impl<I> Index<I> for
Value`.
2024-07-02 13:00:53 -07:00
David Tolnay
bcedc3d96b
Release 1.0.120 v1.0.120 2024-07-01 10:29:33 -07:00
David Tolnay
962c0fbbec
Merge pull request #1152 from cforycki/fix/index-map-minimal-version
fix: indexmap minimal version with Map::shift_insert()
2024-07-01 10:29:12 -07:00
Christophe Forycki
3480feda7b
fix: indexmap minimal version with Map::shift_insert() 2024-07-01 18:00:31 +02:00
David Tolnay
b48b9a3a0c
Release 1.0.119 v1.0.119 2024-06-30 11:19:43 -07:00
David Tolnay
8878cd7c04
Make shift_insert available for inlining like other Map methods 2024-06-30 11:15:08 -07:00
David Tolnay
352b7abf00
Document the cfg required for Map::shift_insert to exist 2024-06-30 11:14:46 -07:00
David Tolnay
c17e63f6ef
Merge pull request #1149 from joshka/master
Add Map::shift_insert()
2024-06-30 11:13:42 -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
a9e089a2ce
Merge pull request #1146 from haouvw/master
chore: remove repeat words
2024-06-26 04:18:05 -07:00
haouvw
a83fe96ae2 chore: remove repeat words
Signed-off-by: haouvw <jchaodaohang@foxmail.com>
2024-06-26 15:29:16 +08:00
David Tolnay
c4f24f3be2
Release 1.0.118 v1.0.118 2024-06-24 21:39:20 -07:00
David Tolnay
51d94ebdc0
Combine Map's Hash into one impl 2024-06-24 21:38:12 -07:00
David Tolnay
5e7bedc0a0
Touch up PR 1127 2024-06-24 21:37:44 -07:00
David Tolnay
0af2bdae94
Resolve semicolon_if_nothing_returned pedantic clippy lint from PR 1127
warning: consider adding a `;` to the last statement for consistent formatting
       --> src/map.rs:377:9
        |
    377 |         self.map.hash(state)
        |         ^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.map.hash(state);`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
        = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]`
2024-06-24 21:36:48 -07:00
David Tolnay
eb0330a178
Merge pull request #1127 from edwardycl/hash
impl `Hash` for `Value`
2024-06-24 21:30:18 -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
4c894eaa18
Delete unused associated constant from lexical
warning: associated constant `NEGATIVE_INFINITY_BITS` is never used
       --> src/lexical/num.rs:223:11
        |
    175 | pub trait Float: Number {
        |           ----- associated constant in this trait
    ...
    223 |     const NEGATIVE_INFINITY_BITS: Self::Unsigned;
        |           ^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: `#[warn(dead_code)]` on by default
2024-06-07 20:12:14 -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
62839b7e74
Merge pull request #1136 from dtolnay/docsrs
Rely on docs.rs to define --cfg=docsrs by default
2024-05-18 21:15:00 -07:00
David Tolnay
8e475f13c2
Rely on docs.rs to define --cfg=docsrs by default 2024-05-18 21:06:37 -07:00
David Tolnay
0ae247ca63
Release 1.0.117 v1.0.117 2024-05-07 17:05: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
b4fc2451d7
Merge pull request #1130 from serde-rs/checkcfg
Resolve unexpected_cfgs warning
2024-05-07 16:50:08 -07:00
David Tolnay
98f1a247de
Resolve unexpected_cfgs warning
warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/mod.rs:31:7
       |
    31 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
       = note: `#[warn(unexpected_cfgs)]` on by default

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/mod.rs:34:7
       |
    34 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
     --> src/lexical/large_powers.rs:5:7
      |
    5 | #[cfg(limb_width_32)]
      |       ^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
     --> src/lexical/large_powers.rs:8:7
      |
    8 | #[cfg(limb_width_64)]
      |       ^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/math.rs:40:7
       |
    40 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/math.rs:43:7
       |
    43 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/math.rs:46:7
       |
    46 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/math.rs:49:7
       |
    49 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/math.rs:53:7
       |
    53 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/math.rs:56:7
       |
    56 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/math.rs:59:7
       |
    59 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/math.rs:62:7
       |
    62 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/math.rs:82:7
       |
    82 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/math.rs:89:7
       |
    89 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
     --> src/lexical/small_powers.rs:6:7
      |
    6 | #[cfg(limb_width_32)]
      |       ^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> src/lexical/small_powers.rs:12:7
       |
    12 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> src/lexical/small_powers.rs:18:7
       |
    18 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/mod.rs:31:7
       |
    31 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
       = note: `#[warn(unexpected_cfgs)]` on by default

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/mod.rs:34:7
       |
    34 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
     --> tests/../src/lexical/large_powers.rs:5:7
      |
    5 | #[cfg(limb_width_32)]
      |       ^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
     --> tests/../src/lexical/large_powers.rs:8:7
      |
    8 | #[cfg(limb_width_64)]
      |       ^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/math.rs:40:7
       |
    40 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/math.rs:43:7
       |
    43 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/math.rs:46:7
       |
    46 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/math.rs:49:7
       |
    49 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/math.rs:53:7
       |
    53 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/math.rs:56:7
       |
    56 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/math.rs:59:7
       |
    59 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/math.rs:62:7
       |
    62 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/math.rs:82:7
       |
    82 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/math.rs:89:7
       |
    89 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
     --> tests/../src/lexical/small_powers.rs:6:7
      |
    6 | #[cfg(limb_width_32)]
      |       ^^^^^^^^^^^^^
      |
      = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
      = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/../src/lexical/small_powers.rs:12:7
       |
    12 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/../src/lexical/small_powers.rs:18:7
       |
    18 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_32`
      --> tests/lexical/math.rs:21:7
       |
    21 | #[cfg(limb_width_32)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_32)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration

    warning: unexpected `cfg` condition name: `limb_width_64`
      --> tests/lexical/math.rs:26:7
       |
    26 | #[cfg(limb_width_64)]
       |       ^^^^^^^^^^^^^
       |
       = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(limb_width_64)");` to the top of the `build.rs`
       = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
2024-05-07 16:47:00 -07:00
Youngchan Lee
16eb8723cd impl Hash for Value 2024-04-26 01:44:49 +09:00
David Tolnay
a3f62bb10e
Release 1.0.116 v1.0.116 2024-04-15 22:10:38 -07:00
David Tolnay
12c8ee0ce6
Hide "non-exhaustive patterns" errors when crate fails to compile
Fixes #1125.

    error: expected item, found `"serde_json requires that either `std` (default) or `alloc` feature is enabled"`
     --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.115/src/features_check/error.rs:1:1
      |
    1 | "serde_json requires that either `std` (default) or `alloc` feature is enabled"
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected item
      |
      = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>

    error[E0004]: non-exhaustive patterns: `Value::String(_)` not covered
       --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.115/src/value/de.rs:216:15
        |
    216 |         match self {
        |               ^^^^ pattern `Value::String(_)` not covered
        |
    note: `Value` defined here
       --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.115/src/value/mod.rs:116:10
        |
    116 | pub enum Value {
        |          ^^^^^
    ...
    151 |     String(String),
        |     ------ not covered
        = note: the matched value is of type `Value`
    help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
        |
    223 ~             Value::Object(v) => visit_object(v, visitor),
    224 ~             Value::String(_) => todo!(),
        |

    error[E0004]: non-exhaustive patterns: `Cow::Owned(_)` not covered
        --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.115/src/value/de.rs:1338:15
         |
    1338 |         match self.value {
         |               ^^^^^^^^^^ pattern `Cow::Owned(_)` not covered
         |
    note: `Cow<'_, str>` defined here
        --> /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/alloc/src/borrow.rs:180:1
        ::: /rustc/98aa3624be70462d6a25ed5544333e3df62f4c66/library/alloc/src/borrow.rs:190:5
         |
         = note: not covered
         = note: the matched value is of type `Cow<'_, str>`
    help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
         |
    1339 ~             Cow::Borrowed(string) => visitor.visit_borrowed_str(string),
    1340 ~             Cow::Owned(_) => todo!(),
         |

    error[E0004]: non-exhaustive patterns: `&Value::Object(_)` not covered
       --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.115/src/value/ser.rs:17:15
        |
    17  |         match self {
        |               ^^^^ pattern `&Value::Object(_)` not covered
        |
    note: `Value` defined here
       --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_json-1.0.115/src/value/mod.rs:116:10
        |
    116 | pub enum Value {
        |          ^^^^^
    ...
    175 |     Object(Map<String, Value>),
        |     ------ not covered
        = note: the matched value is of type `&Value`
    help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
        |
    22  ~             Value::Array(v) => v.serialize(serializer),
    23  ~             &Value::Object(_) => todo!(),
        |
2024-04-15 22:09:29 -07:00
David Tolnay
051ce970fe
Merge pull request 1124 from mleonhard/master 2024-04-15 21:54:00 -07:00
Michael Leonhard
25dc75050a Replace features_check mod with a call to std::compile_error!. Fixes https://github.com/serde-rs/json/issues/1123 . 2024-04-15 13:07:34 -07:00
David Tolnay
2e15e3d7d5
Revert "Temporarily disable miri on doctests"
This reverts commit 3a3f61b1c9a2dce973179fad1650f709f63bdaa5.
2024-04-08 11:57:46 -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
b1ebf3888e
Release 1.0.115 v1.0.115 2024-03-25 23:03:48 -07:00
David Tolnay
c3dc153e06
Merge pull request #1119 from titaniumtraveler/pr
Fix missing backtick in doc comments letting markdown think &[u8] is a link to u8
2024-03-25 22:36:30 -07:00
David Tolnay
218770bb75
Explicitly install a Rust toolchain for cargo-outdated job
Debugging a recent cargo-outdated bug, it would have been nice not to
wonder whether a rustc version change in GitHub's runner image was a
contributing factor.
2024-03-25 22:24:55 -07:00
Jon Heinritz
840da8e892 Fix missing backticks in doc comments
This was leading to rustdocs markdown parser to interpret slices like &[u8] as
& and a link to u8
2024-03-25 14:48:22 +01:00