about summary refs log tree commit diff
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
commit85b5e98ea26c6f66c49d7a26a160f6435d0dd161 (patch)
tree2c4191e33937d150673b3a64466ebf5ae263cadf
parentff27f9095f5edebdd03e885cb4df74ad32df30dc (diff)
downloadrust-85b5e98ea26c6f66c49d7a26a160f6435d0dd161.tar.gz
rust-85b5e98ea26c6f66c49d7a26a160f6435d0dd161.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^^
-rw-r--r--tests/compile-test.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index 385e25ce6b8..e46f8bf6fab 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -140,6 +140,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
         [
             "--emit=metadata",
             "-Aunused",
+            "-Ainternal_features",
             "-Zui-testing",
             "-Dwarnings",
             &format!("-Ldependency={}", deps_path.display()),