rust/library/std/src
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
..
backtrace Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
collections Rollup merge of #94826 - allgoewer:fix-retain-documentation, r=yaahc 2022-03-11 03:32:06 +01:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
f32 Implement IEEE 754-2019 minimun and maximum functions for f32/f64 2021-11-20 10:14:03 +01:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi add CStr::from_bytes_until_nul 2022-03-18 15:46:49 -07:00
fs Add a testcase. 2022-03-20 15:56:25 -07:00
io Auto merge of #95241 - Gankra:cleaned-provenance, r=workingjubilee 2022-03-30 10:09:10 +00:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Adjust feature names that disagree on const stabilization version 2022-03-31 12:34:48 -07:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os fix unix typedef 2022-03-29 22:45:31 -04:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Rollup merge of #94650 - ChrisDenton:windows-absolute-fix, r=dtolnay 2022-03-19 14:50:24 +01:00
prelude update cfg(bootstrap)s 2022-01-28 15:01:07 +01:00
process Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
sync Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
sys Fix library/std compilation on openbsd. 2022-03-30 18:06:21 -07:00
sys_common Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
thread Rollup merge of #95130 - workingjubilee:stably-finished, r=m-ou-se 2022-03-31 04:57:25 +02:00
time Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
alloc.rs Auto merge of #88098 - Amanieu:oom_panic, r=nagisa 2022-03-18 03:01:46 +00:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs revert changes that cast functions to raw pointers, portability hazard 2022-03-29 20:18:27 -04:00
env.rs Link to std::io's platform-specific behavior disclaimer 2022-03-27 21:01:28 -07:00
error.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
f32.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
f64.rs remove now unnecessary lang items 2022-03-30 11:23:58 +02:00
fs.rs Warn that platform-specific behavior may change 2022-03-29 19:49:15 -07:00
keyword_docs.rs Rollup merge of #93692 - mfrw:mfrw/document-keyword-in, r=dtolnay 2022-03-19 02:02:02 +01:00
lazy.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
lib.rs Categorize and sort unstable features in std. 2022-03-31 18:43:12 +02:00
macros.rs Format core and std macro rules, removing needless surrounding blocks 2022-03-11 15:26:51 -08:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Configure panic hook backtrace behavior 2022-02-02 13:46:42 -05:00
panicking.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
path.rs Make the stdlib largely conform to strict provenance. 2022-03-29 20:18:21 -04:00
primitive_docs.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
process.rs fix since field version for termination stabilization 2022-03-29 17:10:49 -07:00
rt.rs Change Termination::report return type to ExitCode 2022-01-28 12:53:36 -08:00
time.rs Link to std::io's platform-specific behavior disclaimer 2022-03-27 21:01:28 -07:00