Skip to content

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

Closed
@m-ou-se

Description

@m-ou-se

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.

Metadata

Metadata

Assignees

Labels

C-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-help-wantedCall for participation: Help is requested to fix this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions