676 Commits

Author SHA1 Message Date
Steffen
f5645b7d20 fix: set workspace resolver version (#283)
After the edition 2024 upgrade the resolver version defaults to version
1, but there is not reason to hold back the resolver version.

Ref: https://github.com/eyre-rs/eyre/pull/279#discussion_r3054290247
2026-04-10 16:26:03 +05:30
Steffen
9905963217 Bump edition to 2024 (#279)
See https://github.com/eyre-rs/eyre/pull/276#issuecomment-4150983402.

Not sure if we should add safety comments to the examples, which now
require an `unsafe` block for setting environment variables.
2026-03-30 08:42:08 +00:00
Nik Revenco
ca8a3af4ff Add default type parameter value of T = () to eyre::Result<T> (#273)
This adds a default type parameter to the `T` value of `eyre::Result`.

```rust
pub type Result<T = (), E = Report> = core::result::Result<T, E>;
```

Because `Result<()>` is so incredibly common, allow users to just write
`-> Result {` instead of `-> Result<()>`

Considering that the default function return type is `()` which you
don't have to specify, I think it's appropriate to do that here, as
well.

This is particularly high-impact for:

- Tests
- the `main` function
- Functions that only do IO, without returning any other value

All use-cases where `eyre` particularly shines.

You can now write:

```rust
#[test]
fn test() -> Result {
```

And:

```rust
fn main() -> Result {
```

There are 2.2 million cases where `Result<()>` is used, and this change
will have quite a lot of impact, as github search shows:
https://github.com/search?q=path%3A*.rs%20%2FResult%3C%5C(%5C)%3E%2F&type=code
2026-03-26 04:27:11 +00:00
Manish Goregaokar
f8e58dc0a7 Remove pyo3 feature (#278)
I don't think `eyre` should be offering integrations with specific
crates' error types. `anyhow` makes sense since it is an error handling
library, but `pyo3` does not: `pyo3` should instead offer that
integration as a feature. This is a common pattern in the ecosystem:
`serde` doesn't depend on other projects.

A reason `pyo3` is particularly problematic is that it has a build
script that checks Python versions: this means `eyre` cannot be built
with `--all-features` (done by a lot of tooling like cargo
semver-checks) on systems without the exact expected Python version.

If we're doing a 1.0, we should remove this feature. We can add it back
if it turns out that pyo3 can't add an eyre dep.
2026-03-23 16:59:44 +00:00
Nik Revenco
4f567cfc51 Rename the WrapErr trait to ResultExt (#270)
Considering eyre plans to do a 1.0 release soon
(https://github.com/eyre-rs/eyre/pull/269), it's a good time to clean up
the API

I think the `WrapErr` trait should be renamed to `ResultExt`

For one, the names of these 2 traits `WrapErr` and `OptionExt` are
inconsistent.

The `WrapErr` trait is only implemented for `Result`. There are no other
types with `.wrap_err` operations. The trait is sealed. It's an
extension trait. As such, I think it's best to rename it to be more
inline with extension trait naming conventions.

It is an [established
convention](26197104b7/text/0445-extension-trait-conventions.md)
of using "Ext" as part of an extension trait name.

Examples in std:

-
[`std::os::unix::fs::FileExt`](https://doc.rust-lang.org/nightly/std/os/unix/fs/trait.FileExt.html)
-
[`std::os::windows::fs::FileExt`](https://doc.rust-lang.org/nightly/std/os/windows/fs/trait.FileExt.html)
-
[`std::ascii::AsciiExt`](https://doc.rust-lang.org/nightly/std/ascii/trait.AsciiExt.html)
-
[`std::os::unix::ffi::OsStrExt`](https://doc.rust-lang.org/nightly/std/os/unix/ffi/trait.OsStrExt.html)
-
[`std::os::windows::ffi::OsStrExt`](https://doc.rust-lang.org/nightly/std/os/windows/ffi/trait.OsStrExt.html)

This actually improves clarity of the documentation. See these docs:

```rust
//! ### `Context` and `Option`
//!
//! As part of renaming `Context` to `ResultExt` we also intentionally do not
//! implement `ResultExt` for `Option`. This decision was made because `wrap_err`
//! implies that you're creating a new error that saves the old error as its
//! `source`. With `Option` there is no source error to wrap, so `wrap_err` ends up
//! being somewhat meaningless.
```

Considering that the trait is now called `ResultExt`, the fact that it
is not implemented for `Option` naturally stems from the fact that it is
called `ResultExt`. So it doesn't warrant a special case to be explained
in the documentation.

We can of course adjust the documentation after this PR.
2026-03-23 13:41:44 +00:00
Jakob Hellermann
40b1560fde switch from once_cell to std::sync::OnceLock (#218)
One less dependency is always nice to have, and
[OnceLock](https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html)
has been stable since 1.70.

---------

Co-authored-by: Pavan K Sunkara <pavan.sss1991@gmail.com>
2026-03-23 13:26:16 +00:00
Pavan K Sunkara
1301e71fb2 Update the MSRV to 1.85 (#276) 2026-03-23 13:10:47 +00:00
Pavan K Sunkara
4146fcaac5 chore: Remove unnecessary cfg due to MSRV increase (#275)
- **chore: Update checkout github action in CI**
- **chore: Remove nightly lints that are not being tested**
- **chore: Remove unnecessary `cfg` due to MSRV increase**

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-23 10:59:47 +00:00
Nik Revenco
7f2e0d5cff Remove format_err! macro (#274)
Considering eyre plans to release 1.0 some time soon
(https://github.com/eyre-rs/eyre/pull/269), it's a good time to clean up
the API

Having 2 macros that do the same thing leads to unnecessary churn in
which name to use.

That's why we should remove the `format_err!` macro.

It will also help prevent choice overload
2026-03-22 18:17:16 +00:00
LeoniePhiline
182e0747b2 chore!: remove alias exports DefaultContext and EyreContext (#181)
`DefaultContext` and `EyreContext` exist as alias exports enabled by the
`anyhow` feature.

However, they are unused within `eyre`; neither are handlers of such
names exposed by `anyhow`.

This changeset removes both above mentioned handler aliases.

Closes [#135][135].

[135]: https://github.com/eyre-rs/eyre/issues/135

BREAKING CHANGE: The alias exports are undocumented but nevertheless
part of the crate's public API.
2026-03-21 23:18:43 +00:00
0xsenty
b9b39c4f4d fix: incorrect type annotation for tuple return value (#221)
Noticed that the type annotation `(LineType, str)` was being used, but
in Python, this is interpreted as a regular tuple, not a proper type
hint. Switched it to `tuple[LineType, str]` for correctness.
2026-03-21 23:09:24 +00:00
LeoniePhiline
ac257b7e33 chore!: remove anyhow from default features (#180)
[#131][131] introduced a new anyhow default feature flag to allow users
to hide aliased exports such as `eyre::Error` and `eyre::Context`.

This changeset removes `anyhow` from the list of default features,
making the compatibility layer with the anyhow crate opt-in.

Implements [#136][136].

[131]: https://github.com/eyre-rs/eyre/issues/131
[136]: https://github.com/eyre-rs/eyre/issues/136

BREAKING CHANGE: Removing a default feature is a breaking change.
2026-03-21 21:04:31 +00:00
Gaëtan Lehmann
52027ec0e3 feat: add column number to error location display in reports and backtraces (#268)
The error reporting system now includes column number information
alongside line numbers in error reports and backtraces. This provides
more precise source location information, allowing developers to
immediately identify the exact column where an error occurred rather
than just the line number. This is especially helpful when multiple
issues exist on the same line.

Updated all theme test data files to match the new output format with
column numbers included.

<img width="1073" height="442" alt="image"
src="https://github.com/user-attachments/assets/6d2599fc-a0d2-4562-b73b-5ad36b7cb624"
/>
2026-03-20 13:49:07 +00:00
Gigabuidl
d225a9b00d chore: update broken link (#220)
## Description

Hi! I fixed a broken link in `eyre/src/error.rs`. The previous link was
missing the file extension, causing it to fail.

Co-authored-by: Pavan K Sunkara <pavan.sss1991@gmail.com>
2026-03-12 18:29:52 +00:00
leopardracer
2e857e04cf fix: typos in documentation files (#210)
This pull request contains changes to improve clarity, correctness and
structure.

**Description correction:**
Corrected `comparision` to `comparison`

Please review the changes and let me know if any additional changes are
needed.
2026-02-25 14:52:36 +00:00
Pavan K Sunkara
a9ca782341 Cleanup CI (#262)
- **Port rest of the tests**
- **Put msrv tests in normal test matrix**
2026-02-24 08:15:44 +00:00
Pavan Kumar Sunkara
d3a0df342c Make sure to run all tests instead of failing fast 2026-02-24 13:25:32 +05:30
Pavan Kumar Sunkara
2e6611e961 Put msrv tests in normal test matrix 2026-02-24 13:25:32 +05:30
Pavan Kumar Sunkara
cdb9677a07 Port rest of the tests 2026-02-24 13:22:19 +05:30
Pavan K Sunkara
ebbb5aa6f2 Add simple-eyre to workspace (#165)
- Used subtree to add `simple-eyre` to this repo
- Add simple-eyre to workspace
- Make Cargo.toml consistent for all crates.
- Fix broken links
2026-02-24 01:28:18 +00:00
Frederik Baetens
d55c826117 Fix broken links 2026-02-24 04:15:59 +05:30
Pavan Kumar Sunkara
41b5b7ca46 Make cargo.toml consistent 2026-02-24 04:06:19 +05:30
Pavan Kumar Sunkara
5a3db8deee Add simple-eyre to workspace 2026-02-24 04:06:19 +05:30
Pavan Kumar Sunkara
9869db0475 Add 'simple-eyre/' from commit 'bcfff0f56f278dca96cdd45de0e741227f15f3b0'
git-subtree-dir: simple-eyre
git-subtree-mainline: 7a5c32acd7
git-subtree-split: bcfff0f56f
2026-02-24 03:39:24 +05:30
Pavan K Sunkara
3a745ca510 Make all the packages consistent (#260)
- **Fix broken links**
- **Delete unnecessary gitignore**
- **Remove doc(html_root_url)**
- **Use workspace authors info**
- **Unify lint config**
- **Use doc_auto_cfg for docs.rs**
2026-02-21 03:06:31 +00:00
Pavan Kumar Sunkara
69ff527605 Make sure the fmt check runs on all crates 2026-02-21 03:49:21 +05:30
Pavan Kumar Sunkara
0811d5a850 Use doc_auto_cfg for docs.rs 2026-02-21 03:39:29 +05:30
Pavan Kumar Sunkara
0678e27861 Unify lint config 2026-02-21 03:38:54 +05:30
Pavan Kumar Sunkara
32220eefc6 Use workspace authors info 2026-02-21 03:37:55 +05:30
Pavan Kumar Sunkara
9dc9cf89a8 Remove doc(html_root_url) 2026-02-21 03:37:09 +05:30
Pavan Kumar Sunkara
05e71eb726 Delete unnecessary gitignore 2026-02-21 03:36:37 +05:30
Pavan Kumar Sunkara
a8cb89f90f Fix broken links 2026-02-21 03:36:20 +05:30
Pavan K Sunkara
2ab897dfaa Exclude development scripts from published package (#257)
During a dependency review we noticed that the color-eyre crate includes
various development scripts. These development scripts shouldn't be
there as they might, at some point become problematic. As of now they
prevent any downstream user from enabling the `[bans.build.interpreted]`
option of cargo deny.

I opted for using an explicit include list instead of an exclude list to
prevent these files from being included in the published packages to
make sure that everything that's included is an conscious choice. I
decided to apply the settings to all workspace crates to make sure it
similar issues won't happen for the other crates in the future.
2026-02-20 20:21:57 +00:00
Pavan Kumar Sunkara
4870bf9d49 Ignore some tests in nightly 2026-02-21 01:43:42 +05:30
Georg Semmler
e6a1240b5f Bump pyo3 dependency to fix the CI error
Also bump a bunch of other dependencies + fix a few clippy warnings
2026-02-03 15:39:28 +01:00
Georg Semmler
92231340df Exclude development scripts from published package
During a dependency review we noticed that the color-eyre crate includes various development scripts. These development scripts shouldn't be there as they might, at some point become problematic. As of now they prevent any downstream user from enabling the `[bans.build.interpreted]` option of cargo deny.

I opted for using an explicit include list instead of an exclude list to prevent these files from being included in the published packages to make sure that everything that's included is an conscious choice. I decided to apply the settings to all workspace crates to make sure it similar issues won't happen for the other crates in the future.
2025-12-16 14:45:36 +01:00
Jane Losare-Lusby
c6bf9c1f05 Add release-plz to CI (#242)
also fix clippy warnings
2025-08-06 14:31:49 -07:00
Manish Goregaokar
dbaf9ed0eb Redo eyre version bump 2025-05-30 09:40:11 -07:00
Manish Goregaokar
f110d78793 Bump color-eyre to 0.6.5, color-spantrace to 0.3.0 color-spantrace-v0.3.0 color-eyre-v0.6.5 2025-05-30 09:38:16 -07:00
Manish Goregaokar
6534ecdcbb Undo eyre version bump (DO NOT PUBLISH EYRE) 2025-05-30 09:35:53 -07:00
Georg Semmler
9f35b8c83f Exclude images from published crate (#239)
This commit introduces an explict `include` configuration in the
`Cargo.toml` file of `color-spantrace`. That has the effect that it now
excludes the two example images from the source code uploaded to
crates.io.
The main benifits of this change are:

* It reduces the size of the uploaded tar-ball from 186KB to 12KB, so an
over 90% reduction in size. That will reduce the traffic produced by
this crate at crates.io by over 350GB in a 90 day period based on the
number of downloads listed by crates.io
* It removes a hard to review binary blob from the source code. In
combination with the build script such a blob might enable a future
supply chain attack. By removing the blob it becomes at least harder to
perform a xz-like code injection.

The pictures are only used by the readme. That readme is rendered by
crates.io. To keep the rendering there intact the links to the image
have been replaced by linkes to the image hosted by github. This removes
the need to upload these images to crates.io.
2025-05-27 21:10:13 +00:00
Manish Goregaokar
6e9ced8865 re-bump eyre version 2025-05-02 14:52:42 -07:00
Manish Goregaokar
97c846970d Undo eyre version bump color-spantrace-v0.2.2 color-eyre-v0.6.4 2025-05-02 14:19:10 -07:00
Manish Goregaokar
067cf0599b Bump color-eyre to 0.6.4 (#229)
The previous publish was off on a branch, it seems
f544fed447
2025-05-02 14:08:29 -07:00
Manish Goregaokar
9943e524f4 Update PyO3, clippy fixes (#228) 2025-05-01 10:46:08 -07:00
Manish Goregaokar
a48e365d65 Bump color-eyre to 0.6.4 2025-05-01 10:29:01 -07:00
Manish Goregaokar
b14c715067 Merge branch 'clippy' into pyo3 2025-05-01 10:11:44 -07:00
Manish Goregaokar
4f7065517d Update pyo3 2025-05-01 09:38:53 -07:00
Manish Goregaokar
7b1a204066 Clippy fixes 2025-05-01 09:26:43 -07:00
Manish Goregaokar
c4ee249f7c Bump color-eyre to 0.6.3, color-spantrace to 0.2.2 to publish owo-colors bump (#207)
owo-colors has a potential soundness bug, which I'm attempting to fix in
https://github.com/jam1garner/owo-colors/pull/131. However, a lot of
crates rely on the 3.x series, which may not get patched. Preemptively
updating them, would appreciate a release!!
2025-01-24 15:35:08 -08:00