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

Find a way to support versions older than 1.13.0 #11

Open
roblabla opened this issue Nov 2, 2019 · 1 comment
Open

Find a way to support versions older than 1.13.0 #11

roblabla opened this issue Nov 2, 2019 · 1 comment

Comments

@roblabla
Copy link
Contributor

roblabla commented Nov 2, 2019

https://github.com/core-error/core-error/blob/335e1da/src/typeinfo.rs#L46 So while testing the crate, I found out that the implementation of TypeInfo using Any bound instead of 'static causes warnings in the downstream crates if they try to use core_error::Error as a trait object. Specifically, it triggers where_clauses_object_safety. The reason to use Any instead of 'static is that rustc versions older than 1.13.0 had a Reflect bound on the TypeId::of function.

The warning is over-eager: our usage is legit, since Any is implemented on every 'static type. But unfortunately, the compiler doesn't see it, and triggers the warning. This wouldn't be a problem if it triggered the warning within core-error, but it triggers it downstream, in each crate that tries to turn to use a &dyn Error.

I temporarily added a quick n dirty patch that changes implementation based on the compiler version, but that's seriously not great. I'm thinking of dropping support of anything older than 1.13.0 in no_std. That release is 3 years old now. If someone needs it, they can open an issue.

EDIT: I removed the workaround and changed MSRV to 1.13.0 when using no-default-feature. Please upvote this issue if you need this crate to work on older versions. Worth noting that the only rust versions affected are 1.6.0 to 1.12.1. Versions older than 1.6.0 didn't support no_std.

roblabla added a commit that referenced this issue Nov 22, 2019
See #11. We'd like to avoid having too many hacks in this crate to
support old outdated versions. There's no reason to believe that anyone
using this crate would be stuck on such an old version of rustc, so
let's just assume nobody is for now.
@roblabla roblabla changed the title Don't trigger where_clauses_object_safety, drop version older than 1.13.0 Find a way to support versions older than 1.13.0 Nov 22, 2019
@dtolnay
Copy link

dtolnay commented Mar 15, 2020

FWIW I don't think this is worth caring about.

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

No branches or pull requests

2 participants