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

Allow std to re-export unstable things from core without having to enable the feature itself #94972

Closed
m-ou-se opened this issue Mar 15, 2022 · 2 comments · Fixed by #97301
Closed
Assignees
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-help-wanted Call for participation: Help is requested to fix this issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Mar 15, 2022

library/std/src/lib.rs now enables a lot of #![feature]s from core and alloc and test only because it needs to re-export some unstable items (with the same #[unstable] tag). It makes it hard to tell if std needs those features itself or not.

It'd be great if an #[unstable] pub use would work without enabling the feature in the entire crate. (As long as the feature name is the same as on the original item, I suppose.)

These are all not directly used by std, but only used for items that are unstably re-exported:

#![feature(assert_matches)]
#![feature(async_iterator)]
#![feature(c_variadic)]
#![feature(cfg_accessible)]
#![feature(cfg_eval)]
#![feature(concat_bytes)]
#![feature(const_format_args)]
#![feature(c_size_t)]
#![feature(core_ffi_c)]
#![feature(core_panic)]
#![feature(custom_test_frameworks)]
#![feature(edition_panic)]
#![feature(format_args_nl)]
#![feature(log_syntax)]
#![feature(once_cell)]
#![feature(saturating_int_impl)]
#![feature(stdsimd)]
#![feature(test)]
#![feature(trace_macros)]

I'd love to remove these lines.

@m-ou-se m-ou-se added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-help-wanted Call for participation: Help is requested to fix this issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Mar 15, 2022
@semicoleon
Copy link
Contributor

@rustbot claim

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jun 7, 2022
…rochenkov

Allow unstable items to be re-exported unstably without requiring the feature be enabled

Closes rust-lang#94972

The diagnostic may need some work still, and I haven't added a test yet
@bors bors closed this as completed in 2035b50 Jun 7, 2022
@semicoleon
Copy link
Contributor

Do we want a separate issue for actually removing those lines once the change reaches beta, or should we reopen this one?

onur-ozkan added a commit to onur-ozkan/rust that referenced this issue Aug 18, 2023
Updating the behavior of `fn is_unstable_reexport` to return false for bootstrap environment
would result in a breakage of rust-lang#94972.
This was the quickest and simplest solution to fix this elusive bug, which was only identified
through miri tests.

Signed-off-by: ozkanonur <work@onurozkan.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-help-wanted Call for participation: Help is requested to fix this issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
2 participants