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

replace #[allow_internal_unstable] with #[rustc_allow_const_fn_unstable] for const fns #78208

Merged
merged 7 commits into from
Oct 25, 2020

Commits on Oct 21, 2020

  1. add rustc_allow_const_fn_unstable attribute

    allow_internal_unstable is currently used
    to side-step feature gate and stability checks.
    While it was originally only meant to be used
    only on macros, its use was expanded to
    const functions.
    
    This commit prepares stricter checks for the usage of allow_internal_unstable (only on macros)
    and introduces the rustc_allow_const_fn_unstable attribute for usage on functions.
    
    See rust-lang#69399
    liketechnik committed Oct 21, 2020
    Configuration menu
    Copy the full SHA
    3948b05 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    05f4a9a View commit details
    Browse the repository at this point in the history
  3. validate allow_internal_unstable target

    Adds a check to make sure `#[allow_internal_unstable]`
    can be applied only to macro definitions.
    liketechnik committed Oct 21, 2020
    Configuration menu
    Copy the full SHA
    7258740 View commit details
    Browse the repository at this point in the history
  4. validate rustc_allow_const_fn_unstable targets

    Adds a check to make sure `#[rustc_allow_const_fn_unstable]`
    can be applied only to functions.
    liketechnik committed Oct 21, 2020
    Configuration menu
    Copy the full SHA
    3a63bf0 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2020

  1. ignore #[rustc_allow_const_fn_unstable] for macro expansion

    Recognition for `rustc_allow_const_fn_unstable` attribute was errorneously
    added in 05f4a9a.
    liketechnik committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    83fbddd View commit details
    Browse the repository at this point in the history
  2. rename allow_internal_unstable() to rustc_allow_const_fn_unstable() i…

    …n rustc_mir
    
    Followup rename from 05f4a9a,
    which introduced `#[rustc_allow_const_fn_unstable]` for `const fn`s.
    liketechnik committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    13b481b View commit details
    Browse the repository at this point in the history
  3. fix validation for rustc_allow_const_fn_unstable targets

    The validation was introduced in 3a63bf0
    without strict validation of functions, e. g. all function types were
    allowed.
    Now the validation only allows `const fn`s.
    liketechnik committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    ac2c599 View commit details
    Browse the repository at this point in the history