From 7ad2d64ac10088c24f661d0b8635f9424112071a Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Thu, 9 Mar 2023 20:54:53 +0000 Subject: [PATCH] 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^^ --- tests/compiletest.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index fa17923446..5c3a194214 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -53,6 +53,7 @@ fn test_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) -> // Add some flags we always want. program.args.push("-Dwarnings".into()); program.args.push("-Dunused".into()); + program.args.push("-Ainternal_features".into()); if let Ok(extra_flags) = env::var("MIRIFLAGS") { for flag in extra_flags.split_whitespace() { program.args.push(flag.into());