Commit Graph

542 Commits

Author SHA1 Message Date
Conrado Gouvea bc3cc1d36c Merge remote-tracking branch 'fork/master' 2024-02-26 13:40:15 -03:00
natalie b9c9f1ca46
Merge pull request #1 from ZcashFoundation/no-std
support no_std by simply not deriving the Error trait
2024-02-16 15:55:41 +00:00
David Tolnay 1d106b169c
Release 1.0.57 2024-02-11 10:43:07 -08:00
David Tolnay 8a5c4d1b76
Use write_str when args only consists of trailing comma 2024-02-11 10:42:20 -08:00
David Tolnay f790bee2a4
Phrase flag in terms of whether core::fmt machinery is required 2024-02-11 10:28:28 -08:00
David Tolnay d43b759e3a
Ignore needless_raw_string_hashes pedantic clippy lint in test
warning: unnecessary hashes around raw string literal
       --> tests/test_display.rs:354:12
        |
    354 |     assert(r#"raw brace left {"#, Error::BraceLeft);
        |            ^^^^^^^^^^^^^^^^^^^^^
        |
        = 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
        |
    354 -     assert(r#"raw brace left {"#, Error::BraceLeft);
    354 +     assert(r"raw brace left {", Error::BraceLeft);
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_display.rs:355:12
        |
    355 |     assert(r#"raw brace left 2 \x7B"#, Error::BraceLeft2);
        |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = 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
        |
    355 -     assert(r#"raw brace left 2 \x7B"#, Error::BraceLeft2);
    355 +     assert(r"raw brace left 2 \x7B", Error::BraceLeft2);
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_display.rs:356:12
        |
    356 |     assert(r#"raw brace right }"#, Error::BraceRight);
        |            ^^^^^^^^^^^^^^^^^^^^^^
        |
        = 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
        |
    356 -     assert(r#"raw brace right }"#, Error::BraceRight);
    356 +     assert(r"raw brace right }", Error::BraceRight);
        |

    warning: unnecessary hashes around raw string literal
       --> tests/test_display.rs:357:12
        |
    357 |     assert(r#"raw brace right 2 \x7D"#, Error::BraceRight2);
        |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = 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
        |
    357 -     assert(r#"raw brace right 2 \x7D"#, Error::BraceRight2);
    357 +     assert(r"raw brace right 2 \x7D", Error::BraceRight2);
        |
2024-02-11 10:27:54 -08:00
David Tolnay d09c418295
Touch up PR 286 2024-02-11 10:20:11 -08:00
David Tolnay 097251d2f5
Merge pull request #286 from nyurik/litstr
Optimize performance for string literals in Display::fmt
2024-02-11 10:20:00 -08:00
Yuri Astrakhan cd79876fe8 optimize by avoiding second fmt.value() call 2024-02-08 23:56:26 -05:00
Yuri Astrakhan d7e738e1d8 Optimize simple literals for Display::fmt
Compiler is unable to generate as efficient code for `write!(f, "text")` as it does for `f.write_str("text")`.  This PR checks if the `#[error("text")]` uses a simple string literal without the `{` and `}` characters, and without arguments, and uses `write_str` if so.
2024-02-08 23:16:52 -05:00
David Tolnay 0717de3f50
Update ui test suite to nightly-2024-02-08 2024-02-07 21:13:02 -08:00
David Tolnay c7c75470ec
Update ui test suite to nightly-2024-01-31 2024-01-30 22:18:29 -08:00
Conrado Gouvea 6a4a8182d2 support no_std by simply not deriving the Error trait 2024-01-10 17:40:49 -03:00
David Tolnay 77d0af46dd
Release 1.0.56 2024-01-01 22:09:00 -08:00
David Tolnay d4caabdb38
Pull in proc-macro2 sccache fix 2024-01-01 22:08:35 -08:00
David Tolnay 6089273df5
Release 1.0.55 2024-01-01 20:25:58 -08:00
David Tolnay 322a2ae5c9
Merge pull request #280 from dtolnay/depinfo
Emit dep-info for probe.rs in case sccache needs it
2024-01-01 20:25:36 -08:00
David Tolnay fd7d7a568c
Emit dep-info for probe.rs in case sccache needs it 2024-01-01 20:23:32 -08:00
David Tolnay 447c328719
Release 1.0.54 2024-01-01 20:22:26 -08:00
David Tolnay 4619db8644
Merge pull request #279 from dtolnay/depinfo
Make env-dep:RUSTC_BOOTSTRAP get listed in probe's dep-info
2024-01-01 20:21:53 -08:00
David Tolnay 7b53bff3e6
Make env-dep:RUSTC_BOOTSTRAP get listed in probe's dep-info 2024-01-01 20:10:44 -08:00
David Tolnay e0500add5e
Merge pull request #277 from dtolnay/nightlyci
Make CI verify that error_generic_member_access works in latest nightly
2023-12-30 18:34:46 -08:00
David Tolnay 48cea47164
Make CI verify that error_generic_member_access works in latest nightly 2023-12-30 18:31:42 -08:00
David Tolnay fe40a5034c
Merge pull request #276 from dtolnay/optionifletelse
Remove option_if_let_else clippy suppression
2023-12-30 14:44:38 -08:00
David Tolnay b97654ab2c
Remove option_if_let_else clippy suppression 2023-12-30 14:42:20 -08:00
David Tolnay af28d9c078
Release 1.0.53 2023-12-30 13:53:37 -08:00
David Tolnay c22822cd8c
Merge pull request #275 from dtolnay/probers
Rerun build script on changes to probe.rs
2023-12-30 13:53:02 -08:00
David Tolnay 87223991b7
Rerun build script on changes to probe.rs 2023-12-30 13:50:41 -08:00
David Tolnay 0e280fe61d
Merge pull request #274 from dtolnay/bootstrap
Do not rebuild on RUSTC_BOOTSTRAP changes on nightly compiler
2023-12-30 13:49:03 -08:00
David Tolnay f334cfcdc1
Do not rebuild on RUSTC_BOOTSTRAP changes on nightly compiler 2023-12-30 13:43:21 -08:00
David Tolnay 5fd95375e3
Update crate name used for build script probe
This will make it correctly respect RUSTC_BOOTSTRAP=thiserror.
2023-12-30 13:42:31 -08:00
David Tolnay a9b1585343
Move ExitStatus::success check into compile_probe() 2023-12-30 13:41:28 -08:00
David Tolnay 0f349a4bb1
Remove needless_raw_string_hashes clippy pedantic suppression from build script
No longer needed since https://github.com/dtolnay/thiserror/pull/272.
2023-12-30 13:07:55 -08:00
David Tolnay c1c003f2a3
Merge pull request #273 from dtolnay/cargoenvvar
Require cargo promised environment variables to be present
2023-12-30 13:07:44 -08:00
David Tolnay 9b7356fd43
Require cargo promised environment variables to be present 2023-12-30 13:05:16 -08:00
David Tolnay facaaf63df
Merge pull request #272 from dtolnay/probe
Move probe.rs out of build script string literal into file
2023-12-30 13:02:45 -08:00
David Tolnay 72bee68e4a
Move probe.rs out of build script string literal into file 2023-12-30 11:32:22 -08:00
David Tolnay be83323c0f
Release 1.0.52 2023-12-25 13:01:40 -08:00
David Tolnay c89ee6cd03
Merge pull request #269 from dtolnay/bootstrap
Rerun build script on RUSTC_BOOTSTRAP change
2023-12-25 13:01:03 -08:00
David Tolnay af1665218f
Rerun build script on RUSTC_BOOTSTRAP change 2023-12-25 12:12:03 -08:00
David Tolnay d160dd2af7
Merge pull request #267 from dtolnay/useunderscore
Leave private traits' name out of scope
2023-12-25 10:28:43 -08:00
David Tolnay 6b00235610
Leave private traits' name out of scope 2023-12-25 10:26:29 -08:00
David Tolnay c3838bd7c5
Add a funding file 2023-12-20 15:53:58 -08:00
David Tolnay 87466d2a25
Update name of blocks_in_if_conditions clippy lint
warning: lint `clippy::blocks_in_if_conditions` has been renamed to `clippy::blocks_in_conditions`
     --> impl/src/lib.rs:2:5
      |
    2 |     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:19:09 -08:00
David Tolnay 0555b80591
Release 1.0.51 2023-12-15 14:19:23 -08:00
David Tolnay b94add8c9b
Add ui test where fallback impl conflicts with handwritten Display 2023-12-15 14:18:41 -08:00
David Tolnay 02c6a55480
Merge pull request #266 from dtolnay/fallback
Emit an Error impl even in the presence of bad attributes
2023-12-15 14:18:17 -08:00
David Tolnay 1754825c24
Work around trivial bounds being unstable 2023-12-15 14:13:00 -08:00
David Tolnay 1567f40ec3
Try to remove "doesn't implement Debug" in fallback expansion 2023-12-15 14:12:59 -08:00
David Tolnay d7e3bdd980
Fix redundant "Error doesn't implement Display" in fallback 2023-12-15 14:12:30 -08:00