summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/dead-code/newline-span.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint/dead-code/newline-span.rs')
-rw-r--r--tests/ui/lint/dead-code/newline-span.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/lint/dead-code/newline-span.rs b/tests/ui/lint/dead-code/newline-span.rs
new file mode 100644
index 000000000..209c3cd93
--- /dev/null
+++ b/tests/ui/lint/dead-code/newline-span.rs
@@ -0,0 +1,19 @@
+#![deny(dead_code)]
+
+fn unused() { //~ error: function `unused` is never used
+ println!("blah");
+}
+
+fn unused2(var: i32) { //~ error: function `unused2` is never used
+ println!("foo {}", var);
+}
+
+fn unused3( //~ error: function `unused3` is never used
+ var: i32,
+) {
+ println!("bar {}", var);
+}
+
+fn main() {
+ println!("Hello world!");
+}