about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/lint/issue-83477.rs16
-rw-r--r--src/test/ui/lint/issue-83477.stderr30
2 files changed, 46 insertions, 0 deletions
diff --git a/src/test/ui/lint/issue-83477.rs b/src/test/ui/lint/issue-83477.rs
new file mode 100644
index 00000000000..0eba52acfa3
--- /dev/null
+++ b/src/test/ui/lint/issue-83477.rs
@@ -0,0 +1,16 @@
+// check-pass
+#![warn(rustc::internal)]
+
+#[allow(rustc::foo::bar::default_hash_types)]
+//~^ WARN unknown lint: `rustc::foo::bar::default_hash_types`
+//~| HELP did you mean
+//~| SUGGESTION rustc::default_hash_types
+#[allow(rustc::foo::default_hash_types)]
+//~^ WARN unknown lint: `rustc::foo::default_hash_types`
+//~| HELP did you mean
+//~| SUGGESTION rustc::default_hash_types
+fn main() {
+    let _ = std::collections::HashMap::<String, String>::new();
+    //~^ WARN Prefer FxHashMap over HashMap, it has better performance
+    //~| HELP use
+}
diff --git a/src/test/ui/lint/issue-83477.stderr b/src/test/ui/lint/issue-83477.stderr
new file mode 100644
index 00000000000..dbe0c9e0130
--- /dev/null
+++ b/src/test/ui/lint/issue-83477.stderr
@@ -0,0 +1,30 @@
+warning: unknown lint: `rustc::foo::bar::default_hash_types`
+  --> $DIR/issue-83477.rs:4:9
+   |
+LL | #[allow(rustc::foo::bar::default_hash_types)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `rustc::default_hash_types`
+   |
+   = note: `#[warn(unknown_lints)]` on by default
+
+warning: unknown lint: `rustc::foo::default_hash_types`
+  --> $DIR/issue-83477.rs:8:9
+   |
+LL | #[allow(rustc::foo::default_hash_types)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `rustc::default_hash_types`
+
+warning: Prefer FxHashMap over HashMap, it has better performance
+  --> $DIR/issue-83477.rs:13:31
+   |
+LL |     let _ = std::collections::HashMap::<String, String>::new();
+   |                               ^^^^^^^ help: use: `FxHashMap`
+   |
+note: the lint level is defined here
+  --> $DIR/issue-83477.rs:2:9
+   |
+LL | #![warn(rustc::internal)]
+   |         ^^^^^^^^^^^^^^^
+   = note: `#[warn(rustc::default_hash_types)]` implied by `#[warn(rustc::internal)]`
+   = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
+
+warning: 3 warnings emitted
+