summaryrefslogtreecommitdiffstats
path: root/tools/lint/test/files/clippy/test1
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /tools/lint/test/files/clippy/test1
parentInitial commit. (diff)
downloadfirefox-esr-upstream/115.8.0esr.tar.xz
firefox-esr-upstream/115.8.0esr.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/lint/test/files/clippy/test1')
-rw-r--r--tools/lint/test/files/clippy/test1/Cargo.toml17
-rw-r--r--tools/lint/test/files/clippy/test1/bad.rs14
-rw-r--r--tools/lint/test/files/clippy/test1/bad2.rs14
-rw-r--r--tools/lint/test/files/clippy/test1/good.rs6
4 files changed, 51 insertions, 0 deletions
diff --git a/tools/lint/test/files/clippy/test1/Cargo.toml b/tools/lint/test/files/clippy/test1/Cargo.toml
new file mode 100644
index 0000000000..92d5072eca
--- /dev/null
+++ b/tools/lint/test/files/clippy/test1/Cargo.toml
@@ -0,0 +1,17 @@
+[package]
+name = "hello_world" # the name of the package
+version = "0.1.0" # the current version, obeying semver
+authors = ["Alice <a@example.com>", "Bob <b@example.com>"]
+
+[[bin]]
+name ="good"
+path = "good.rs"
+
+[[bin]]
+name ="bad"
+path = "bad.rs"
+
+[[bin]]
+name ="bad2"
+path = "bad2.rs"
+
diff --git a/tools/lint/test/files/clippy/test1/bad.rs b/tools/lint/test/files/clippy/test1/bad.rs
new file mode 100644
index 0000000000..c403fba603
--- /dev/null
+++ b/tools/lint/test/files/clippy/test1/bad.rs
@@ -0,0 +1,14 @@
+fn main() {
+ // Statements here are executed when the compiled binary is called
+
+ // Print text to the console
+ println!("Hello World!");
+ // Clippy detects this as a swap and considers this as an error
+ let mut a=1;
+ let mut b=1;
+
+ a = b;
+ b = a;
+
+
+}
diff --git a/tools/lint/test/files/clippy/test1/bad2.rs b/tools/lint/test/files/clippy/test1/bad2.rs
new file mode 100644
index 0000000000..bf488bbe72
--- /dev/null
+++ b/tools/lint/test/files/clippy/test1/bad2.rs
@@ -0,0 +1,14 @@
+fn main() {
+ // Statements here are executed when the compiled binary is called
+
+ // Print text to the console
+ println!("Hello World!");
+ let mut a;
+ let mut b=1;
+ let mut vec = vec![1, 2];
+
+ for x in 5..10 - 5 {
+ a = x;
+ }
+
+ }
diff --git a/tools/lint/test/files/clippy/test1/good.rs b/tools/lint/test/files/clippy/test1/good.rs
new file mode 100644
index 0000000000..9bcaee67b7
--- /dev/null
+++ b/tools/lint/test/files/clippy/test1/good.rs
@@ -0,0 +1,6 @@
+fn main() {
+ // Statements here are executed when the compiled binary is called
+
+ // Print text to the console
+ println!("Hello World!");
+}