Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 10, 2025

This PR contains the following updates:

Package Type Update Change
thiserror dependencies major 1.0.64 -> 2.0.0

Release Notes

dtolnay/thiserror (thiserror)

v2.0.11

Compare Source

v2.0.10

Compare Source

  • Support errors containing a generic type parameter's associated type in a field (#​408)

v2.0.9

Compare Source

  • Work around missing_inline_in_public_items clippy restriction being triggered in macro-generated code (#​404)

v2.0.8

Compare Source

  • Improve support for macro-generated derive(Error) call sites (#​399)

v2.0.7

Compare Source

  • Work around conflict with #[deny(clippy::allow_attributes)] (#​397, thanks @​zertosh)

v2.0.6

Compare Source

  • Suppress deprecation warning on generated From impls (#​396)

v2.0.5

Compare Source

  • Prevent deprecation warning on generated impl for deprecated type (#​394)

v2.0.4

Compare Source

v2.0.3

Compare Source

  • Support the same Path field being repeated in both Debug and Display representation in error message (#​383)
  • Improve error message when a format trait used in error message is not implemented by some field (#​384)

v2.0.2

Compare Source

  • Fix hang on invalid input inside #[error(...)] attribute (#​382)

v2.0.1

Compare Source

  • Support errors that contain a dynamically sized final field (#​375)
  • Improve inference of trait bounds for fields that are interpolated multiple times in an error message (#​377)

v2.0.0

Compare Source

Breaking changes

  • Referencing keyword-named fields by a raw identifier like {r#type} inside a format string is no longer accepted; simply use the unraw name like {type} (#​347)

    This aligns thiserror with the standard library's formatting macros, which gained support for implicit argument capture later than the release of this feature in thiserror 1.x.

    #[derive(Error, Debug)]
    #[error("... {type} ...")]  // Before: {r#type}
    pub struct Error {
        pub r#type: Type,
    }
  • Trait bounds are no longer inferred on fields whose value is shadowed by an explicit named argument in a format message (#​345)

    // Before: impl<T: Octal> Display for Error<T>
    // After: impl<T> Display for Error<T>
    #[derive(Error, Debug)]
    #[error("{thing:o}", thing = "...")]
    pub struct Error<T> {
        thing: T,
    }
  • Tuple structs and tuple variants can no longer use numerical {0} {1} access at the same time as supplying extra positional arguments for a format message, as this makes it ambiguous whether the number refers to a tuple field vs a different positional arg (#​354)

    #[derive(Error, Debug)]
    #[error("ambiguous: {0} {}", $N)]
    //                  ^^^ Not allowed, use #[error("... {0} {n}", n = $N)]
    pub struct TupleError(i32);
  • Code containing invocations of thiserror's derive(Error) must now have a direct dependency on the thiserror crate regardless of the error data structure's contents (#​368, #​369, #​370, #​372)

Features

  • Support disabling thiserror's standard library dependency by disabling the default "std" Cargo feature: thiserror = { version = "2", default-features = false } (#​373)

  • Support using r#source as field name to opt out of a field named "source" being treated as an error's Error::source() (#​350)

    #[derive(Error, Debug)]
    #[error("{source} ==> {destination}")]
    pub struct Error {
        r#source: char,
        destination: char,
    }
    
    let error = Error { source: 'S', destination: 'D' };
  • Infinite recursion in a generated Display impl now produces an unconditional_recursion warning (#​359)

    #[derive(Error, Debug)]
    #[error("??? {self}")]
    pub struct Error;
  • A new attribute #[error(fmt = path::to::myfmt)] can be used to write formatting logic for an enum variant out-of-line (#​367)

    #[derive(Error, Debug)]
    pub enum Error {
        #[error(fmt = demo_fmt)]
        Demo { code: u16, message: Option<String> },
    }
    
    fn demo_fmt(code: &u16, message: &Option<String>, formatter: &mut fmt::Formatter) -> fmt::Result {
        write!(formatter, "{code}")?;
        if let Some(msg) = message {
            write!(formatter, " - {msg}")?;
        }
        Ok(())
    }
  • Enums with an enum-level format message are now able to have individual variants that are transparent to supersede the enum-level message (#​366)

    #[derive(Error, Debug)]
    #[error("my error {0}")]
    pub enum Error {
        Json(#[from] serde_json::Error),
        Yaml(#[from] serde_yaml::Error),
        #[error(transparent)]
        Other(#[from] anyhow::Error),
    }

Configuration

📅 Schedule: Branch creation - "* 0-3 * * 1" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Feb 10, 2025
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 6 times, most recently from 2611d47 to 636fd33 Compare February 10, 2025 14:49
@vlaci
Copy link
Contributor

vlaci commented Feb 10, 2025

Needs a new release from landlock landlock-lsm/rust-landlock@049ef73

@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 10 times, most recently from 19fc3da to 54355fe Compare February 17, 2025 03:57
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 5 times, most recently from fd6f226 to bd488f9 Compare March 2, 2025 13:23
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 4 times, most recently from 52c2025 to af6702f Compare March 10, 2025 01:44
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 3 times, most recently from 1d8c7a2 to 9b46ff5 Compare March 17, 2025 03:24
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 6 times, most recently from 918b025 to 343f731 Compare March 31, 2025 03:28
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 3 times, most recently from a0d5b14 to 866a336 Compare April 7, 2025 08:14
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 8 times, most recently from 11bbd4b to c764b4b Compare April 14, 2025 09:52
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 3 times, most recently from 5cb97d6 to fafd456 Compare April 25, 2025 09:50
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch 2 times, most recently from 636177d to 746450e Compare May 1, 2025 19:32
@renovate renovate bot force-pushed the renovate/thiserror-2.x branch from 746450e to 1a8c949 Compare May 5, 2025 01:46
@qkaiser
Copy link
Contributor

qkaiser commented May 7, 2025

There was a landlock release last week (0.4.2) so we're good now.

@qkaiser qkaiser added this pull request to the merge queue May 7, 2025
Merged via the queue into main with commit 1f751f1 May 7, 2025
27 checks passed
@qkaiser qkaiser deleted the renovate/thiserror-2.x branch May 7, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants