Skip to content

Commit

Permalink
Merge pull request #1 from dtolnay/master
Browse files Browse the repository at this point in the history
update with upstream
  • Loading branch information
onlycs committed Apr 10, 2024
2 parents 7d8dae2 + 508ece8 commit 96702c7
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Expand Up @@ -101,5 +101,6 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exit-code 1
4 changes: 2 additions & 2 deletions Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "thiserror"
version = "1.0.57"
version = "1.0.58"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["rust-patterns"]
description = "derive(Error)"
Expand All @@ -12,7 +12,7 @@ repository = "https://github.com/dtolnay/thiserror"
rust-version = "1.56"

[dependencies]
thiserror-impl = { version = "=1.0.57", path = "impl" }
thiserror-impl = { version = "=1.0.58", path = "impl" }

[dev-dependencies]
anyhow = "1.0.73"
Expand Down
20 changes: 11 additions & 9 deletions build.rs
@@ -1,5 +1,6 @@
use std::env;
use std::ffi::OsString;
use std::iter;
use std::path::Path;
use std::process::{self, Command, Stdio};

Expand Down Expand Up @@ -66,15 +67,15 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
let out_dir = cargo_env_var("OUT_DIR");
let probefile = Path::new("build").join("probe.rs");

// Make sure to pick up Cargo rustc configuration.
let mut cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") {
let mut cmd = Command::new(wrapper);
// The wrapper's first argument is supposed to be the path to rustc.
cmd.arg(rustc);
cmd
} else {
Command::new(rustc)
};
let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty());
let rustc_workspace_wrapper =
env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty());
let mut rustc = rustc_wrapper
.into_iter()
.chain(rustc_workspace_wrapper)
.chain(iter::once(rustc));
let mut cmd = Command::new(rustc.next().unwrap());
cmd.args(rustc);

if !rustc_bootstrap {
cmd.env_remove("RUSTC_BOOTSTRAP");
Expand All @@ -84,6 +85,7 @@ fn compile_probe(rustc_bootstrap: bool) -> bool {
.arg("--edition=2018")
.arg("--crate-name=thiserror")
.arg("--crate-type=lib")
.arg("--cap-lints=allow")
.arg("--emit=dep-info,metadata")
.arg("--out-dir")
.arg(out_dir)
Expand Down
2 changes: 1 addition & 1 deletion impl/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "thiserror-impl"
version = "1.0.57"
version = "1.0.58"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Implementation detail of the `thiserror` crate"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion impl/src/ast.rs
Expand Up @@ -82,7 +82,7 @@ impl<'a> Enum<'a> {
.map(|node| {
let mut variant = Variant::from_syn(node, &scope, span)?;
if let display @ None = &mut variant.attrs.display {
*display = attrs.display.clone();
display.clone_from(&attrs.display);
}
if let Some(display) = &mut variant.attrs.display {
display.expand_shorthand(&variant.fields);
Expand Down
4 changes: 2 additions & 2 deletions impl/src/expand.rs
Expand Up @@ -173,7 +173,7 @@ fn impl_struct(input: Struct) -> TokenStream {
::core::fmt::Display::fmt(&self.#only_field, __formatter)
})
} else if let Some(display) = &input.attrs.display {
display_implied_bounds = display.implied_bounds.clone();
display_implied_bounds.clone_from(&display.implied_bounds);
let use_as_display = use_as_display(display.has_bonus_display);
let pat = fields_pat(&input.fields);
Some(quote! {
Expand Down Expand Up @@ -434,7 +434,7 @@ fn impl_enum(input: Enum) -> TokenStream {
let mut display_implied_bounds = Set::new();
let display = match &variant.attrs.display {
Some(display) => {
display_implied_bounds = display.implied_bounds.clone();
display_implied_bounds.clone_from(&display.implied_bounds);
display.to_token_stream()
}
None => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -228,7 +228,7 @@
//!
//! [`anyhow`]: https://github.com/dtolnay/anyhow

#![doc(html_root_url = "https://docs.rs/thiserror/1.0.57")]
#![doc(html_root_url = "https://docs.rs/thiserror/1.0.58")]
#![allow(
clippy::module_name_repetitions,
clippy::needless_lifetimes,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_lints.rs
@@ -1,3 +1,5 @@
#![allow(clippy::mixed_attributes_style)]

use thiserror::Error;

pub use std::error::Error;
Expand Down

0 comments on commit 96702c7

Please sign in to comment.