about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorflip1995 <9744647+flip1995@users.noreply.github.com>2018-07-03 12:23:20 +0200
committerflip1995 <9744647+flip1995@users.noreply.github.com>2018-07-04 12:16:45 +0200
commited29e86c39cde1a77a8b3a4046d12f9b57fb72fb (patch)
treecbf64119a9bc45c54e88d760dcaa65c8f2b6f7e6 /src/test/compile-fail
parenta739c51d108b1958a1c3e145588035c580e7973a (diff)
downloadrust-ed29e86c39cde1a77a8b3a4046d12f9b57fb72fb.tar.gz
rust-ed29e86c39cde1a77a8b3a4046d12f9b57fb72fb.zip
Tests for tool_lints
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/feature-gate-tool_lints.rs12
-rw-r--r--src/test/compile-fail/tool_lints.rs18
-rw-r--r--src/test/compile-fail/unknown-lint-tool-name.rs16
3 files changed, 46 insertions, 0 deletions
diff --git a/src/test/compile-fail/feature-gate-tool_lints.rs b/src/test/compile-fail/feature-gate-tool_lints.rs
new file mode 100644
index 00000000000..c311eb7ed7a
--- /dev/null
+++ b/src/test/compile-fail/feature-gate-tool_lints.rs
@@ -0,0 +1,12 @@
+// Copyright 2018 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.
+
+#[warn(clippy::assign_ops)] //~ ERROR scoped lint `clippy::assign_ops` is experimental
+fn main() {}
diff --git a/src/test/compile-fail/tool_lints.rs b/src/test/compile-fail/tool_lints.rs
new file mode 100644
index 00000000000..ea1efab4cb6
--- /dev/null
+++ b/src/test/compile-fail/tool_lints.rs
@@ -0,0 +1,18 @@
+// Copyright 2018 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.
+
+// Don't allow tool_lints, which aren't scoped
+
+#![feature(tool_lints)]
+#![deny(unknown_lints)]
+
+#![deny(clippy)] //~ ERROR: unknown lint: `clippy`
+
+fn main() {}
diff --git a/src/test/compile-fail/unknown-lint-tool-name.rs b/src/test/compile-fail/unknown-lint-tool-name.rs
new file mode 100644
index 00000000000..173803d6030
--- /dev/null
+++ b/src/test/compile-fail/unknown-lint-tool-name.rs
@@ -0,0 +1,16 @@
+// Copyright 2018 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.
+
+#![feature(tool_lints)]
+
+#![deny(foo::bar)] //~ ERROR an unknown tool name found in scoped lint: `foo::bar`.
+
+#[allow(foo::bar)] //~ ERROR an unknown tool name found in scoped lint: `foo::bar`.
+fn main() {}