summary refs log tree commit diff
path: root/compiler/rustc_error_messages
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-03-09 20:54:53 +0000
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-08-03 14:50:50 +0200
commit5830ca216d0bd8b0e2f16b0022db25114d80acb6 (patch)
treed6c0fdae7c2da6c384be385794a384cea164c74d /compiler/rustc_error_messages
parentc115ec11d2087050dc12c5c83959979aa98bb3e5 (diff)
downloadrust-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 'compiler/rustc_error_messages')
-rw-r--r--compiler/rustc_error_messages/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs
index 77e2c900c0d..3bf15505090 100644
--- a/compiler/rustc_error_messages/src/lib.rs
+++ b/compiler/rustc_error_messages/src/lib.rs
@@ -4,6 +4,7 @@
 #![feature(type_alias_impl_trait)]
 #![deny(rustc::untranslatable_diagnostic)]
 #![deny(rustc::diagnostic_outside_of_impl)]
+#![cfg_attr(not(bootstrap), allow(internal_features))]
 
 #[macro_use]
 extern crate tracing;