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

add new const_fn_trait_bound feature gate #281

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

RalfJung
Copy link
Contributor

This (and a subsequent release of lock_api) is needed to make rust-lang/rust#84556 work.

@Amanieu
Copy link
Owner

Amanieu commented Apr 26, 2021

bors r+

bors bot added a commit that referenced this pull request Apr 26, 2021
281: add new const_fn_trait_bound feature gate r=Amanieu a=RalfJung

This (and a subsequent release of `lock_api`) is needed to make rust-lang/rust#84556 work.

Co-authored-by: Ralf Jung <post@ralfj.de>
@Amanieu Amanieu merged commit f64bdfa into Amanieu:master Apr 26, 2021
@bors
Copy link
Contributor

bors bot commented Apr 26, 2021

Timed out.

@RalfJung RalfJung deleted the const-fn-feature branch April 26, 2021 16:48
@Amanieu
Copy link
Owner

Amanieu commented Apr 26, 2021

I am hesitant to release a new version until rust-lang/rust#84538 is resolved. At the moment the new lock_api only builds on a nighly that has no rustfmt, which most people won't have.

@RalfJung
Copy link
Contributor Author

At the moment the new lock_api only builds on a nighly that has no rustfmt

Well, only with the nightly feature flag enabled.
But since the beta cutoff is close, I also hope rustfmt won't be broken for too long...

@RalfJung
Copy link
Contributor Author

FWIW, even if we had a release we still couldn't use it in rustc yet as the bootstrap compiler does not yet know about const_fn_trait_bound.

Using nightly-only features in external crates that the compiler uses internally leads to some "interesting" bootstrap issues. Does rustc truly need these nightly-only features?

@Amanieu
Copy link
Owner

Amanieu commented Apr 27, 2021

I think rustc would work fine with the nightly feature on parking_lot disabled. It doesn't seem to use const new for mutexes which is really the only visible API .

@RalfJung
Copy link
Contributor Author

Yeah, my experiment concluded the same.

However, the docs say that some locks become more efficient with "nightly" enabled, so maybe that's why the feature was enabled? The only place that enables the feature seems to be here and it does that ever since this particular dependency was added.

@Amanieu
Copy link
Owner

Amanieu commented Apr 27, 2021

That only applies to RwLock on certain CPUs that support transactional memory extensions. Even then, it is only used under cfg(parallel_compiler), which is off by default. So I think it is fine to just drop the nightly feature from rustc.

@RalfJung
Copy link
Contributor Author

Right now, having a new release of lock_api would unblock rustfmt updates -- see rust-lang/rust#84538 (comment).

@Amanieu
Copy link
Owner

Amanieu commented May 1, 2021

I published lock_api 0.4.4

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