Skip to content

Commit 74834a9

Browse files
committed
also make 'core_intrinsics' internal
1 parent d1583eb commit 74834a9

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

compiler/rustc_feature/src/unstable.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,12 @@ macro_rules! declare_features {
132132
// Accepted/removed features aren't in this file but are never internal
133133
// (a removed feature might have been internal, but that's now irrelevant).
134134
// Libs features are internal if they end in `_internal` or `_internals`.
135+
// As a special exception we also consider `core_intrinsics` internal;
136+
// renaming that age-old feature is just not worth the hassle.
135137
// We just always test the name; it's not a big deal if we accidentally hit
136138
// an accepted/removed lang feature that way.
137139
let name = feature.as_str();
138-
name.ends_with("_internal") || name.ends_with("_internals")
140+
name == "core_intrinsics" || name.ends_with("_internal") || name.ends_with("_internals")
139141
}
140142
_ => panic!("`{}` was not listed in `declare_features`", feature),
141143
}

compiler/rustc_query_system/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![feature(hash_raw_entry)]
44
#![feature(min_specialization)]
55
#![feature(let_chains)]
6-
#![allow(rustc::potential_query_instability)]
6+
#![allow(rustc::potential_query_instability, internal_features)]
77
#![deny(rustc::untranslatable_diagnostic)]
88
#![deny(rustc::diagnostic_outside_of_impl)]
99

library/alloc/tests/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#![feature(thin_box)]
4141
#![feature(strict_provenance)]
4242
#![feature(drain_keep_rest)]
43+
#![allow(internal_features)]
4344
#![deny(fuzzy_provenance_casts)]
4445
#![deny(unsafe_op_in_unsafe_fn)]
4546

library/core/src/intrinsics.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,7 @@ extern "rust-intrinsic" {
19001900
///
19011901
/// ```
19021902
/// #![feature(core_intrinsics)]
1903+
/// # #![allow(internal_features)]
19031904
///
19041905
/// use std::intrinsics::ctlz;
19051906
///
@@ -1912,6 +1913,7 @@ extern "rust-intrinsic" {
19121913
///
19131914
/// ```
19141915
/// #![feature(core_intrinsics)]
1916+
/// # #![allow(internal_features)]
19151917
///
19161918
/// use std::intrinsics::ctlz;
19171919
///
@@ -1933,6 +1935,7 @@ extern "rust-intrinsic" {
19331935
///
19341936
/// ```
19351937
/// #![feature(core_intrinsics)]
1938+
/// # #![allow(internal_features)]
19361939
///
19371940
/// use std::intrinsics::ctlz_nonzero;
19381941
///
@@ -1959,6 +1962,7 @@ extern "rust-intrinsic" {
19591962
///
19601963
/// ```
19611964
/// #![feature(core_intrinsics)]
1965+
/// # #![allow(internal_features)]
19621966
///
19631967
/// use std::intrinsics::cttz;
19641968
///
@@ -1971,6 +1975,7 @@ extern "rust-intrinsic" {
19711975
///
19721976
/// ```
19731977
/// #![feature(core_intrinsics)]
1978+
/// # #![allow(internal_features)]
19741979
///
19751980
/// use std::intrinsics::cttz;
19761981
///
@@ -1992,6 +1997,7 @@ extern "rust-intrinsic" {
19921997
///
19931998
/// ```
19941999
/// #![feature(core_intrinsics)]
2000+
/// # #![allow(internal_features)]
19952001
///
19962002
/// use std::intrinsics::cttz_nonzero;
19972003
///
@@ -2453,6 +2459,7 @@ extern "rust-intrinsic" {
24532459
/// ```no_run
24542460
/// #![feature(const_eval_select)]
24552461
/// #![feature(core_intrinsics)]
2462+
/// # #![allow(internal_features)]
24562463
/// use std::hint::unreachable_unchecked;
24572464
/// use std::intrinsics::const_eval_select;
24582465
///

library/core/tests/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
#![feature(get_many_mut)]
117117
#![feature(offset_of)]
118118
#![feature(iter_map_windows)]
119+
#![allow(internal_features)]
119120
#![deny(unsafe_op_in_unsafe_fn)]
120121
#![deny(fuzzy_provenance_casts)]
121122

src/tools/rust-analyzer/crates/proc-macro-srv/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![cfg(feature = "sysroot-abi")]
1414
#![feature(proc_macro_internals, proc_macro_diagnostic, proc_macro_span)]
1515
#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
16-
#![allow(unreachable_pub)]
16+
#![allow(unreachable_pub, internal_features)]
1717

1818
extern crate proc_macro;
1919

0 commit comments

Comments
 (0)