summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-09-25 12:01:55 -0700
committerEsteban Küber <esteban@kuber.com.ar>2017-09-25 13:25:54 -0700
commit9c3fa4d3ef46317dc812dbd43c8c43355dc7c726 (patch)
treedb84f8c911c9ecd87d86f5c1ef1c39366ab57096 /src/test/ui/span
parent14039a42ac6365afc842214989613f9a688c9a66 (diff)
downloadrust-9c3fa4d3ef46317dc812dbd43c8c43355dc7c726.tar.gz
rust-9c3fa4d3ef46317dc812dbd43c8c43355dc7c726.zip
Point at signature on unused lint
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/unused-warning-point-at-signature.rs40
-rw-r--r--src/test/ui/span/unused-warning-point-at-signature.stderr36
2 files changed, 76 insertions, 0 deletions
diff --git a/src/test/ui/span/unused-warning-point-at-signature.rs b/src/test/ui/span/unused-warning-point-at-signature.rs
new file mode 100644
index 00000000000..eb659d08da0
--- /dev/null
+++ b/src/test/ui/span/unused-warning-point-at-signature.rs
@@ -0,0 +1,40 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// run-pass
+
+#![warn(unused)]
+
+enum Enum {
+    A,
+    B,
+    C,
+    D,
+}
+
+struct Struct {
+    a: usize,
+    b: usize,
+    c: usize,
+    d: usize,
+}
+
+fn func() -> usize {
+    3
+}
+
+fn
+func_complete_span()
+-> usize
+{
+    3
+}
+
+fn main() {}
diff --git a/src/test/ui/span/unused-warning-point-at-signature.stderr b/src/test/ui/span/unused-warning-point-at-signature.stderr
new file mode 100644
index 00000000000..8e658670e9c
--- /dev/null
+++ b/src/test/ui/span/unused-warning-point-at-signature.stderr
@@ -0,0 +1,36 @@
+warning: enum is never used: `Enum`
+  --> $DIR/unused-warning-point-at-signature.rs:15:1
+   |
+15 | enum Enum {
+   | ^^^^^^^^^
+   |
+note: lint level defined here
+  --> $DIR/unused-warning-point-at-signature.rs:13:9
+   |
+13 | #![warn(unused)]
+   |         ^^^^^^
+   = note: #[warn(dead_code)] implied by #[warn(unused)]
+
+warning: struct is never used: `Struct`
+  --> $DIR/unused-warning-point-at-signature.rs:22:1
+   |
+22 | struct Struct {
+   | ^^^^^^^^^^^^^
+
+warning: function is never used: `func`
+  --> $DIR/unused-warning-point-at-signature.rs:29:1
+   |
+29 | fn func() -> usize {
+   | ^^^^^^^^^^^^^^^^^^
+
+warning: function is never used: `func_complete_span`
+  --> $DIR/unused-warning-point-at-signature.rs:33:1
+   |
+33 | / fn
+34 | | func_complete_span()
+35 | | -> usize
+36 | | {
+37 | |     3
+38 | | }
+   | |_^
+