Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update rust crate anyhow to 1.0.82 - autoclosed #75

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented May 3, 2024

Mend Renovate

This PR contains the following updates:

Package Type Update Change
anyhow dev-dependencies patch 1.0 -> 1.0.82
anyhow dependencies patch 1.0 -> 1.0.82

Release Notes

dtolnay/anyhow (anyhow)

v1.0.82

Compare Source

  • Documentation improvements

v1.0.81

Compare Source

  • Make backtrace support available when using -Dwarnings (#​354)

v1.0.80

Compare Source

  • Fix unused_imports warnings when compiled by rustc 1.78

v1.0.79

Compare Source

  • Work around improperly cached build script result by sccache (#​340)

v1.0.78

Compare Source

  • Reduce spurious rebuilds under RustRover IDE when using a nightly toolchain (#​337)

v1.0.77

Compare Source

v1.0.76

Compare Source

  • Opt in to unsafe_op_in_unsafe_fn lint (#​329)

v1.0.75

Compare Source

v1.0.74

Compare Source

v1.0.73

Compare Source

v1.0.72

Compare Source

  • Documentation improvements

v1.0.71

Compare Source

  • Documentation improvements

v1.0.70

Compare Source

  • Update syn dependency to 2.x

v1.0.69

Compare Source

  • Documentation improvements

v1.0.68

Compare Source

  • Opt out of -Zrustdoc-scrape-examples on docs.rs for now

v1.0.67

Compare Source

  • Improve the backtrace captured when context() is used on an Option (#​280)

v1.0.66

Compare Source

  • Reduce unhelpful backtrace frames in backtraces captured during a context call (#​279)

v1.0.65

Compare Source

v1.0.64

Compare Source

  • Correctly propagate Backtrace when using #[source] anyhow::Error with thiserror crate (#​231)

v1.0.63

Compare Source

v1.0.62

Compare Source

  • Fix extra rebuilding when interleaving command-line cargo invocations with IDE builds (#​261)

v1.0.61

Compare Source

  • Work around rust-analyzer builds poisoning all subsequent command-line cargo builds (#​252)

v1.0.60

Compare Source

  • Propagate --target to rustc invocation when deciding about backtrace support (#​249, thanks @​RalfJung)

v1.0.59

Compare Source

  • Update crates.io metadata to include no-std category

v1.0.58

Compare Source

  • Fix some broken links in documentation

v1.0.57

Compare Source

  • Remove a log4rs-specific workaround from bail! macro implementation

v1.0.56

Compare Source

  • Add must_use warning when an Error created by anyhow! is not used, perhaps because the programmer meant to write bail! instead (#​229)

v1.0.55

Compare Source

  • Documentation improvements

v1.0.54

Compare Source

  • Construct more helpful error message from ensure! when the expression involves a negative literal const generic as the first generic argument of a method call (#​224)

v1.0.53

Compare Source

v1.0.52

Compare Source

  • Reduce overhead of backtrace capture in the case that backtraces are not enabled (#​212)

v1.0.51

Compare Source

  • Show doc for Ok fn

v1.0.50

Compare Source

v1.0.49

Compare Source

  • Add a function anyhow::Ok(v) equivalent to Ok::<_, anyhow::Error>(v) (#​192)

v1.0.48

Compare Source

Example:
```rust
ensure!(flags.len() <= 40);
```

```rust
ensure!(kind == Kind::File);
```

Before:

```console
Condition failed: `flags.len() <= 40`
Condition failed: `kind == Kind::File`
```

After:

```console
Condition failed: `flags.len() <= 40` (99 vs 40)
Condition failed: `kind == Kind::File` (Symlink vs File)
```

v1.0.47

Compare Source

  • Fixes for implicit format args support

v1.0.46

Compare Source

  • Support for implicit format args to match println and other std macros (https://rust-lang.github.io/rfcs/2795-format-args-implicit-identifiers.html)

    let var = ...;
    let error = anyhow!("interpolate {var}");  // equivalent to anyhow!("interpolate {var}", var=var)
  • Detect missing fmt arguments at compile time: anyhow!("{} not found") (#​55)

  • Reduce occurrence of "future cannot be shared between threads safely" in async code using anyhow macros (#​186)

v1.0.45

Compare Source

  • Fix non-compilable macro expansion if downstream crate calls anyhow!, ensure!, or bail! with format args and is built with #![no_std] or #![no_implicit_prelude] (#​177)

v1.0.44

Compare Source

  • Mark error constructors cold to help LLVM optimize code paths not leading to error (#​166, thanks @​stepancheg)

v1.0.43

Compare Source

  • Take -Zallow-features restrictions from Cargo configuration file into account on sufficiently new versions of nightly Cargo (#​157, thanks @​jonhoo)

v1.0.42

Compare Source

  • Enable Android's automated tooling to pull in test coverage improvements

v1.0.41

Compare Source

v1.0.40

Compare Source

  • Reduce memory footprint of errors on Rust versions 1.51+ (#​145)

v1.0.39

Compare Source

  • Add an opt-in implementation of Error::backtrace on stable compilers based on the backtrace crate (#​143)

    [dependencies]
    anyhow = { version = "1.0", features = ["backtrace"] }

v1.0.38

Compare Source

v1.0.37

Compare Source

  • Improve compiler diagnostic on calling macro with a temporary value (#​133)

v1.0.36

Compare Source

  • Make anyhow::Error ABI compatible with void* for round tripping through a C FFI (#​132)

v1.0.35

Compare Source

  • Support 1-argument use of ensure! (#​126)

    ensure!(depth <= MAX_DEPTH);
    // error msg on a false condition would be "Condition failed: `depth <= MAX_DEPTH`"

v1.0.34

Compare Source

v1.0.33

Compare Source

  • Clarify documentation of anyhow!, bail!, ensure! macros (#​114)

v1.0.32

Compare Source

  • Add impl From<anyhow::Error> for Box<dyn Error + Send + 'static> (#​103)

v1.0.31

Compare Source

  • Restore "Stack backtrace" header label above the backtrace in {:?} representation (#​92)

v1.0.30

Compare Source

  • Hide an error message that appears when building with cargo rustc -vv (#​91, thanks @​eoger)

v1.0.29

Compare Source

  • Documentation improvements

v1.0.28

Compare Source

v1.0.27

Compare Source

  • Improve documentation of backtrace environment variable combinations (#​69)

    • If you want panics and errors to both have backtraces, set RUST_BACKTRACE=1;
    • If you want only errors to have backtraces, set RUST_LIB_BACKTRACE=1;
    • If you want only panics to have backtraces, set RUST_BACKTRACE=1 and RUST_LIB_BACKTRACE=0.

v1.0.26

Compare Source

  • Fix indentation when printing causes that have a multiline error message (#​54, thanks @​yaahc)

v1.0.25

Compare Source

  • Add no-std support (#​53)

    In no_std mode, the same API is almost all available and works the same way. To depend on Anyhow in no_std mode, disable our default enabled "std" feature in Cargo.toml. A global allocator is required.

    [dependencies]
    anyhow = { version = "1.0", default-features = false }

    Since the ?-based error conversions would normally rely on the std::error::Error trait which is only available through std, no_std mode will require an explicit .map_err(Error::msg) when working with a non-Anyhow error type inside a function that returns Anyhow's error type.

v1.0.24

Compare Source

  • Preserve cause chain when converting from Box<dyn StdError + Send + Sync> to anyhow::Error (#​50)
  • Work around bug in NixOS package infrastructure (#​49)

v1.0.23

Compare Source

  • Add impl AsRef<dyn std::error::Error> and impl AsRef<dyn std::error::Error + Send + Sync> for anyhow::Error
  • Add Chain::new constructor

v1.0.22

Compare Source

  • Preserve cause chain when bail! or ensure! is invoked with anyhow::Error as the error argument (#​46)

v1.0.21

Compare Source

  • Provide DoubleEndedIterator and ExactSizeIterator implementations for anyhow::Chain to assist in custom rendering of cause chains (#​45)

    let chain = err.chain();
    if chain.len() > 1 {
        eprint!("[[root cause]] ");
    }
    for err in chain.rev() {
        eprintln!("{}", err);
    }

v1.0.20

Compare Source

  • Introduce some {:#} and {:#?} alt formatting representations (#​42)

    When you print an error object using "{}" or to_string(), only the outermost underlying error or context is printed, not any of the lower level causes. This is exactly as if you had called the Display impl of the error from which you constructed your anyhow::Error.

    Failed to read instrs from ./path/to/instrs.json

    To print causes as well using anyhow's default formatting of causes, use the alternate selector "{:#}".

    Failed to read instrs from ./path/to/instrs.json: No such file or directory (os error 2)

    The Debug format "{:?}" includes your backtrace if one was captured. Note that this is the representation you get by default if you return an error from fn main instead of printing it explicitly yourself.

    Error: Failed to read instrs from ./path/to/instrs.json
    
    Caused by:
        No such file or directory (os error 2)
    
    Stack backtrace:
       0: <E as anyhow::context::ext::StdError>::ext_context
                 at /git/anyhow/src/backtrace.rs:26
       1: core::result::Result<T,E>::map_err
                 at /git/rustc/src/libcore/result.rs:596
       2: anyhow::context::<impl anyhow::Context<T,E> for core::result::Result<T,E>>::with_context
                 at /git/anyhow/src/context.rs:58
       3: testing::main
                 at src/main.rs:5
       4: std::rt::lang_start
                 at /git/rustc/src/libstd/rt.rs:61
       5: main
       6: __libc_start_main
       7: _start

    To see a conventional struct-style Debug representation, use "{:#?}".

    Error {
        context: "Failed to read instrs from ./path/to/instrs.json",
        source: Os {
            code: 2,
            kind: NotFound,
            message: "No such file or directory",
        },
    }

    If none of the built-in representations are appropriate and you would prefer to render the error and its cause chain yourself, it can be done something like this:

    use anyhow::{Context, Result};
    
    fn main() {
        if let Err(err) = try_main() {
            eprintln!("ERROR: {}", err);
            err.chain().skip(1).for_each(|cause| eprintln!("because: {}", cause));
            std::process::exit(1);
        }
    }
    
    fn try_main() -> Result<()> {
        ...
    }

v1.0.19

Compare Source

  • Export anyhow! also under the alias format_err! (#​37)

v1.0.18

Compare Source

  • Support downcasting errors with context to the context's type C or to the underlying error type E (#​34)

    That is, in codebases that rely on downcasting, Anyhow's context now supports both of the following use cases:

    • Attaching context whose type is insignificant onto errors whose type is used in downcasts.

      In other error libraries whose context is not designed this way, it can be risky to introduce context to existing code because new context might break existing working downcasts. In Anyhow, any downcast that worked before adding context will continue to work after you add a context, so you should freely add human-readable context to errors wherever it would be helpful.

      use anyhow::{Context, Result};
      
      fn do_it() -> Result<()> {
          helper().context("failed to complete the work")?;
          ...
      }
      
      fn main() {
          let err = do_it().unwrap_err();
          if let Some(e) = err.downcast_ref::<SuspiciousError>() {
              // If helper() returned SuspiciousError, this downcast will
              // correctly succeed even with the context in between.
          }
      }
    • Attaching context whose type is used in downcasts onto errors whose type is insignificant.

      Some codebases prefer to use machine-readable context to categorize lower level errors in a way that will be actionable to higher levels of the application.

      use anyhow::{Context, Result};
      
      fn do_it() -> Result<()> {
          helper().context(HelperFailed)?;
          ...
      }
      
      fn main() {
          let err = do_it().unwrap_err();
          if let Some(e) = err.downcast_ref::<HelperFailed>() {
              // If helper failed, this downcast will succeed because
              // HelperFailed is the context that has been attached to
              // that error.
          }
      }

v1.0.17

Compare Source

  • Work around poor paths in compiler diagnostic when missing Context import (#​30)

v1.0.16

Compare Source

  • Add impl From<anyhow::Error> for Box<dyn std::error::Error + 'static> (#​25)

v1.0.15

Compare Source

  • Documentation improvements

v1.0.14

Compare Source

  • Replace compiler version detection with probing the Backtrace api to be more resilient to nightly development of backtrace feature (#​24)

v1.0.13

Compare Source

  • Support building with dev toolchains older than 1.40.0-nightly (#​20)

v1.0.12

Compare Source

  • Improve return type inference when calling .context(...) on a Result (#​18)

v1.0.11

Compare Source

v1.0.10

Compare Source

  • Documentation improvements: show example of thiserror's derive(Error)

v1.0.9

Compare Source

  • Seal the Context trait as it is not intended to be implemented outside of anyhow

v1.0.8

Compare Source

  • Preserve the source and backtrace of error expressions passed to anyhow!($expr)

v1.0.7

Compare Source

yanked

v1.0.6

Compare Source

  • Preserve source and backtrace when converting from anyhow::Error to Box<dyn std::error::Error + Send + Sync>

v1.0.5

Compare Source

  • Add impl From<anyhow::Error> for Box<dyn std::error::Error + Send + Sync + 'static> (#​10)

v1.0.4

Compare Source

v1.0.3

Compare Source

  • Allow .context(...) and .with_context(|| ...) on Option<T>

v1.0.2

Compare Source

v1.0.1

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

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


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

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot changed the title chore(deps): update rust crate anyhow to 1.0.82 chore(deps): update rust crate anyhow to 1.0.82 - autoclosed May 5, 2024
@renovate renovate bot closed this May 5, 2024
@renovate renovate bot deleted the renovate/anyhow-1.x branch May 5, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants