summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs')
-rw-r--r--tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs b/tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs
new file mode 100644
index 000000000..8cc4f976a
--- /dev/null
+++ b/tests/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.rs
@@ -0,0 +1,19 @@
+#![warn(unused)]
+#![allow(dead_code)]
+#![deny(non_snake_case)]
+
+mod Impl {}
+//~^ ERROR module `Impl` should have a snake case name
+
+fn While() {}
+//~^ ERROR function `While` should have a snake case name
+
+fn main() {
+ let Mod: usize = 0;
+ //~^ ERROR variable `Mod` should have a snake case name
+ //~^^ WARN unused variable: `Mod`
+
+ let Super: usize = 0;
+ //~^ ERROR variable `Super` should have a snake case name
+ //~^^ WARN unused variable: `Super`
+}