Update Rust crate thiserror to v2 (#9006)

This commit is contained in:
renovate[bot] 2024-11-15 09:54:16 -06:00 committed by GitHub
parent 21d570fac9
commit 312ae12650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 78 additions and 58 deletions

114
Cargo.lock generated
View file

@ -200,7 +200,7 @@ dependencies = [
"memmap2 0.9.5", "memmap2 0.9.5",
"reqwest", "reqwest",
"reqwest-middleware", "reqwest-middleware",
"thiserror", "thiserror 1.0.67",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"tokio-util", "tokio-util",
@ -216,7 +216,7 @@ dependencies = [
"crc32fast", "crc32fast",
"futures-lite", "futures-lite",
"pin-project", "pin-project",
"thiserror", "thiserror 1.0.67",
"tokio", "tokio",
"tokio-util", "tokio-util",
] ]
@ -247,7 +247,7 @@ dependencies = [
"reqwest", "reqwest",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror 1.0.67",
"url", "url",
"walkdir", "walkdir",
] ]
@ -259,7 +259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4de46920588aef95658797996130bacd542436aee090084646521260a74bda7d" checksum = "4de46920588aef95658797996130bacd542436aee090084646521260a74bda7d"
dependencies = [ dependencies = [
"miette", "miette",
"thiserror", "thiserror 1.0.67",
"tracing", "tracing",
] ]
@ -271,7 +271,7 @@ checksum = "d888fac0b73e64cbdf36a743fc5a25af5ae955c357535cb420b389bf1e1a6c54"
dependencies = [ dependencies = [
"miette", "miette",
"semver", "semver",
"thiserror", "thiserror 1.0.67",
] ]
[[package]] [[package]]
@ -289,7 +289,7 @@ dependencies = [
"self-replace", "self-replace",
"serde", "serde",
"tempfile", "tempfile",
"thiserror", "thiserror 1.0.67",
"tokio", "tokio",
"url", "url",
] ]
@ -2116,7 +2116,7 @@ dependencies = [
"supports-unicode", "supports-unicode",
"terminal_size 0.3.0", "terminal_size 0.3.0",
"textwrap", "textwrap",
"thiserror", "thiserror 1.0.67",
"unicode-width", "unicode-width",
] ]
@ -2417,7 +2417,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442"
dependencies = [ dependencies = [
"memchr", "memchr",
"thiserror", "thiserror 1.0.67",
"ucd-trie", "ucd-trie",
] ]
@ -2680,7 +2680,7 @@ dependencies = [
"log", "log",
"priority-queue", "priority-queue",
"rustc-hash", "rustc-hash",
"thiserror", "thiserror 1.0.67",
"version-ranges", "version-ranges",
] ]
@ -2697,7 +2697,7 @@ dependencies = [
"rustc-hash", "rustc-hash",
"rustls", "rustls",
"socket2", "socket2",
"thiserror", "thiserror 1.0.67",
"tokio", "tokio",
"tracing", "tracing",
] ]
@ -2714,7 +2714,7 @@ dependencies = [
"rustc-hash", "rustc-hash",
"rustls", "rustls",
"slab", "slab",
"thiserror", "thiserror 1.0.67",
"tinyvec", "tinyvec",
"tracing", "tracing",
] ]
@ -2848,7 +2848,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
dependencies = [ dependencies = [
"getrandom", "getrandom",
"libredox", "libredox",
"thiserror", "thiserror 1.0.67",
] ]
[[package]] [[package]]
@ -2976,7 +2976,7 @@ dependencies = [
"http", "http",
"reqwest", "reqwest",
"serde", "serde",
"thiserror", "thiserror 1.0.67",
"tower-service", "tower-service",
] ]
@ -2996,7 +2996,7 @@ dependencies = [
"reqwest", "reqwest",
"reqwest-middleware", "reqwest-middleware",
"retry-policies", "retry-policies",
"thiserror", "thiserror 1.0.67",
"tokio", "tokio",
"tracing", "tracing",
"wasm-timer", "wasm-timer",
@ -3141,7 +3141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e98097f62769f92dbf95fb51f71c0a68ec18a4ee2e70e0d3e4f47ac005d63e9" checksum = "7e98097f62769f92dbf95fb51f71c0a68ec18a4ee2e70e0d3e4f47ac005d63e9"
dependencies = [ dependencies = [
"shellexpand", "shellexpand",
"thiserror", "thiserror 1.0.67",
] ]
[[package]] [[package]]
@ -3832,7 +3832,16 @@ version = "1.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd" checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl 1.0.67",
]
[[package]]
name = "thiserror"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa"
dependencies = [
"thiserror-impl 2.0.3",
] ]
[[package]] [[package]]
@ -3846,6 +3855,17 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "thiserror-impl"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "thread_local" name = "thread_local"
version = "1.1.8" version = "1.1.8"
@ -3989,7 +4009,7 @@ checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f"
dependencies = [ dependencies = [
"either", "either",
"futures-util", "futures-util",
"thiserror", "thiserror 1.0.67",
"tokio", "tokio",
] ]
@ -4410,7 +4430,7 @@ dependencies = [
"tar", "tar",
"tempfile", "tempfile",
"textwrap", "textwrap",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"toml", "toml",
"tracing", "tracing",
@ -4532,7 +4552,7 @@ dependencies = [
"spdx", "spdx",
"tar", "tar",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"tracing", "tracing",
"uv-distribution-filename", "uv-distribution-filename",
@ -4564,7 +4584,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"toml_edit", "toml_edit",
"tracing", "tracing",
@ -4613,7 +4633,7 @@ dependencies = [
"globwalk", "globwalk",
"schemars", "schemars",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"tracing", "tracing",
] ]
@ -4681,7 +4701,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sys-info", "sys-info",
"thiserror", "thiserror 2.0.3",
"tl", "tl",
"tokio", "tokio",
"tokio-util", "tokio-util",
@ -4719,7 +4739,7 @@ dependencies = [
"serde", "serde",
"serde-untagged", "serde-untagged",
"serde_json", "serde_json",
"thiserror", "thiserror 2.0.3",
"tracing", "tracing",
"url", "url",
"uv-auth", "uv-auth",
@ -4833,7 +4853,7 @@ dependencies = [
"rustc-hash", "rustc-hash",
"serde", "serde",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@ -4868,7 +4888,7 @@ dependencies = [
"insta", "insta",
"rkyv", "rkyv",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
"url", "url",
"uv-normalize", "uv-normalize",
"uv-pep440", "uv-pep440",
@ -4890,7 +4910,7 @@ dependencies = [
"schemars", "schemars",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror 2.0.3",
"tracing", "tracing",
"url", "url",
"urlencoding", "urlencoding",
@ -4921,7 +4941,7 @@ dependencies = [
"reqwest", "reqwest",
"rustc-hash", "rustc-hash",
"sha2", "sha2",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@ -4965,7 +4985,7 @@ dependencies = [
"reqwest", "reqwest",
"reqwest-middleware", "reqwest-middleware",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tracing", "tracing",
"url", "url",
@ -4986,7 +5006,7 @@ dependencies = [
"regex", "regex",
"regex-automata 0.4.8", "regex-automata 0.4.8",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"tracing", "tracing",
"walkdir", "walkdir",
] ]
@ -5016,7 +5036,7 @@ dependencies = [
"serde_json", "serde_json",
"sha2", "sha2",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"tracing", "tracing",
"uv-cache-info", "uv-cache-info",
"uv-distribution-filename", "uv-distribution-filename",
@ -5044,7 +5064,7 @@ dependencies = [
"rustc-hash", "rustc-hash",
"same-file", "same-file",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tracing", "tracing",
"url", "url",
@ -5085,7 +5105,7 @@ dependencies = [
"async_zip", "async_zip",
"fs-err", "fs-err",
"futures", "futures",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
"uv-distribution-filename", "uv-distribution-filename",
@ -5146,7 +5166,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"smallvec", "smallvec",
"thiserror", "thiserror 2.0.3",
"tracing", "tracing",
"tracing-test", "tracing-test",
"unicode-width", "unicode-width",
@ -5180,7 +5200,7 @@ dependencies = [
"insta", "insta",
"rustc-hash", "rustc-hash",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
] ]
[[package]] [[package]]
@ -5201,7 +5221,7 @@ dependencies = [
"rustc-hash", "rustc-hash",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@ -5234,7 +5254,7 @@ dependencies = [
"schemars", "schemars",
"serde", "serde",
"serde-untagged", "serde-untagged",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"toml_edit", "toml_edit",
"tracing", "tracing",
@ -5274,7 +5294,7 @@ dependencies = [
"temp-env", "temp-env",
"tempfile", "tempfile",
"test-log", "test-log",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tracing", "tracing",
@ -5313,7 +5333,7 @@ dependencies = [
"futures", "futures",
"rustc-hash", "rustc-hash",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"tracing", "tracing",
"url", "url",
@ -5351,7 +5371,7 @@ dependencies = [
"reqwest-middleware", "reqwest-middleware",
"tempfile", "tempfile",
"test-case", "test-case",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tracing", "tracing",
"unscanny", "unscanny",
@ -5389,7 +5409,7 @@ dependencies = [
"schemars", "schemars",
"serde", "serde",
"textwrap", "textwrap",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"toml", "toml",
@ -5427,7 +5447,7 @@ dependencies = [
"indoc", "indoc",
"memchr", "memchr",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"uv-distribution-types", "uv-distribution-types",
"uv-pep440", "uv-pep440",
@ -5449,7 +5469,7 @@ dependencies = [
"schemars", "schemars",
"serde", "serde",
"textwrap", "textwrap",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"tracing", "tracing",
"url", "url",
@ -5505,7 +5525,7 @@ dependencies = [
"fs-err", "fs-err",
"pathdiff", "pathdiff",
"serde", "serde",
"thiserror", "thiserror 2.0.3",
"toml", "toml",
"toml_edit", "toml_edit",
"tracing", "tracing",
@ -5532,7 +5552,7 @@ dependencies = [
"assert_cmd", "assert_cmd",
"assert_fs", "assert_fs",
"fs-err", "fs-err",
"thiserror", "thiserror 2.0.3",
"uv-fs", "uv-fs",
"which", "which",
"zip", "zip",
@ -5544,7 +5564,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"rustc-hash", "rustc-hash",
"thiserror", "thiserror 2.0.3",
"url", "url",
"uv-cache", "uv-cache",
"uv-configuration", "uv-configuration",
@ -5569,7 +5589,7 @@ dependencies = [
"fs-err", "fs-err",
"itertools 0.13.0", "itertools 0.13.0",
"pathdiff", "pathdiff",
"thiserror", "thiserror 2.0.3",
"tracing", "tracing",
"uv-fs", "uv-fs",
"uv-platform-tags", "uv-platform-tags",
@ -5605,7 +5625,7 @@ dependencies = [
"schemars", "schemars",
"serde", "serde",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.3",
"tokio", "tokio",
"toml", "toml",
"toml_edit", "toml_edit",

View file

@ -160,7 +160,7 @@ tar = { version = "0.4.43" }
target-lexicon = { version = "0.12.16" } target-lexicon = { version = "0.12.16" }
tempfile = { version = "3.12.0" } tempfile = { version = "3.12.0" }
textwrap = { version = "0.16.1" } textwrap = { version = "0.16.1" }
thiserror = { version = "1.0.63" } thiserror = { version = "2.0.0" }
tl = { git = "https://github.com/astral-sh/tl.git", rev = "6e25b2ee2513d75385101a8ff9f591ef51f314ec" } tl = { git = "https://github.com/astral-sh/tl.git", rev = "6e25b2ee2513d75385101a8ff9f591ef51f314ec" }
tokio = { version = "1.40.0", features = ["fs", "io-util", "macros", "process", "rt", "signal", "sync"] } tokio = { version = "1.40.0", features = ["fs", "io-util", "macros", "process", "rt", "signal", "sync"] }
tokio-stream = { version = "0.1.16" } tokio-stream = { version = "0.1.16" }

View file

@ -56,7 +56,7 @@ pub enum Error {
}, },
#[error("Failed to walk source tree")] #[error("Failed to walk source tree")]
StripPrefix(#[from] StripPrefixError), StripPrefix(#[from] StripPrefixError),
#[error("Unsupported file type {1:?}: `{}`", _0.user_display())] #[error("Unsupported file type {:?}: `{}`", _1, _0.user_display())]
UnsupportedFileType(PathBuf, FileType), UnsupportedFileType(PathBuf, FileType),
#[error("Failed to write wheel zip archive")] #[error("Failed to write wheel zip archive")]
Zip(#[from] zip::result::ZipError), Zip(#[from] zip::result::ZipError),

View file

@ -92,7 +92,7 @@ pub enum Error {
MetadataLowering(#[from] MetadataError), MetadataLowering(#[from] MetadataError),
#[error("Distribution not found at: {0}")] #[error("Distribution not found at: {0}")]
NotFound(Url), NotFound(Url),
#[error("Attempted to re-extract the source distribution for `{0}`, but the {1} hash didn't match. Run `{}` to clear the cache.", "uv cache clean".green())] #[error("Attempted to re-extract the source distribution for `{}`, but the {} hash didn't match. Run `{}` to clear the cache.", _0, _1, "uv cache clean".green())]
CacheHeal(String, HashAlgorithm), CacheHeal(String, HashAlgorithm),
#[error("The source distribution requires Python {0}, but {1} is installed")] #[error("The source distribution requires Python {0}, but {1} is installed")]
RequiresPython(VersionSpecifiers, Version), RequiresPython(VersionSpecifiers, Version),

View file

@ -207,7 +207,7 @@ pub enum Error {
Io(#[from] io::Error), Io(#[from] io::Error),
/// An error was encountering when retrieving interpreter information. /// An error was encountering when retrieving interpreter information.
#[error("Failed to inspect Python interpreter from {2} at `{}` ", .1.user_display())] #[error("Failed to inspect Python interpreter from {} at `{}` ", _2, _1.user_display())]
Query( Query(
#[source] Box<crate::interpreter::Error>, #[source] Box<crate::interpreter::Error>,
PathBuf, PathBuf,

View file

@ -294,7 +294,7 @@ pub enum Error {
#[error("Failed to parse: `{}`", _0.user_display())] #[error("Failed to parse: `{}`", _0.user_display())]
UvToml(PathBuf, #[source] Box<toml::de::Error>), UvToml(PathBuf, #[source] Box<toml::de::Error>),
#[error("Failed to parse: `{}`. The `{1}` field is not allowed in a `uv.toml` file. `{1}` is only applicable in the context of a project, and should be placed in a `pyproject.toml` file instead.", _0.user_display())] #[error("Failed to parse: `{}`. The `{}` field is not allowed in a `uv.toml` file. `{}` is only applicable in the context of a project, and should be placed in a `pyproject.toml` file instead.", _0.user_display(), _1, _1)]
PyprojectOnlyField(PathBuf, &'static str), PyprojectOnlyField(PathBuf, &'static str),
} }

View file

@ -429,18 +429,18 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.67" version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd" checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.67" version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b607164372e89797d78b8e23a6d67d5d1038c1c65efd52e1389ef8b77caba2a6" checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",

View file

@ -57,6 +57,6 @@ anyhow = { version = "1.0.80" }
assert_cmd = { version = "2.0.14" } assert_cmd = { version = "2.0.14" }
assert_fs = { version = "1.1.1" } assert_fs = { version = "1.1.1" }
fs-err = { version = "2.11.0" } fs-err = { version = "2.11.0" }
thiserror = { version = "1.0.56" } thiserror = { version = "2.0.0" }
which = { version = "7.0.0" } which = { version = "7.0.0" }
zip = { version = "0.6.6", default-features = false, features = ["deflate"] } zip = { version = "0.6.6", default-features = false, features = ["deflate"] }

View file

@ -26,7 +26,7 @@ pub enum WorkspaceError {
// Workspace structure errors. // Workspace structure errors.
#[error("No `pyproject.toml` found in current directory or any parent directory")] #[error("No `pyproject.toml` found in current directory or any parent directory")]
MissingPyprojectToml, MissingPyprojectToml,
#[error("Workspace member `{}` is missing a `pyproject.toml` (matches: `{1}`)", _0.simplified_display())] #[error("Workspace member `{}` is missing a `pyproject.toml` (matches: `{}`)", _0.simplified_display(), _1)]
MissingPyprojectTomlMember(PathBuf, String), MissingPyprojectTomlMember(PathBuf, String),
#[error("No `project` table found in: `{}`", _0.simplified_display())] #[error("No `project` table found in: `{}`", _0.simplified_display())]
MissingProject(PathBuf), MissingProject(PathBuf),