Skip to content

Commit

Permalink
Auto merge of #108955 - Nilstrieb:dont-use-me-pls, r=oli-obk
Browse files Browse the repository at this point in the history
Add `internal_features` lint

Implements rust-lang/compiler-team#596

Also requires some more test blessing for codegen tests etc

`@jyn514` had the idea of just `allow`ing the lint by default in the test suite. I'm not sure whether this is a good idea, but it's definitely one worth considering. Additional input encouraged.
  • Loading branch information
bors committed Aug 3, 2023
2 parents c4874fe + e6e254e commit 6f152dc
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#![warn(missing_docs)]
#![allow(explicit_outlives_requirements)]
#![warn(multiple_supertrait_upcastable)]
#![cfg_attr(not(bootstrap), allow(internal_features))]
//
// Library features:
// tidy-alphabetical-start
Expand Down
3 changes: 3 additions & 0 deletions core/src/intrinsics/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//!
//! ```rust
//! #![feature(core_intrinsics, custom_mir)]
#![cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")]
//!
//! use core::intrinsics::mir::*;
//!
Expand Down Expand Up @@ -63,6 +64,7 @@
//!
//! ```rust
//! #![feature(core_intrinsics, custom_mir)]
#![cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")]
//!
//! use core::intrinsics::mir::*;
//!
Expand Down Expand Up @@ -315,6 +317,7 @@ define!(
/// # Examples
///
/// ```rust
#[cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")]
/// #![feature(custom_mir, core_intrinsics)]
///
/// use core::intrinsics::mir::*;
Expand Down
1 change: 1 addition & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
#![allow(explicit_outlives_requirements)]
#![allow(incomplete_features)]
#![warn(multiple_supertrait_upcastable)]
#![cfg_attr(not(bootstrap), allow(internal_features))]
//
// Library features:
// tidy-alphabetical-start
Expand Down
1 change: 1 addition & 0 deletions panic_abort/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#![feature(staged_api)]
#![feature(rustc_attrs)]
#![feature(c_unwind)]
#![cfg_attr(not(bootstrap), allow(internal_features))]

#[cfg(target_os = "android")]
mod android;
Expand Down
1 change: 1 addition & 0 deletions panic_unwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#![feature(c_unwind)]
// `real_imp` is unused with Miri, so silence warnings.
#![cfg_attr(miri, allow(dead_code))]
#![cfg_attr(not(bootstrap), allow(internal_features))]

use alloc::boxed::Box;
use core::any::Any;
Expand Down
1 change: 1 addition & 0 deletions proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#![feature(min_specialization)]
#![feature(strict_provenance)]
#![recursion_limit = "256"]
#![cfg_attr(not(bootstrap), allow(internal_features))]

#[unstable(feature = "proc_macro_internals", issue = "27812")]
#[doc(hidden)]
Expand Down
1 change: 1 addition & 0 deletions profiler_builtins/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
issue = "none"
)]
#![allow(unused_features)]
#![cfg_attr(not(bootstrap), allow(internal_features))]
#![feature(staged_api)]
1 change: 1 addition & 0 deletions std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
#![warn(missing_debug_implementations)]
#![allow(explicit_outlives_requirements)]
#![allow(unused_lifetimes)]
#![cfg_attr(not(bootstrap), allow(internal_features))]
#![deny(rustc::existing_doc_keyword)]
#![deny(fuzzy_provenance_casts)]
// Ensure that std can be linked against panic_abort despite compiled with `-C panic=unwind`
Expand Down
1 change: 1 addition & 0 deletions test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#![feature(process_exitcode_internals)]
#![feature(panic_can_unwind)]
#![feature(test)]
#![cfg_attr(not(bootstrap), allow(internal_features))]

// Public reexports
pub use self::bench::{black_box, Bencher};
Expand Down
1 change: 1 addition & 0 deletions unwind/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#![feature(c_unwind)]
#![feature(cfg_target_abi)]
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
#![cfg_attr(not(bootstrap), allow(internal_features))]

cfg_if::cfg_if! {
if #[cfg(target_env = "msvc")] {
Expand Down

0 comments on commit 6f152dc

Please sign in to comment.