Skip to content

Commit 4152584

Browse files
Rollup merge of rust-lang#118123 - RalfJung:internal-lib-features, r=compiler-errors
Add support for making lib features internal We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug. This extends that idea to lib features as well. It is an alternative to rust-lang#115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal. Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes rust-lang#115597.
2 parents d83007b + bec8f5c commit 4152584

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

alloc/tests/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#![feature(thin_box)]
4242
#![feature(strict_provenance)]
4343
#![feature(drain_keep_rest)]
44+
#![allow(internal_features)]
4445
#![deny(fuzzy_provenance_casts)]
4546
#![deny(unsafe_op_in_unsafe_fn)]
4647

core/src/intrinsics.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,7 @@ extern "rust-intrinsic" {
19061906
///
19071907
/// ```
19081908
/// #![feature(core_intrinsics)]
1909+
/// # #![allow(internal_features)]
19091910
///
19101911
/// use std::intrinsics::ctlz;
19111912
///
@@ -1918,6 +1919,7 @@ extern "rust-intrinsic" {
19181919
///
19191920
/// ```
19201921
/// #![feature(core_intrinsics)]
1922+
/// # #![allow(internal_features)]
19211923
///
19221924
/// use std::intrinsics::ctlz;
19231925
///
@@ -1939,6 +1941,7 @@ extern "rust-intrinsic" {
19391941
///
19401942
/// ```
19411943
/// #![feature(core_intrinsics)]
1944+
/// # #![allow(internal_features)]
19421945
///
19431946
/// use std::intrinsics::ctlz_nonzero;
19441947
///
@@ -1965,6 +1968,7 @@ extern "rust-intrinsic" {
19651968
///
19661969
/// ```
19671970
/// #![feature(core_intrinsics)]
1971+
/// # #![allow(internal_features)]
19681972
///
19691973
/// use std::intrinsics::cttz;
19701974
///
@@ -1977,6 +1981,7 @@ extern "rust-intrinsic" {
19771981
///
19781982
/// ```
19791983
/// #![feature(core_intrinsics)]
1984+
/// # #![allow(internal_features)]
19801985
///
19811986
/// use std::intrinsics::cttz;
19821987
///
@@ -1998,6 +2003,7 @@ extern "rust-intrinsic" {
19982003
///
19992004
/// ```
20002005
/// #![feature(core_intrinsics)]
2006+
/// # #![allow(internal_features)]
20012007
///
20022008
/// use std::intrinsics::cttz_nonzero;
20032009
///
@@ -2463,6 +2469,7 @@ extern "rust-intrinsic" {
24632469
/// ```no_run
24642470
/// #![feature(const_eval_select)]
24652471
/// #![feature(core_intrinsics)]
2472+
/// # #![allow(internal_features)]
24662473
/// use std::hint::unreachable_unchecked;
24672474
/// use std::intrinsics::const_eval_select;
24682475
///

core/tests/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
#![feature(get_many_mut)]
118118
#![feature(offset_of)]
119119
#![feature(iter_map_windows)]
120+
#![allow(internal_features)]
120121
#![deny(unsafe_op_in_unsafe_fn)]
121122
#![deny(fuzzy_provenance_casts)]
122123

0 commit comments

Comments
 (0)