diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-03-09 20:54:53 +0000 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-08-03 14:50:50 +0200 |
| commit | 5830ca216d0bd8b0e2f16b0022db25114d80acb6 (patch) | |
| tree | d6c0fdae7c2da6c384be385794a384cea164c74d /library/core/src | |
| parent | c115ec11d2087050dc12c5c83959979aa98bb3e5 (diff) | |
| download | rust-5830ca216d0bd8b0e2f16b0022db25114d80acb6.tar.gz rust-5830ca216d0bd8b0e2f16b0022db25114d80acb6.zip | |
Add `internal_features` lint
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/intrinsics/mir.rs | 3 | ||||
| -rw-r--r-- | library/core/src/lib.rs | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs index 5944a0de1a4..036edbebbf3 100644 --- a/library/core/src/intrinsics/mir.rs +++ b/library/core/src/intrinsics/mir.rs @@ -14,6 +14,7 @@ //! //! ```rust //! #![feature(core_intrinsics, custom_mir)] +#![cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")] //! //! use core::intrinsics::mir::*; //! @@ -63,6 +64,7 @@ //! //! ```rust //! #![feature(core_intrinsics, custom_mir)] +#![cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")] //! //! use core::intrinsics::mir::*; //! @@ -315,6 +317,7 @@ define!( /// # Examples /// /// ```rust + #[cfg_attr(not(bootstrap), doc = "#![allow(internal_features)]")] /// #![feature(custom_mir, core_intrinsics)] /// /// use core::intrinsics::mir::*; diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 37216d6a721..ded799160bf 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -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 |
