Commit graph

772 commits

Author SHA1 Message Date
David Tolnay
95a5126693
Release 2.0.12 2025-03-02 20:24:05 -08:00
David Tolnay
76490f743e
Merge pull request #413 from dtolnay/elidablelifetime
Clippy elidable_lifetime_names lint
2025-03-02 23:23:21 -05:00
David Tolnay
9f27b766f5
Ignore elidable_lifetime_names pedantic clippy lint
warning: the following explicit lifetimes could be elided: 'a
     --> src/var.rs:5:6
      |
    5 | impl<'a, T: Pointer + ?Sized> Pointer for Var<'a, T> {
      |      ^^                                       ^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
      = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
      |
    5 - impl<'a, T: Pointer + ?Sized> Pointer for Var<'a, T> {
    5 + impl<T: Pointer + ?Sized> Pointer for Var<'_, T> {
      |

    warning: the following explicit lifetimes could be elided: 'a
      --> tests/test_lints.rs:40:22
       |
    40 |     pub enum MyError<'a> {
       |                      ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
       = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
       |
    40 -     pub enum MyError<'a> {
    40 +     pub enum MyError'_> {
       |

    warning: the following explicit lifetimes could be elided: 'a
       --> tests/test_display.rs:157:14
        |
    157 |         impl<'a> Display for Msg<'a> {
        |              ^^                  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
        = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
        |
    157 -         impl<'a> Display for Msg<'a> {
    157 +         impl Display for Msg<'_> {
        |
2025-03-02 19:56:43 -08:00
David Tolnay
daf2a6f36e
Resolve some elidable_lifetime_names pedantic clippy lint
warning: the following explicit lifetimes could be elided: 'a
      --> src/aserror.rs:47:6
       |
    47 | impl<'a> Sealed for dyn Error + 'a {}
       |      ^^                         ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
       = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
       |
    47 - impl<'a> Sealed for dyn Error + 'a {}
    47 + impl Sealed for dyn Error + '_ {}
       |

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

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

    warning: the following explicit lifetimes could be elided: 'a
      --> src/aserror.rs:50:6
       |
    50 | impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {}
       |      ^^                                                    ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
       |
    50 - impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {}
    50 + impl Sealed for dyn Error + Send + Sync + UnwindSafe + '_ {}
       |
2025-03-02 19:52:49 -08:00
David Tolnay
5f07160c35
Point standard library links to stable 2025-02-20 05:24:47 -08:00
David Tolnay
6706a5121b
Convert html links to intra-doc links 2025-02-19 22:30:39 -08:00
David Tolnay
2706873a04
More precise gitignore patterns 2025-01-23 01:36:08 -08:00
David Tolnay
70bc20d848
Remove **/*.rs.bk from project-specific gitignore
Cargo stopped generating this in its project template 5 years ago. It
would belong in a global gitignore instead.
2025-01-22 19:30:31 -08:00
David Tolnay
0f532e326e
Release 2.0.11 2025-01-10 10:03:49 -08:00
David Tolnay
3d15543a91
Merge pull request #410 from dtolnay/testnostd
Add CI step to test with "std" disabled
2025-01-10 10:03:23 -08:00
David Tolnay
1a226ae42c
Disable two more integration tests in no-std mode 2025-01-10 10:00:21 -08:00
David Tolnay
8b5f2d78f0
Fix unused import in test when built without std
warning: unused import: `std::path::PathBuf`
     --> tests/test_expr.rs:4:5
      |
    4 | use std::path::PathBuf;
      |     ^^^^^^^^^^^^^^^^^^
      |
      = note: `#[warn(unused_imports)]` on by default
2025-01-10 09:56:35 -08:00
David Tolnay
eecd247cdf
Add CI step to test with "std" disabled 2025-01-10 09:55:47 -08:00
David Tolnay
8f2a76b4ba
Merge pull request #409 from Maytha8/std-tests
Add feature gate to tests that use std
2025-01-10 05:30:24 -08:00
Maytham Alsudany
693a6cddad
Add feature gate to tests that use std 2025-01-10 18:43:36 +08:00
David Tolnay
349f6960ff
Release 2.0.10 2025-01-08 11:46:25 -08:00
David Tolnay
6cd87bc228
Merge pull request #408 from dtolnay/assoctype
Generate trait bounds on associated types
2025-01-08 11:45:42 -08:00
David Tolnay
6b3e1e50b2
Generate trait bounds on associated types 2025-01-08 11:43:29 -08:00
David Tolnay
136859154b
Add regression test for issue 405
error[E0599]: the method `as_display` exists for reference `&<T as FromStr>::Err`, but its trait bounds were not satisfied
       --> tests/test_generics.rs:178:13
        |
    178 |     #[error("couldn't parse entry: {0}")]
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&<T as FromStr>::Err` due to unsatisfied trait bounds
        |
        = note: the following trait bounds were not satisfied:
                `<T as FromStr>::Err: std::fmt::Display`
                which is required by `&<T as FromStr>::Err: AsDisplay<'_>`
2025-01-08 11:43:18 -08:00
David Tolnay
c535cecb6f
Release 2.0.9 2024-12-21 10:26:04 -08:00
David Tolnay
0a0516db73
Merge pull request #404 from dtolnay/fromfn
Unspan From impl contents
2024-12-21 10:25:40 -08:00
David Tolnay
e5169bb127
Unspan From impl contents 2024-12-21 10:22:33 -08:00
David Tolnay
c008375268
FIx typo in ui test 2024-12-21 10:20:21 -08:00
David Tolnay
2bd29821f4
Release 2.0.8 2024-12-17 19:18:03 -08:00
David Tolnay
a7de3ab22d
Merge pull request #399 from dtolnay/respan
Fix spans on macro-generated bindings and format variables
2024-12-17 19:17:30 -08:00
David Tolnay
f1243a0ceb
Fix spans on macro-generated bindings and format variables 2024-12-17 19:14:10 -08:00
David Tolnay
6a07345135
Add regression test for issue 398
error[E0425]: cannot find value `_0` in this scope
       --> tests/test_display.rs:308:17
        |
    308 |         #[error("{0}")]
        |                 ^^^^^ not found in this scope

    error[E0425]: cannot find value `__display_x` in this scope
       --> tests/test_display.rs:310:17
        |
    310 |         #[error("{x}")]
        |                 ^^^^^ not found in this scope
2024-12-17 19:14:03 -08:00
David Tolnay
9c0f2d230d
Release 2.0.7 2024-12-13 14:42:57 -08:00
David Tolnay
2deec96fc0
Merge pull request 397 from zertosh/from_allow_expect 2024-12-13 14:40:50 -08:00
Andres Suarez
100d9164f2 Avoid associating #[from] with lint allow 2024-12-13 14:06:02 -08:00
David Tolnay
485c2b7eed
Reword spurious errors comment 2024-12-08 11:28:58 -08:00
David Tolnay
2075e87257
Release 2.0.6 2024-12-08 10:39:40 -08:00
David Tolnay
e9a9085150
Merge pull request #396 from dtolnay/deprecatedfrom
Suppress deprecation warning on generated From impls
2024-12-08 10:39:10 -08:00
David Tolnay
6e8c7244c9
Suppress deprecation warning on generated From impls 2024-12-08 10:37:43 -08:00
David Tolnay
caf585c978
Add test of deprecated type in From impl
error: use of deprecated struct `test_deprecated::DeprecatedStruct`
      --> tests/test_lints.rs:73:13
       |
    73 |             DeprecatedStruct,
       |             ^^^^^^^^^^^^^^^^
       |
    note: the lint level is defined here
      --> tests/test_lints.rs:39:13
       |
    39 |     #![deny(deprecated)]
       |             ^^^^^^^^^^
2024-12-08 10:36:57 -08:00
David Tolnay
f1f159d7e7
Release 2.0.5 2024-12-07 09:04:57 -08:00
David Tolnay
366a7b253e
Merge pull request #395 from dtolnay/fallback
Move fallback expansion to separate module
2024-12-07 09:04:39 -08:00
David Tolnay
88a46035e1
Move fallback expansion to separate module 2024-12-07 09:03:07 -08:00
David Tolnay
6712f8cca6
Merge pull request #394 from dtolnay/deprecated
Prevent deprecation warning on generated impl for deprecated type
2024-12-07 09:00:30 -08:00
David Tolnay
07e7d990fa
Add "in this derive macro expansion" to missing Display errors 2024-12-07 08:58:16 -08:00
David Tolnay
714229d821
Work around deprecation warning on generated impl for deprecated type 2024-12-07 08:58:16 -08:00
David Tolnay
0ba7d01e8e
Add tests of deprecated error types
error: use of deprecated struct `test_deprecated::DeprecatedStruct`
      --> tests/test_lints.rs:44:16
       |
    44 |     pub struct DeprecatedStruct;
       |                ^^^^^^^^^^^^^^^^
       |
    note: the lint level is defined here
      --> tests/test_lints.rs:39:13
       |
    39 |     #![deny(deprecated)]
       |             ^^^^^^^^^^

    error: use of deprecated struct `test_deprecated::DeprecatedStruct`
      --> tests/test_lints.rs:44:16
       |
    44 |     pub struct DeprecatedStruct;
       |                ^^^^^^^^^^^^^^^^

    error: use of deprecated enum `test_deprecated::DeprecatedEnum`
      --> tests/test_lints.rs:55:14
       |
    55 |     pub enum DeprecatedEnum {
       |              ^^^^^^^^^^^^^^
2024-12-07 08:58:12 -08:00
David Tolnay
42b1460612
Standardize on 'Error, Debug' derive order 2024-12-07 08:48:24 -08:00
David Tolnay
2096b11bed
Fold test_deprecated into test_lints 2024-12-07 08:46:34 -08:00
David Tolnay
70a12613ef
Release 2.0.4 2024-12-03 07:06:42 -08:00
David Tolnay
4fde2846c8
Merge pull request #391 from matt-phylum/needless-lifetimes
suppress needless_lifetimes lints from clippy 0.1.83
2024-12-03 07:05:54 -08:00
Matthew Donoughe
aa19b7cfce
suppress needless_lifetimes lints from clippy 0.1.83 2024-12-03 08:40:10 -05:00
David Tolnay
ad2f20b9f7
Use ui test syntax that does not interfere with rustfmt 2024-11-10 23:51:28 -08:00
David Tolnay
15fd26e476
Release 2.0.3 2024-11-10 13:17:27 -08:00
David Tolnay
7046023130
Simplify how has_bonus_display is accumulated 2024-11-10 13:15:46 -08:00