-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The #[allow_internal_unstable]
attribute can only enable compiler features. Library features cannot be enabled.
Examples:
#![feature(allow_internal_unstable)]
// #![feature(wrapping_next_power_of_two, const_transmute)]
#[allow_internal_unstable(wrapping_next_power_of_two)]
fn g(a: u64) -> u64 {
a.wrapping_next_power_of_two()
}
#[allow_internal_unstable(const_transmute)]
const fn h(a: u64) -> i64 {
unsafe { std::mem::transmute(a) }
}
- Expected: can be built without errors.
- Actual: still complains about missing
#![feature]
s.
Rustc version = 1.43.0-nightly (2020-02-22 436494b8f8008b600d64)
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-stabilityArea: `#[stable]`, `#[unstable]` etc.Area: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.