diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/unknown-unstable-lints | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/unknown-unstable-lints')
10 files changed, 143 insertions, 0 deletions
diff --git a/src/test/ui/unknown-unstable-lints/allow-unknown-unstable-lint-command-line.rs b/src/test/ui/unknown-unstable-lints/allow-unknown-unstable-lint-command-line.rs new file mode 100644 index 000000000..80e30f239 --- /dev/null +++ b/src/test/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/src/test/ui/unknown-unstable-lints/allow-unknown-unstable-lint-inline.rs b/src/test/ui/unknown-unstable-lints/allow-unknown-unstable-lint-inline.rs new file mode 100644 index 000000000..992472c89 --- /dev/null +++ b/src/test/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/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.rs new file mode 100644 index 000000000..dcc06850d --- /dev/null +++ b/src/test/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/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr new file mode 100644 index 000000000..7e6885bd7 --- /dev/null +++ b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr @@ -0,0 +1,18 @@ +error: unknown lint: `test_unstable_lint` + | + = note: requested on the command line with `-D unknown-lints` + = 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: 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/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.rs b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.rs new file mode 100644 index 000000000..c6c60b12d --- /dev/null +++ b/src/test/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/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr new file mode 100644 index 000000000..2d1027dd0 --- /dev/null +++ b/src/test/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 lint level is defined here + --> $DIR/deny-unstable-lint-inline.rs:3:9 + | +LL | #![deny(unknown_lints)] + | ^^^^^^^^^^^^^ + = 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: 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/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.rs new file mode 100644 index 000000000..3778291eb --- /dev/null +++ b/src/test/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/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr new file mode 100644 index 000000000..799d740b0 --- /dev/null +++ b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr @@ -0,0 +1,18 @@ +warning: unknown lint: `test_unstable_lint` + | + = note: requested on the command line with `-W unknown-lints` + = 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: 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/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.rs b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.rs new file mode 100644 index 000000000..f4247e456 --- /dev/null +++ b/src/test/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/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr new file mode 100644 index 000000000..142558b47 --- /dev/null +++ b/src/test/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 lint level is defined here + --> $DIR/warn-unknown-unstable-lint-inline.rs:3:9 + | +LL | #![warn(unknown_lints)] + | ^^^^^^^^^^^^^ + = 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: 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 + |