Skip to content

Use core::error::Error instead of std::error::Error#1334

Open
ppentchev wants to merge 1 commit intorust-lang:masterfrom
ppentchev:pp-core-error
Open

Use core::error::Error instead of std::error::Error#1334
ppentchev wants to merge 1 commit intorust-lang:masterfrom
ppentchev:pp-core-error

Conversation

@ppentchev
Copy link

Hi,

First of all, thanks a lot for writing and maintaining the regex crate!

What do you think about this change that makes all the error types derive core::error::Error instead of std::error::Error so that they are usable even in no-std mode? There are several error handling crates like anyhow, eyre, etc. which also work in no-std mode, and they refuse to accept the error objects defined in these crates then.

Thanks in advance, and keep up the great work!

G'luck,
Peter

@ppentchev
Copy link
Author

...sorry, I just realized why it was this way - at the very least since core::error was only stabilized in 1.81. Oof. Many apologies, I don't know how I managed to overlook that!

@ppentchev ppentchev closed this Feb 18, 2026
@BurntSushi
Copy link
Member

I'm actually okay with doing the MSRV bump necessary for this impl. I was actually thinking of bumping to Rust 1.85 and doing a migration to Rust 2024.

@BurntSushi BurntSushi reopened this Feb 18, 2026
@BurntSushi
Copy link
Member

But yes, MSRV is why this hasn't been done until now.

...and let all error types derive from it even in no-std mode.
@ppentchev
Copy link
Author

I'm actually okay with doing the MSRV bump necessary for this impl. I was actually thinking of bumping to Rust 1.85 and doing a migration to Rust 2024.

Hah, that would be great! Do you want me to also bump MSRV as part of this PR, or would you prefer to do it separately, in a different change, etc?

@BurntSushi
Copy link
Member

I can do that in a separate change.

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.

2 participants