bless tests and tidy

also removes E0452 and splits
`tests/rustdoc-ui/lints/renamed-lint-still-applies` into 2 tests

this is because of delayed warn lint being lost on compiler aborting on
error
This commit is contained in:
Edvin Bryntesson
2026-03-10 16:54:27 +01:00
committed by Jonathan Brouwer
parent d884f92b04
commit bd864efa70
56 changed files with 1363 additions and 695 deletions
@@ -1,8 +1,9 @@
#### Note: this error code is no longer emitted by the compiler
An invalid lint attribute has been given.
Erroneous code example:
```compile_fail,E0452
```compile_fail
#![allow(foo = "")] // error: malformed lint attribute
```
@@ -1,23 +1,11 @@
error: unknown lint: `clippy::All`
--> tests/ui/unknown_clippy_lints.rs:3:10
|
LL | #![allow(clippy::All)]
| ^^^^^^^^^^^ help: did you mean: `clippy::all`
|
= note: `-D unknown-lints` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unknown_lints)]`
error: unknown lint: `clippy::CMP_OWNED`
--> tests/ui/unknown_clippy_lints.rs:5:9
|
LL | #![warn(clippy::CMP_OWNED)]
| ^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::cmp_owned`
error: unknown lint: `clippy::if_not_els`
--> tests/ui/unknown_clippy_lints.rs:9:8
|
LL | #[warn(clippy::if_not_els)]
| ^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::if_not_else`
|
= note: `-D unknown-lints` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unknown_lints)]`
error: unknown lint: `clippy::UNNecsaRy_cAst`
--> tests/ui/unknown_clippy_lints.rs:11:8
@@ -67,5 +55,17 @@ LL - #[warn(clippy::missing_docs)]
LL + #[warn(missing_docs)]
|
error: unknown lint: `clippy::All`
--> tests/ui/unknown_clippy_lints.rs:3:10
|
LL | #![allow(clippy::All)]
| ^^^^^^^^^^^ help: did you mean: `clippy::all`
error: unknown lint: `clippy::CMP_OWNED`
--> tests/ui/unknown_clippy_lints.rs:5:9
|
LL | #![warn(clippy::CMP_OWNED)]
| ^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::cmp_owned`
error: aborting due to 9 previous errors
@@ -1,14 +1,15 @@
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [incomplete_features]}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2021::*;
//@ edition:2021
//@ aux-crate:to_reuse_functions=to-reuse-functions.rs
//@ pretty-mode:hir
//@ pretty-compare-only
//@ pp-exact:delegation-inherit-attributes.pp
#![allow(incomplete_features)]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2021::*;
extern crate to_reuse_functions;
+6 -5
View File
@@ -1,12 +1,13 @@
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:delegation-inline-attribute.pp
#![allow(incomplete_features)]
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [incomplete_features]}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:delegation-inline-attribute.pp
mod to_reuse {
fn foo(x: usize) -> usize { x }
+6 -5
View File
@@ -1,12 +1,13 @@
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-delegation.pp
#![allow(incomplete_features)]
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [incomplete_features]}])]
#![attr = Feature([fn_delegation#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-delegation.pp
fn b<C>(e: C) { }
+10 -4
View File
@@ -1,13 +1,19 @@
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [unused_imports, unused_variables, unused_visibilities,
unused_assignments, dead_code, unused_mut, unreachable_code,
unreachable_patterns, unused_must_use, unused_unsafe, path_statements,
unused_attributes, unused_macros, unused_macro_rules, unused_allocation,
unused_doc_comments, unused_extern_crates, unused_features, unused_labels,
unused_parens, unused_braces, redundant_semicolons, map_unit_fn]}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:hir-lifetimes.pp
// This tests the pretty-printing of lifetimes in lots of ways.
#![allow(unused)]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
struct Foo<'a> {
x: &'a u32,
+6 -5
View File
@@ -1,12 +1,13 @@
#![attr = Feature([pin_ergonomics#0])]
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [dead_code, incomplete_features]}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ pretty-compare-only
//@ pretty-mode:hir
//@ pp-exact:pin-ergonomics-hir.pp
#![allow(dead_code, incomplete_features)]
#![attr = Feature([pin_ergonomics#0])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
use std::pin::Pin;
@@ -0,0 +1,12 @@
// compile-args: --crate-type lib
// This file does not emit the rename warnings
// due to compilation aborting before we emit delayed lints
#![deny(broken_intra_doc_links)]
//! [x]
//~^ ERROR unresolved link
#![deny(rustdoc::non_autolinks)]
//! http://example.com
//~^ ERROR not a hyperlink
@@ -0,0 +1,32 @@
error: unresolved link to `x`
--> $DIR/renamed-lint-still-applies-2.rs:7:6
|
LL | //! [x]
| ^ no item named `x` in scope
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/renamed-lint-still-applies-2.rs:6:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
error: this URL is not a hyperlink
--> $DIR/renamed-lint-still-applies-2.rs:11:5
|
LL | //! http://example.com
| ^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/renamed-lint-still-applies-2.rs:10:9
|
LL | #![deny(rustdoc::non_autolinks)]
| ^^^^^^^^^^^^^^^^^^^^^^
help: use an automatic link instead
|
LL | //! <http://example.com>
| + +
error: aborting due to 2 previous errors
@@ -1,10 +1,7 @@
//@ check-pass
// compile-args: --crate-type lib
#![deny(broken_intra_doc_links)]
//~^ WARNING renamed to `rustdoc::broken_intra_doc_links`
//! [x]
//~^ ERROR unresolved link
#![deny(rustdoc::non_autolinks)]
//~^ WARNING renamed to `rustdoc::bare_urls`
//! http://example.com
//~^ ERROR not a hyperlink
@@ -1,5 +1,5 @@
warning: lint `broken_intra_doc_links` has been renamed to `rustdoc::broken_intra_doc_links`
--> $DIR/renamed-lint-still-applies.rs:2:9
--> $DIR/renamed-lint-still-applies.rs:3:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `rustdoc::broken_intra_doc_links`
@@ -7,40 +7,10 @@ LL | #![deny(broken_intra_doc_links)]
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint `rustdoc::non_autolinks` has been renamed to `rustdoc::bare_urls`
--> $DIR/renamed-lint-still-applies.rs:7:9
--> $DIR/renamed-lint-still-applies.rs:6:9
|
LL | #![deny(rustdoc::non_autolinks)]
| ^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `rustdoc::bare_urls`
error: unresolved link to `x`
--> $DIR/renamed-lint-still-applies.rs:4:6
|
LL | //! [x]
| ^ no item named `x` in scope
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/renamed-lint-still-applies.rs:2:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
error: this URL is not a hyperlink
--> $DIR/renamed-lint-still-applies.rs:9:5
|
LL | //! http://example.com
| ^^^^^^^^^^^^^^^^^^
|
= note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/renamed-lint-still-applies.rs:7:9
|
LL | #![deny(rustdoc::non_autolinks)]
| ^^^^^^^^^^^^^^^^^^^^^^
help: use an automatic link instead
|
LL | //! <http://example.com>
| + +
error: aborting due to 2 previous errors; 2 warnings emitted
warning: 2 warnings emitted
@@ -1,4 +1,4 @@
<svg width="944px" height="434px" xmlns="http://www.w3.org/2000/svg">
<svg width="911px" height="434px" xmlns="http://www.w3.org/2000/svg">
<style>
.fg { fill: #AAAAAA }
.bg { fill: #000000 }

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

+90 -80
View File
@@ -26,86 +26,6 @@ error[E0463]: can't find crate for `wloop`
LL | extern crate wloop;
| ^^^^^^^^^^^^^^^^^^^ can't find crate
error: malformed `allow` attribute input
--> $DIR/malformed-attrs.rs:180:1
|
LL | #[allow]
| ^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[allow(lint1)]
| +++++++
LL | #[allow(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[allow(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `expect` attribute input
--> $DIR/malformed-attrs.rs:182:1
|
LL | #[expect]
| ^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[expect(lint1)]
| +++++++
LL | #[expect(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[expect(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `warn` attribute input
--> $DIR/malformed-attrs.rs:184:1
|
LL | #[warn]
| ^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[warn(lint1)]
| +++++++
LL | #[warn(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[warn(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `deny` attribute input
--> $DIR/malformed-attrs.rs:186:1
|
LL | #[deny]
| ^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[deny(lint1)]
| +++++++
LL | #[deny(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[deny(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: malformed `forbid` attribute input
--> $DIR/malformed-attrs.rs:188:1
|
LL | #[forbid]
| ^^^^^^^^^
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
|
LL | #[forbid(lint1)]
| +++++++
LL | #[forbid(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[forbid(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type
--> $DIR/malformed-attrs.rs:103:1
|
@@ -593,6 +513,96 @@ error[E0539]: malformed `linkage` attribute input
LL | #[linkage]
| ^^^^^^^^^^ expected this to be of the form `linkage = "..."`
error[E0539]: malformed `allow` attribute input
--> $DIR/malformed-attrs.rs:180:1
|
LL | #[allow]
| ^^-----^
| |
| expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[allow(lint1)]
| +++++++
LL | #[allow(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[allow(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error[E0539]: malformed `expect` attribute input
--> $DIR/malformed-attrs.rs:182:1
|
LL | #[expect]
| ^^------^
| |
| expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[expect(lint1)]
| +++++++
LL | #[expect(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[expect(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error[E0539]: malformed `warn` attribute input
--> $DIR/malformed-attrs.rs:184:1
|
LL | #[warn]
| ^^----^
| |
| expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[warn(lint1)]
| +++++++
LL | #[warn(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[warn(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error[E0539]: malformed `deny` attribute input
--> $DIR/malformed-attrs.rs:186:1
|
LL | #[deny]
| ^^----^
| |
| expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[deny(lint1)]
| +++++++
LL | #[deny(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[deny(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error[E0539]: malformed `forbid` attribute input
--> $DIR/malformed-attrs.rs:188:1
|
LL | #[forbid]
| ^^------^
| |
| expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[forbid(lint1)]
| +++++++
LL | #[forbid(lint1, lint2, ...)]
| +++++++++++++++++++
LL | #[forbid(lint1, lint2, lint3, reason = "...")]
| +++++++++++++++++++++++++++++++++++++
error[E0539]: malformed `debugger_visualizer` attribute input
--> $DIR/malformed-attrs.rs:190:1
|
@@ -26,13 +26,10 @@ pub fn e() {}
#[unsafe(allow(unsafe(dead_code)))]
//~^ ERROR: is not an unsafe attribute
//~| ERROR: malformed lint attribute input
//~| ERROR: malformed lint attribute input
//~| ERROR: malformed
//~| ERROR: expected identifier, found keyword `unsafe`
//~| ERROR: expected identifier, found keyword `unsafe`
//~| ERROR: expected identifier, found keyword `unsafe`
//~| ERROR: malformed lint attribute input
//~| ERROR: malformed lint attribute input
//~| ERROR: malformed lint attribute input
//~| ERROR: malformed lint attribute input
pub fn f() {}
fn main() {}
@@ -1,17 +1,3 @@
error[E0452]: malformed lint attribute input
--> $DIR/proc-unsafe-attributes.rs:27:16
|
LL | #[unsafe(allow(unsafe(dead_code)))]
| ^^^^^^^^^^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/proc-unsafe-attributes.rs:27:16
|
LL | #[unsafe(allow(unsafe(dead_code)))]
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: expected identifier, found keyword `unsafe`
--> $DIR/proc-unsafe-attributes.rs:27:16
|
@@ -47,21 +33,17 @@ error: the `#[proc_macro_attribute]` attribute is only usable with crates of the
LL | #[unsafe(proc_macro_attribute)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0452]: malformed lint attribute input
error: expected identifier, found keyword `unsafe`
--> $DIR/proc-unsafe-attributes.rs:27:16
|
LL | #[unsafe(allow(unsafe(dead_code)))]
| ^^^^^^^^^^^^^^^^^ bad attribute argument
| ^^^^^^ expected identifier, found keyword
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/proc-unsafe-attributes.rs:27:16
help: escape `unsafe` to use it as an identifier
|
LL | #[unsafe(allow(unsafe(dead_code)))]
| ^^^^^^^^^^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
LL | #[unsafe(allow(r#unsafe(dead_code)))]
| ++
error: `proc_macro` is not an unsafe attribute
--> $DIR/proc-unsafe-attributes.rs:1:3
@@ -132,23 +114,39 @@ LL | #[unsafe(allow(unsafe(dead_code)))]
|
= note: extraneous unsafe is not allowed in attributes
error[E0452]: malformed lint attribute input
error: expected identifier, found keyword `unsafe`
--> $DIR/proc-unsafe-attributes.rs:27:16
|
LL | #[unsafe(allow(unsafe(dead_code)))]
| ^^^^^^^^^^^^^^^^^ bad attribute argument
| ^^^^^^ expected identifier, found keyword
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
help: escape `unsafe` to use it as an identifier
|
LL | #[unsafe(allow(r#unsafe(dead_code)))]
| ++
error[E0452]: malformed lint attribute input
--> $DIR/proc-unsafe-attributes.rs:27:16
error[E0565]: malformed `allow` attribute input
--> $DIR/proc-unsafe-attributes.rs:27:1
|
LL | #[unsafe(allow(unsafe(dead_code)))]
| ^^^^^^^^^^^^^^^^^ bad attribute argument
| ^^^^^^^^^^^^^^^^^^^^^-----------^^^
| |
| didn't expect any arguments here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[unsafe(allow(unsafe(dead_code)))]
LL + #[allow(lint1)]
|
LL - #[unsafe(allow(unsafe(dead_code)))]
LL + #[allow(lint1, lint2, ...)]
|
LL - #[unsafe(allow(unsafe(dead_code)))]
LL + #[allow(lint1, lint2, lint3, reason = "...")]
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 18 previous errors
error: aborting due to 15 previous errors
Some errors have detailed explanations: E0452, E0565.
For more information about an error, try `rustc --explain E0452`.
For more information about this error, try `rustc --explain E0565`.
@@ -1,15 +1,30 @@
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:10:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
error: cannot find derive macro `Unresolved` in this scope
--> $DIR/deduplicate-diagnostics.rs:6:10
|
LL | #[derive(Unresolved)]
| ^^^^^^^^^^
error[E0539]: malformed `deny` attribute input
--> $DIR/deduplicate-diagnostics.rs:10:1
|
LL | #[deny("literal")]
| ^^^^^^^---------^^
| |
| expected a valid identifier here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[deny("literal")]
LL + #[deny(lint1)]
|
LL - #[deny("literal")]
LL + #[deny(lint1, lint2, ...)]
|
LL - #[deny("literal")]
LL + #[deny(lint1, lint2, lint3, reason = "...")]
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0452`.
For more information about this error, try `rustc --explain E0539`.
@@ -1,9 +1,3 @@
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:10:8
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
error: cannot find derive macro `Unresolved` in this scope
--> $DIR/deduplicate-diagnostics.rs:6:10
|
@@ -18,22 +12,27 @@ LL | #[derive(Unresolved)]
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:10:8
error[E0539]: malformed `deny` attribute input
--> $DIR/deduplicate-diagnostics.rs:10:1
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
| ^^^^^^^---------^^
| |
| expected a valid identifier here
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/deduplicate-diagnostics.rs:10:8
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[deny("literal")]
| ^^^^^^^^^ bad attribute argument
LL - #[deny("literal")]
LL + #[deny(lint1)]
|
LL - #[deny("literal")]
LL + #[deny(lint1, lint2, ...)]
|
LL - #[deny("literal")]
LL + #[deny(lint1, lint2, lint3, reason = "...")]
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 5 previous errors
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0452`.
For more information about this error, try `rustc --explain E0539`.
@@ -7,7 +7,5 @@
//[duplicate]~| ERROR cannot find derive macro `Unresolved` in this scope
struct S;
#[deny("literal")] //~ ERROR malformed lint attribute input
//[duplicate]~| ERROR malformed lint attribute input
//[duplicate]~| ERROR malformed lint attribute input
#[deny("literal")] //~ ERROR malformed `deny` attribute input [E0539]
fn main() {}
-8
View File
@@ -1,8 +0,0 @@
#![allow(foo = "")] //~ ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
fn main() {
}
-49
View File
@@ -1,49 +0,0 @@
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0452`.
@@ -12,41 +12,102 @@ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
warning: unknown lint: `x5400`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:42:9
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:1
|
LL | #![warn(x5400)]
| ^^^^^
LL | #[link(name = "x")]
| ^^^^^^^^^^^^^^^^^^^
...
LL | / mod link {
LL | |
LL | |
LL | | mod inner { #![link(name = "x")] }
... |
LL | | }
| |_- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:36:28
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:36:9
|
LL | #![warn(unused_attributes, unknown_lints)]
| ^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
warning: unknown lint: `x5300`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:10
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1
|
LL | #![allow(x5300)]
| ^^^^^
LL | #![link(name = "x")]
| ^^^^^^^^^^^^^^^^^^^^ not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: unknown lint: `x5200`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:44:11
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:98:12
|
LL | #![forbid(x5200)]
| ^^^^^
LL | #![feature(rust1)]
| ^^^^^
|
= note: `#[warn(stable_features)]` on by default
warning: unknown lint: `x5100`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:9
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17
|
LL | #![deny(x5100)]
| ^^^^^
LL | mod inner { #![link(name = "x")] }
| ------------^^^^^^^^^^^^^^^^^^^^-- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5
|
LL | #[link(name = "x")] fn f() { }
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:701:5
|
LL | #[link(name = "x")] struct S;
| ^^^^^^^^^^^^^^^^^^^ --------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5
|
LL | #[link(name = "x")] type T = S;
| ^^^^^^^^^^^^^^^^^^^ ----------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
|
LL | #[link(name = "x")] impl S { }
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
|
LL | #[link(name = "x")] extern "Rust" {}
| ^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: unknown lint: `x5400`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:109:8
|
LL | #[warn(x5400)]
| ^^^^^
|
note: the lint level is defined here
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:36:28
|
LL | #![warn(unused_attributes, unknown_lints)]
| ^^^^^^^^^^^^^
warning: unknown lint: `x5400`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:112:25
@@ -186,91 +247,6 @@ warning: unknown lint: `x5100`
LL | #[deny(x5100)] impl S { }
| ^^^^^
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:1
|
LL | #[link(name = "x")]
| ^^^^^^^^^^^^^^^^^^^
...
LL | / mod link {
LL | |
LL | |
LL | | mod inner { #![link(name = "x")] }
... |
LL | | }
| |_- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:36:9
|
LL | #![warn(unused_attributes, unknown_lints)]
| ^^^^^^^^^^^^^^^^^
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:70:1
|
LL | #![link(name = "x")]
| ^^^^^^^^^^^^^^^^^^^^ not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:98:12
|
LL | #![feature(rust1)]
| ^^^^^
|
= note: `#[warn(stable_features)]` on by default
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:17
|
LL | mod inner { #![link(name = "x")] }
| ------------^^^^^^^^^^^^^^^^^^^^-- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5
|
LL | #[link(name = "x")] fn f() { }
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:701:5
|
LL | #[link(name = "x")] struct S;
| ^^^^^^^^^^^^^^^^^^^ --------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:5
|
LL | #[link(name = "x")] type T = S;
| ^^^^^^^^^^^^^^^^^^^ ----------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
|
LL | #[link(name = "x")] impl S { }
| ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
|
LL | #[link(name = "x")] extern "Rust" {}
| ^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: `#[macro_use]` attribute cannot be used on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:189:5
|
@@ -1522,6 +1498,30 @@ note: this attribute does not have an `!`, which means it is applied to this imp
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^
warning: unknown lint: `x5400`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:42:9
|
LL | #![warn(x5400)]
| ^^^^^
warning: unknown lint: `x5300`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:43:10
|
LL | #![allow(x5300)]
| ^^^^^
warning: unknown lint: `x5200`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:44:11
|
LL | #![forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5100`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:9
|
LL | #![deny(x5100)]
| ^^^^^
warning: `#[should_panic]` attribute cannot be used on crates
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:49:1
|
@@ -1,4 +1,4 @@
<svg width="1188px" height="470px" xmlns="http://www.w3.org/2000/svg">
<svg width="1062px" height="470px" xmlns="http://www.w3.org/2000/svg">
<style>
.fg { fill: #AAAAAA }
.bg { fill: #000000 }

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

+4 -4
View File
@@ -4,7 +4,7 @@ warning: unused attribute
LL | #[forbid()]
| ^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `forbid` with an empty list has no effect
= note: using `forbid` with an empty list has no effect
= note: requested on the command line with `-W unused-attributes`
warning: unused attribute
@@ -13,7 +13,7 @@ warning: unused attribute
LL | #[deny(reason = "ultion")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `deny` without any lints has no effect
= note: using `deny` with an empty list has no effect
warning: unused attribute
--> $DIR/empty-lint-attributes.rs:6:1
@@ -21,7 +21,7 @@ warning: unused attribute
LL | #![allow()]
| ^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `allow` with an empty list has no effect
= note: using `allow` with an empty list has no effect
warning: unused attribute
--> $DIR/empty-lint-attributes.rs:7:1
@@ -29,7 +29,7 @@ warning: unused attribute
LL | #![warn(reason = "observationalism")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `warn` without any lints has no effect
= note: using `warn` with an empty list has no effect
warning: 4 warnings emitted
+4 -2
View File
@@ -12,8 +12,10 @@ fn main() {
// This does nothing, since `#[allow(warnings)]` is itself
// an inert attribute on a macro call
#[allow(warnings)] #[inline] foo!(); //~ WARN unused attribute `allow`
//~^ WARN `#[inline]` attribute cannot be used on macro calls
#[allow(warnings)] #[inline] foo!();
//~^ WARN `#[allow]` attribute cannot be used on macro calls [unused_attributes]
//~| WARN previously accepted
//~| WARN `#[inline]` attribute cannot be used on macro calls
//~| WARN previously accepted
// This does work, since the attribute is on a parent
+3 -6
View File
@@ -13,17 +13,14 @@ LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_attributes)]` implied by `#[warn(unused)]`
warning: unused attribute `allow`
warning: `#[allow]` attribute cannot be used on macro calls
--> $DIR/inert-attr-macro.rs:15:5
|
LL | #[allow(warnings)] #[inline] foo!();
| ^^^^^^^^^^^^^^^^^^
|
note: the built-in attribute `allow` will be ignored, since it's applied to the macro invocation `foo`
--> $DIR/inert-attr-macro.rs:15:34
|
LL | #[allow(warnings)] #[inline] foo!();
| ^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[allow]` can be applied to associated consts, associated types, const parameters, const parameters, constants, crates, data types, enum variants, extern crates, foreign modules, foreign statics, function params, functions, global asms, impl blocks, lifetime parameters, lifetime parameters, macro defs, match arms, modules, pattern fields, statics, struct fields, struct fields, trait aliases, traits, type aliases, type parameters, type parameters, and use statements
warning: `#[inline]` attribute cannot be used on macro calls
--> $DIR/inert-attr-macro.rs:15:24
+18 -18
View File
@@ -1,8 +1,8 @@
error: unknown lint: `nonex_lint_top_level`
--> $DIR/issue-97094.rs:5:25
error: unknown lint: `nonex_lint_mod`
--> $DIR/issue-97094.rs:10:24
|
LL | #![cfg_attr(true, allow(nonex_lint_top_level))]
| ^^^^^^^^^^^^^^^^^^^^
LL | #[cfg_attr(true, allow(nonex_lint_mod))]
| ^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/issue-97094.rs:1:9
@@ -11,20 +11,6 @@ LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unknown_lints)]` implied by `#[deny(warnings)]`
error: lint `bare_trait_object` has been renamed to `bare_trait_objects`
--> $DIR/issue-97094.rs:7:25
|
LL | #![cfg_attr(true, allow(bare_trait_object))]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `bare_trait_objects`
|
= note: `#[deny(renamed_and_removed_lints)]` implied by `#[deny(warnings)]`
error: unknown lint: `nonex_lint_mod`
--> $DIR/issue-97094.rs:10:24
|
LL | #[cfg_attr(true, allow(nonex_lint_mod))]
| ^^^^^^^^^^^^^^
error: unknown lint: `nonex_lint_mod_inner`
--> $DIR/issue-97094.rs:13:29
|
@@ -49,5 +35,19 @@ error: unknown lint: `nonex_lint_fn`
LL | #[allow(nonex_lint_fn)]
| ^^^^^^^^^^^^^
error: unknown lint: `nonex_lint_top_level`
--> $DIR/issue-97094.rs:5:25
|
LL | #![cfg_attr(true, allow(nonex_lint_top_level))]
| ^^^^^^^^^^^^^^^^^^^^
error: lint `bare_trait_object` has been renamed to `bare_trait_objects`
--> $DIR/issue-97094.rs:7:25
|
LL | #![cfg_attr(true, allow(bare_trait_object))]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `bare_trait_objects`
|
= note: `#[deny(renamed_and_removed_lints)]` implied by `#[deny(warnings)]`
error: aborting due to 7 previous errors
+2 -6
View File
@@ -1,8 +1,4 @@
#![deny = "foo"] //~ ERROR malformed `deny` attribute input
#![allow(bar = "baz")] //~ ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
//~| ERROR malformed lint attribute
#![allow(bar = "baz")]
//~^ ERROR malformed `allow` attribute input [E0539]
fn main() { }
+24 -47
View File
@@ -1,25 +1,13 @@
error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: malformed `deny` attribute input
error[E0539]: malformed `deny` attribute input
--> $DIR/lint-malformed.rs:1:1
|
LL | #![deny = "foo"]
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^-------^
| |
| expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: the following are the possible correct uses
help: try changing it to one of the following valid forms of the attribute
|
LL - #![deny = "foo"]
LL + #![deny(lint1)]
@@ -31,38 +19,27 @@ LL - #![deny = "foo"]
LL + #![deny(lint1, lint2, lint3, reason = "...")]
|
error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
error[E0539]: malformed `allow` attribute input
--> $DIR/lint-malformed.rs:2:1
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument
| ^^^^^^^^^-----------^^
| |
| the only valid argument here is `reason`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![allow(bar = "baz")]
LL + #![allow(lint1)]
|
LL - #![allow(bar = "baz")]
LL + #![allow(lint1, lint2, ...)]
|
LL - #![allow(bar = "baz")]
LL + #![allow(lint1, lint2, lint3, reason = "...")]
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 2 previous errors
error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0452]: malformed lint attribute input
--> $DIR/lint-malformed.rs:2:10
|
LL | #![allow(bar = "baz")]
| ^^^^^^^^^^^ bad attribute argument
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0452`.
For more information about this error, try `rustc --explain E0539`.
+20 -14
View File
@@ -1,26 +1,32 @@
//@ compile-flags: -Zdeduplicate-diagnostics=yes
#![warn(absolute_paths_not_starting_with_crate, reason = 0)]
//~^ ERROR malformed lint attribute
//~| NOTE reason must be a string literal
//~^ ERROR malformed
//~| NOTE expected a string literal here
//~| NOTE for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
#![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
//~^ ERROR malformed lint attribute
//~| NOTE reason must be a string literal
//~^ ERROR malformed
//~| NOTE expected a normal string literal, not a byte string literal
#![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
//~^ ERROR malformed lint attribute
//~| NOTE bad attribute argument
//~^ ERROR malformed
//~| NOTE the only valid argument here is `reason`
//~| NOTE for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
#![warn(unsafe_code, blerp = "or in league with robbers have reversed the signposts")]
//~^ ERROR malformed lint attribute
//~| NOTE bad attribute argument
//~^ ERROR malformed
//~| NOTE the only valid argument here is `reason`
//~| NOTE for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
#![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
//~^ ERROR malformed lint attribute
//~| NOTE bad attribute argument
//~^ ERROR malformed
//~| NOTE didn't expect any arguments here
//~| NOTE for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
#![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
//~^ ERROR malformed lint attribute
//~| NOTE reason in lint attribute must come last
//~^ ERROR malformed
//~| NOTE expected reason = "..." to be the last argument
//~| NOTE for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
#![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
//~^ ERROR malformed lint attribute
//~| NOTE reason in lint attribute must come last
//~^ ERROR malformed
//~| NOTE expected reason = "..." to be the last argument
//~| NOTE for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
#![warn(missing_copy_implementations, reason)]
//~^ WARN unknown lint
//~| NOTE `#[warn(unknown_lints)]` on by default
+118 -23
View File
@@ -1,47 +1,141 @@
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:3:58
error[E0539]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:3:1
|
LL | #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
| ^ reason must be a string literal
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^
| |
| expected a string literal here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
LL + #![warn(lint1)]
|
LL - #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
LL + #![warn(lint1, lint2, ...)]
|
LL - #![warn(absolute_paths_not_starting_with_crate, reason = 0)]
LL + #![warn(lint1, lint2, lint3, reason = "...")]
|
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:6:40
error[E0539]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:7:1
|
LL | #![warn(anonymous_parameters, reason = b"consider these, for we have condemned them")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reason must be a string literal
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider removing the prefix
|
= note: expected a normal string literal, not a byte string literal
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:9:29
error[E0539]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:10:1
|
LL | #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------------------------^^
| |
| the only valid argument here is `reason`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
LL + #![warn(lint1)]
|
LL - #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
LL + #![warn(lint1, lint2, ...)]
|
LL - #![warn(bare_trait_objects, reasons = "leaders to no sure land, guides their bearings lost")]
LL + #![warn(lint1, lint2, lint3, reason = "...")]
|
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:12:22
error[E0539]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:14:1
|
LL | #![warn(unsafe_code, blerp = "or in league with robbers have reversed the signposts")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument
| ^^^^^^^^^^^^^^^^^^^^^---------------------------------------------------------------^^
| |
| the only valid argument here is `reason`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![warn(unsafe_code, blerp = "or in league with robbers have reversed the signposts")]
LL + #![warn(lint1)]
|
LL - #![warn(unsafe_code, blerp = "or in league with robbers have reversed the signposts")]
LL + #![warn(lint1, lint2, ...)]
|
LL - #![warn(unsafe_code, blerp = "or in league with robbers have reversed the signposts")]
LL + #![warn(lint1, lint2, lint3, reason = "...")]
|
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:15:36
error[E0565]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:18:1
|
LL | #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad attribute argument
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------------------------------------^^
| |
| didn't expect any arguments here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
LL + #![warn(lint1)]
|
LL - #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
LL + #![warn(lint1, lint2, ...)]
|
LL - #![warn(elided_lifetimes_in_paths, reason("disrespectful to ancestors", "irresponsible to heirs"))]
LL + #![warn(lint1, lint2, lint3, reason = "...")]
|
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:18:44
error[E0539]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:22:1
|
LL | #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
| ^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected reason = "..." to be the last argument
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
LL + #![warn(lint1)]
|
LL - #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
LL + #![warn(lint1, lint2, ...)]
|
LL - #![warn(ellipsis_inclusive_range_patterns, reason = "born barren", reason = "a freak growth")]
LL + #![warn(lint1, lint2, lint3, reason = "...")]
|
error[E0452]: malformed lint attribute input
--> $DIR/reasons-erroneous.rs:21:25
error[E0539]: malformed `warn` attribute input
--> $DIR/reasons-erroneous.rs:26:1
|
LL | #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ reason in lint attribute must come last
| ^^^^^^^^^^^^^^^^^^^^^^^^-------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected reason = "..." to be the last argument
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#lint-check-attributes>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
LL + #![warn(lint1)]
|
LL - #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
LL + #![warn(lint1, lint2, ...)]
|
LL - #![warn(keyword_idents, reason = "root in rubble", macro_use_extern_crate)]
LL + #![warn(lint1, lint2, lint3, reason = "...")]
|
warning: unknown lint: `reason`
--> $DIR/reasons-erroneous.rs:24:39
--> $DIR/reasons-erroneous.rs:30:39
|
LL | #![warn(missing_copy_implementations, reason)]
| ^^^^^^
@@ -50,4 +144,5 @@ LL | #![warn(missing_copy_implementations, reason)]
error: aborting due to 7 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0452`.
Some errors have detailed explanations: E0539, E0565.
For more information about an error, try `rustc --explain E0539`.
-2
View File
@@ -5,5 +5,3 @@
#![warn(abc::my_lint)]
//~^ ERROR unknown tool name `abc` found in scoped lint
//~| HELP add `#![register_tool(abc)]`
//~| ERROR unknown tool name `abc`
//~| HELP add `#![register_tool(abc)]`
+1 -10
View File
@@ -6,15 +6,6 @@ LL | #![warn(abc::my_lint)]
|
= help: add `#![register_tool(abc)]` to the crate root
error[E0710]: unknown tool name `abc` found in scoped lint: `abc::my_lint`
--> $DIR/register-tool-lint.rs:5:9
|
LL | #![warn(abc::my_lint)]
| ^^^
|
= help: add `#![register_tool(abc)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 2 previous errors
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0710`.
@@ -1,11 +1,3 @@
warning: lint `single_use_lifetime` has been renamed to `single_use_lifetimes`
--> $DIR/renamed-lints-still-apply.rs:2:9
|
LL | #![deny(single_use_lifetime)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `single_use_lifetimes`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
error: lifetime parameter `'a` only used once
--> $DIR/renamed-lints-still-apply.rs:6:9
|
@@ -25,5 +17,13 @@ LL - fn _foo<'a>(_x: &'a u32) {}
LL + fn _foo(_x: &u32) {}
|
warning: lint `single_use_lifetime` has been renamed to `single_use_lifetimes`
--> $DIR/renamed-lints-still-apply.rs:2:9
|
LL | #![deny(single_use_lifetime)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `single_use_lifetimes`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
error: aborting due to 1 previous error; 1 warning emitted
@@ -23,7 +23,9 @@ pub fn check_expect_on_item() {
pub fn check_expect_on_macro() {
// This should be fulfilled by the macro
#[expect(unused_variables)] //~ WARN unused attribute
#[expect(unused_variables)]
//~^ WARN cannot be used on
//~| WARN this was previously accepted
trigger_unused_variables_macro!();
// FIXME: Lint attributes currently don't work directly on macros, and
@@ -1,14 +1,11 @@
warning: unused attribute `expect`
warning: `#[expect]` attribute cannot be used on macro calls
--> $DIR/expect_lint_from_macro.rs:26:5
|
LL | #[expect(unused_variables)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the built-in attribute `expect` will be ignored, since it's applied to the macro invocation `trigger_unused_variables_macro`
--> $DIR/expect_lint_from_macro.rs:27:5
|
LL | trigger_unused_variables_macro!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[expect]` can be applied to associated consts, associated types, const parameters, const parameters, constants, crates, data types, enum variants, extern crates, foreign modules, foreign statics, function params, functions, global asms, impl blocks, lifetime parameters, lifetime parameters, macro defs, match arms, modules, pattern fields, statics, struct fields, struct fields, trait aliases, traits, type aliases, type parameters, type parameters, and use statements
= note: requested on the command line with `-W unused-attributes`
warning: unused variable: `x`
@@ -42,6 +42,50 @@ fn check_multiple_lints_with_lint_group_1() {
#[expect(unused, while_true)]
//~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
fn check_multiple_lints_with_lint_group_2() {
while true {}
}
@@ -48,5 +48,181 @@ warning: this lint expectation is unfulfilled
LL | #[expect(unused, while_true)]
| ^^^^^^
warning: 8 warnings emitted
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/expect_multiple_lints.rs:43:10
|
LL | #[expect(unused, while_true)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: 30 warnings emitted
@@ -21,6 +21,51 @@ fn check_specific_lint() {
#[expect(unused)]
//~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
fn check_multiple_lints_with_lint_group() {
let fox_name = "Sir Nibbles";
@@ -33,6 +78,51 @@ fn check_multiple_lints_with_lint_group() {
#[expect(unused)]
//~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
//~| WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
fn check_overridden_expectation_lint_level() {
#[allow(unused_variables)]
let this_should_not_fulfill_the_expectation = "maybe";
@@ -1,5 +1,5 @@
warning: unused variable: `this_should_not_fulfill_the_expectation`
--> $DIR/force_warn_expected_lints_unfulfilled.rs:38:9
--> $DIR/force_warn_expected_lints_unfulfilled.rs:128:9
|
LL | let this_should_not_fulfill_the_expectation = "maybe";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_this_should_not_fulfill_the_expectation`
@@ -29,10 +29,362 @@ LL | #[expect(unused)]
| ^^^^^^
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:34:10
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:22:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
warning: 5 warnings emitted
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: this lint expectation is unfulfilled
--> $DIR/force_warn_expected_lints_unfulfilled.rs:79:10
|
LL | #[expect(unused)]
| ^^^^^^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
warning: 49 warnings emitted
@@ -4,7 +4,7 @@ error: unused attribute
LL | #[allow(reason = "I want to allow something")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `allow` without any lints has no effect
= note: using `allow` with an empty list has no effect
note: the lint level is defined here
--> $DIR/lint-attribute-only-with-reason.rs:1:9
|
@@ -17,7 +17,7 @@ error: unused attribute
LL | #[expect(reason = "I don't know what I'm waiting for")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `expect` without any lints has no effect
= note: using `expect` with an empty list has no effect
error: unused attribute
--> $DIR/lint-attribute-only-with-reason.rs:5:1
@@ -25,7 +25,7 @@ error: unused attribute
LL | #[warn(reason = "This should be warn by default")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `warn` without any lints has no effect
= note: using `warn` with an empty list has no effect
error: unused attribute
--> $DIR/lint-attribute-only-with-reason.rs:6:1
@@ -33,7 +33,7 @@ error: unused attribute
LL | #[deny(reason = "All listed lints are denied")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `deny` without any lints has no effect
= note: using `deny` with an empty list has no effect
error: unused attribute
--> $DIR/lint-attribute-only-with-reason.rs:7:1
@@ -41,7 +41,7 @@ error: unused attribute
LL | #[forbid(reason = "Just some reason")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `forbid` without any lints has no effect
= note: using `forbid` with an empty list has no effect
error: aborting due to 5 previous errors
@@ -2,7 +2,6 @@
#![warn(unused)]
#[warn(unused_variables)]
#[expect(unused_variables)]
//~^ WARNING this lint expectation is unfulfilled [unfulfilled_lint_expectations]
//~| NOTE `#[warn(unfulfilled_lint_expectations)]` on by default
@@ -1,5 +1,5 @@
warning: this lint expectation is unfulfilled
--> $DIR/multiple_expect_attrs.rs:6:10
--> $DIR/multiple_expect_attrs.rs:5:10
|
LL | #[expect(unused_variables)]
| ^^^^^^^^^^^^^^^^
@@ -48,5 +48,6 @@ fn inner() {
// This `#[allow]` does not work, since the attribute gets dropped
// when we expand the macro
let _ = #[allow(semicolon_in_expressions_from_macros)] foo!(allow_does_not_work);
//~^ WARN unused attribute
//~^ WARN attribute cannot be used on
//~| WARN this was previously accepted
}
@@ -31,17 +31,14 @@ LL | let _ = foo!(warn_in_expr);
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: unused attribute `allow`
warning: `#[allow]` attribute cannot be used on macro calls
--> $DIR/semicolon-in-expressions-from-macros.rs:50:13
|
LL | let _ = #[allow(semicolon_in_expressions_from_macros)] foo!(allow_does_not_work);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the built-in attribute `allow` will be ignored, since it's applied to the macro invocation `foo`
--> $DIR/semicolon-in-expressions-from-macros.rs:50:60
|
LL | let _ = #[allow(semicolon_in_expressions_from_macros)] foo!(allow_does_not_work);
| ^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[allow]` can be applied to associated consts, associated types, const parameters, const parameters, constants, crates, data types, enum variants, expressions, extern crates, foreign modules, foreign statics, function params, functions, global asms, impl blocks, lifetime parameters, lifetime parameters, macro defs, match arms, modules, pattern fields, statements, statics, struct fields, struct fields, trait aliases, traits, type aliases, type parameters, type parameters, and use statements
= note: requested on the command line with `-W unused-attributes`
warning: trailing semicolon in macro used in expression position
+45 -45
View File
@@ -1,48 +1,3 @@
error: unused attribute
--> $DIR/empty-attributes.rs:2:1
|
LL | #![allow()]
| ^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `allow` with an empty list has no effect
note: the lint level is defined here
--> $DIR/empty-attributes.rs:1:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/empty-attributes.rs:3:1
|
LL | #![expect()]
| ^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `expect` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:4:1
|
LL | #![warn()]
| ^^^^^^^^^^ help: remove this attribute
|
= note: attribute `warn` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:5:1
|
LL | #![deny()]
| ^^^^^^^^^^ help: remove this attribute
|
= note: attribute `deny` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:6:1
|
LL | #![forbid()]
| ^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `forbid` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:9:1
|
@@ -50,6 +5,11 @@ LL | #[repr()]
| ^^^^^^^^^ help: remove this attribute
|
= note: using `repr` with an empty list has no effect
note: the lint level is defined here
--> $DIR/empty-attributes.rs:1:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/empty-attributes.rs:12:1
@@ -59,6 +19,46 @@ LL | #[target_feature()]
|
= note: using `target_feature` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:2:1
|
LL | #![allow()]
| ^^^^^^^^^^^ help: remove this attribute
|
= note: using `allow` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:3:1
|
LL | #![expect()]
| ^^^^^^^^^^^^ help: remove this attribute
|
= note: using `expect` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:4:1
|
LL | #![warn()]
| ^^^^^^^^^^ help: remove this attribute
|
= note: using `warn` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:5:1
|
LL | #![deny()]
| ^^^^^^^^^^ help: remove this attribute
|
= note: using `deny` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:6:1
|
LL | #![forbid()]
| ^^^^^^^^^^^^ help: remove this attribute
|
= note: using `forbid` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:7:1
|
+3 -1
View File
@@ -1,4 +1,6 @@
#![feature(rustc_attrs)]
#![rustc_dummy=5z] //~ ERROR invalid suffix `z` for number literal
#![rustc_dummy=5z]
//~^ ERROR invalid suffix `z` for number literal
fn main() {}
+1 -1
View File
@@ -4,7 +4,7 @@ warning: unused attribute
LL | #[cfg_attr(true, allow())]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
= note: attribute `allow` with an empty list has no effect
= note: using `allow` with an empty list has no effect
= note: requested on the command line with `-W unused-attributes`
warning: 1 warning emitted
-2
View File
@@ -1,5 +1,3 @@
#[warn(foo::bar)]
//~^ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
fn main() {}
+1 -19
View File
@@ -6,24 +6,6 @@ LL | #[warn(foo::bar)]
|
= help: add `#![register_tool(foo)]` to the crate root
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/tool_lints.rs:1:8
|
LL | #[warn(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/tool_lints.rs:1:8
|
LL | #[warn(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 3 previous errors
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0710`.
@@ -1,8 +1,6 @@
#![deny(foo::bar)] //~ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
#![deny(foo::bar)]
//~^ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
#[allow(foo::bar)] //~ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
//~| ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
#[allow(foo::bar)]
//~^ ERROR unknown tool name `foo` found in scoped lint: `foo::bar`
fn main() {}
@@ -7,49 +7,13 @@ LL | #![deny(foo::bar)]
= help: add `#![register_tool(foo)]` to the crate root
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:5:9
--> $DIR/unknown-lint-tool-name.rs:4:9
|
LL | #[allow(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:1:9
|
LL | #![deny(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:5:9
|
LL | #[allow(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:1:9
|
LL | #![deny(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0710]: unknown tool name `foo` found in scoped lint: `foo::bar`
--> $DIR/unknown-lint-tool-name.rs:5:9
|
LL | #[allow(foo::bar)]
| ^^^
|
= help: add `#![register_tool(foo)]` to the crate root
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 6 previous errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0710`.
+38 -18
View File
@@ -1,3 +1,14 @@
#![attr = Feature([auto_traits#0, box_patterns#0, builtin_syntax#0,
const_trait_impl#0, coroutines#0, decl_macro#0, deref_patterns#0,
explicit_tail_calls#0, gen_blocks#0, more_qualified_paths#0, never_patterns#0,
never_type#0, pattern_types#0, pattern_type_macro#0, prelude_import#0,
specialization#0, trace_macros#0, trait_alias#0, try_blocks#0,
try_blocks_heterogeneous#0, yeet_expr#0])]
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [incomplete_features]}])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2024::*;
//@ revisions: expanded hir
//@[expanded]compile-flags: -Zunpretty=expanded
//@[expanded]check-pass
@@ -8,16 +19,6 @@
// Note: the HIR revision includes a `.stderr` file because there are some
// errors that only occur once we get past the AST.
#![allow(incomplete_features)]
#![attr = Feature([auto_traits#0, box_patterns#0, builtin_syntax#0,
const_trait_impl#0, coroutines#0, decl_macro#0, deref_patterns#0,
explicit_tail_calls#0, gen_blocks#0, more_qualified_paths#0, never_patterns#0,
never_type#0, pattern_types#0, pattern_type_macro#0, prelude_import#0,
specialization#0, trace_macros#0, trait_alias#0, try_blocks#0,
try_blocks_heterogeneous#0, yeet_expr#0])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2024::*;
mod prelude {
use std::prelude::rust_2024::*;
@@ -39,7 +40,8 @@ use self::prelude::*;
* inner multi-line doc comment
*/
#[doc = "inner doc attribute"]
#[allow(dead_code, unused_variables)]
#[attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [dead_code, unused_variables]}])]
#[attr = NoStd]
mod attributes {
@@ -49,7 +51,9 @@ mod attributes {
*/
#[doc = "outer doc attribute"]
#[doc = "macro"]
#[allow()]
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Outer,
lint_instances: []}])]
#[attr = Repr {reprs: [ReprC]}]
struct Struct;
}
@@ -212,9 +216,13 @@ mod expressions {
{ }
unsafe { }
'a: { }
#[allow()]
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Outer,
lint_instances: []}])]
{ }
#[allow()]
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Inner,
lint_instances: []}])]
{ }
}
@@ -244,9 +252,15 @@ mod expressions {
type_ascribe!({ from_output(()) }, Option<_>);
type_ascribe!({
from_output(match branch(None) {
Break { 0: residual } => #[allow(unreachable_code)]
Break { 0: residual } =>
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Outer,
lint_instances: [unreachable_code]}])]
break from_residual(residual),
Continue { 0: val } => #[allow(unreachable_code)]
Continue { 0: val } =>
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Outer,
lint_instances: [unreachable_code]}])]
val,
})
}, Option<String>)
@@ -368,9 +382,15 @@ mod expressions {
fn expr_try() {
let expr;
match branch(expr) {
Break { 0: residual } => #[allow(unreachable_code)]
Break { 0: residual } =>
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Outer,
lint_instances: [unreachable_code]}])]
return from_residual(residual),
Continue { 0: val } => #[allow(unreachable_code)]
Continue { 0: val } =>
#[attr = LintAttributes([LintAttribute {kind: Allow,
attr_style: Outer,
lint_instances: [unreachable_code]}])]
val,
};
}
@@ -1,12 +1,13 @@
//@ compile-flags: -Zunpretty=hir
//@ check-pass
#![expect(incomplete_features)]
#![allow(dead_code)]
#![attr = Feature([min_generic_const_args#0, adt_const_params#0])]
#![attr = LintAttributes([LintAttribute {kind: Expect, attr_style: Inner,
lint_instances: [incomplete_features]}, LintAttribute {kind: Allow,
attr_style: Inner, lint_instances: [dead_code]}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
//@ compile-flags: -Zunpretty=hir
//@ check-pass
use std::marker::ConstParamTy;
@@ -1,3 +1,8 @@
#![attr = LintAttributes([LintAttribute {kind: Allow, attr_style: Inner,
lint_instances: [dead_code]}])]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
// Regression test for the ICE described in #82328. The pretty-printer for
// `-Zunpretty=hir,typed` would previously retrieve type-checking results
// when entering a body, which means that type information was not available
@@ -7,10 +12,6 @@
//@ check-pass
//@ compile-flags: -Zunpretty=hir,typed
//@ edition: 2015
#![allow(dead_code)]
extern crate std;
#[attr = PreludeImport]
use ::std::prelude::rust_2015::*;
fn main() ({ } as ())
@@ -18,8 +18,8 @@ fn foo<'a, T>()
#[should_panic] 'a: 'static, //~ ERROR attribute cannot be used on
#[macro_use] T: Trait, //~ ERROR attribute cannot be used on
#[macro_use] 'a: 'static, //~ ERROR attribute cannot be used on
#[allow(unused)] T: Trait, //~ ERROR most attributes are not supported in `where` clauses
#[allow(unused)] 'a: 'static, //~ ERROR most attributes are not supported in `where` clauses
#[allow(unused)] T: Trait, //~ ERROR attribute cannot be used on
#[allow(unused)] 'a: 'static, //~ ERROR attribute cannot be used on
#[deprecated] T: Trait, //~ ERROR attribute cannot be used on
#[deprecated] 'a: 'static, //~ ERROR attribute cannot be used on
#[automatically_derived] T: Trait, //~ ERROR attribute cannot be used on
@@ -74,21 +74,21 @@ LL | #[macro_use] 'a: 'static,
|
= help: `#[macro_use]` can be applied to crates, extern crates, and modules
error: most attributes are not supported in `where` clauses
error: `#[allow]` attribute cannot be used on where predicates
--> $DIR/unsupported_attribute.rs:21:5
|
LL | #[allow(unused)] T: Trait,
| ^^^^^^^^^^^^^^^^
|
= help: only `#[cfg]` and `#[cfg_attr]` are supported
= help: `#[allow]` can be applied to associated consts, associated types, const parameters, const parameters, constants, crates, data types, enum variants, extern crates, foreign modules, foreign statics, function params, functions, global asms, impl blocks, lifetime parameters, lifetime parameters, macro defs, match arms, modules, pattern fields, statics, struct fields, struct fields, trait aliases, traits, type aliases, type parameters, type parameters, and use statements
error: most attributes are not supported in `where` clauses
error: `#[allow]` attribute cannot be used on where predicates
--> $DIR/unsupported_attribute.rs:22:5
|
LL | #[allow(unused)] 'a: 'static,
| ^^^^^^^^^^^^^^^^
|
= help: only `#[cfg]` and `#[cfg_attr]` are supported
= help: `#[allow]` can be applied to associated consts, associated types, const parameters, const parameters, constants, crates, data types, enum variants, extern crates, foreign modules, foreign statics, function params, functions, global asms, impl blocks, lifetime parameters, lifetime parameters, macro defs, match arms, modules, pattern fields, statics, struct fields, struct fields, trait aliases, traits, type aliases, type parameters, type parameters, and use statements
error: `#[deprecated]` attribute cannot be used on where predicates
--> $DIR/unsupported_attribute.rs:23:5