summaryrefslogtreecommitdiffstats
path: root/tests/ui/unknown-unstable-lints
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unknown-unstable-lints')
-rw-r--r--tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-command-line.rs4
-rw-r--r--tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-inline.rs5
-rw-r--r--tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs6
-rw-r--r--tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr18
-rw-r--r--tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.rs9
-rw-r--r--tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr34
-rw-r--r--tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs6
-rw-r--r--tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr18
-rw-r--r--tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.rs9
-rw-r--r--tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr34
10 files changed, 143 insertions, 0 deletions
diff --git a/tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-command-line.rs
new file mode 100644
index 000000000..80e30f239
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-command-line.rs
@@ -0,0 +1,4 @@
+// check-pass
+// compile-flags: -Aunknown_lints -Atest_unstable_lint
+
+fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-inline.rs b/tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-inline.rs
new file mode 100644
index 000000000..992472c89
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/allow-unknown-unstable-lint-inline.rs
@@ -0,0 +1,5 @@
+// check-pass
+
+#![allow(unknown_lints, test_unstable_lint)]
+
+fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
new file mode 100644
index 000000000..dcc06850d
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs
@@ -0,0 +1,6 @@
+// check-fail
+// compile-flags: -Dunknown_lints -Atest_unstable_lint
+// error-pattern: unknown lint: `test_unstable_lint`
+// error-pattern: the `test_unstable_lint` lint is unstable
+
+fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr
new file mode 100644
index 000000000..aa73b824a
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr
@@ -0,0 +1,18 @@
+error: unknown lint: `test_unstable_lint`
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+ = note: requested on the command line with `-D unknown-lints`
+
+error: unknown lint: `test_unstable_lint`
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+error: unknown lint: `test_unstable_lint`
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.rs b/tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.rs
new file mode 100644
index 000000000..c6c60b12d
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.rs
@@ -0,0 +1,9 @@
+// check-fail
+
+#![deny(unknown_lints)]
+#![allow(test_unstable_lint)]
+//~^ ERROR unknown lint: `test_unstable_lint`
+//~| ERROR unknown lint: `test_unstable_lint`
+//~| ERROR unknown lint: `test_unstable_lint`
+
+fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr b/tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr
new file mode 100644
index 000000000..2a2a9811b
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr
@@ -0,0 +1,34 @@
+error: unknown lint: `test_unstable_lint`
+ --> $DIR/deny-unstable-lint-inline.rs:4:1
+ |
+LL | #![allow(test_unstable_lint)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+note: the lint level is defined here
+ --> $DIR/deny-unstable-lint-inline.rs:3:9
+ |
+LL | #![deny(unknown_lints)]
+ | ^^^^^^^^^^^^^
+
+error: unknown lint: `test_unstable_lint`
+ --> $DIR/deny-unstable-lint-inline.rs:4:1
+ |
+LL | #![allow(test_unstable_lint)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+error: unknown lint: `test_unstable_lint`
+ --> $DIR/deny-unstable-lint-inline.rs:4:1
+ |
+LL | #![allow(test_unstable_lint)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
new file mode 100644
index 000000000..3778291eb
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs
@@ -0,0 +1,6 @@
+// check-pass
+// compile-flags: -Wunknown_lints -Atest_unstable_lint
+// error-pattern: unknown lint: `test_unstable_lint`
+// error-pattern: the `test_unstable_lint` lint is unstable
+
+fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr
new file mode 100644
index 000000000..82851c800
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr
@@ -0,0 +1,18 @@
+warning: unknown lint: `test_unstable_lint`
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+ = note: requested on the command line with `-W unknown-lints`
+
+warning: unknown lint: `test_unstable_lint`
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+warning: unknown lint: `test_unstable_lint`
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+warning: 3 warnings emitted
+
diff --git a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.rs b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.rs
new file mode 100644
index 000000000..f4247e456
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#![warn(unknown_lints)]
+#![allow(test_unstable_lint)]
+//~^ WARNING unknown lint: `test_unstable_lint`
+//~| WARNING unknown lint: `test_unstable_lint`
+//~| WARNING unknown lint: `test_unstable_lint`
+
+fn main() {}
diff --git a/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr
new file mode 100644
index 000000000..0548cd226
--- /dev/null
+++ b/tests/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr
@@ -0,0 +1,34 @@
+warning: unknown lint: `test_unstable_lint`
+ --> $DIR/warn-unknown-unstable-lint-inline.rs:4:1
+ |
+LL | #![allow(test_unstable_lint)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+note: the lint level is defined here
+ --> $DIR/warn-unknown-unstable-lint-inline.rs:3:9
+ |
+LL | #![warn(unknown_lints)]
+ | ^^^^^^^^^^^^^
+
+warning: unknown lint: `test_unstable_lint`
+ --> $DIR/warn-unknown-unstable-lint-inline.rs:4:1
+ |
+LL | #![allow(test_unstable_lint)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+warning: unknown lint: `test_unstable_lint`
+ --> $DIR/warn-unknown-unstable-lint-inline.rs:4:1
+ |
+LL | #![allow(test_unstable_lint)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+
+warning: 3 warnings emitted
+