rust/library
Dylan DPC d7a24003d8
Rollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnr
Handle rustc_const_stable attribute in library feature collector

The library feature collector in [compiler/rustc_passes/src/lib_features.rs](551b4fa395/compiler/rustc_passes/src/lib_features.rs) has only been looking at `#[stable(…)]`, `#[unstable(…)]`, and `#[rustc_const_unstable(…)]` attributes, while ignoring `#[rustc_const_stable(…)]`. The consequences of this were:

- When any const feature got stabilized (changing one or more `rustc_const_unstable` to `rustc_const_stable`), users who had previously enabled that unstable feature using `#![feature(…)]` would get told "unknown feature", rather than rustc's nicer "the feature … has been stable since … and no longer requires an attribute to enable".

    This can be seen in the way that https://github.com/rust-lang/rust/pull/93957#issuecomment-1079794660 failed after rebase:

    ```console
    error[E0635]: unknown feature `const_ptr_offset`
      --> $DIR/offset_from_ub.rs:1:35
       |
    LL | #![feature(const_ptr_offset_from, const_ptr_offset)]
       |                                   ^^^^^^^^^^^^^^^^
    ```

- We weren't enforcing that a particular feature is either stable everywhere or unstable everywhere, and that a feature that has been stabilized has the same stabilization version everywhere, both of which we enforce for the other stability attributes.

This PR updates the library feature collector to handle `rustc_const_stable`, and fixes places in the standard library and test suite where `rustc_const_stable` was being used in a way that does not meet the rules for a stability attribute.
2022-04-02 03:34:21 +02:00
..
alloc make utf8_char_counts test faster in Miri 2022-03-31 13:11:44 -04:00
backtrace@b02ed04a7e Updated backtrace submodule 2021-11-02 12:31:34 +01:00
core Rollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnr 2022-04-02 03:34:21 +02:00
panic_abort Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
panic_unwind library/panic_unwind: Define UNWIND_DATA_REG for m68k 2022-02-12 20:19:06 +00:00
portable-simd Sync portable-simd to rust-lang/portable-simd@72df4c4505 2022-03-12 16:09:37 -08:00
proc_macro Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
profiler_builtins Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rtstartup
rustc-std-workspace-alloc Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-core Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-std Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
std Rollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnr 2022-04-02 03:34:21 +02:00
stdarch@bcbe010614 Update stdarch submodule 2022-03-02 20:06:46 +01:00
test Rollup merge of #93840 - yaahc:termination-stabilization-celebration-station, r=joshtriplett 2022-03-29 22:46:31 +02:00
unwind Stabilize native library modifier syntax and the whole-archive modifier specifically 2022-03-30 23:53:21 +03:00