File tree 6 files changed +8
-18
lines changed
tools/clippy/tests/ui-toml/macro_metavars_in_unsafe/default
6 files changed +8
-18
lines changed Original file line number Diff line number Diff line change 5
5
#![ allow( internal_features) ]
6
6
#![ allow( rustc:: diagnostic_outside_of_impl) ]
7
7
#![ allow( rustc:: untranslatable_diagnostic) ]
8
+ #![ cfg_attr( bootstrap, feature( lint_reasons) ) ]
8
9
#![ doc( html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/" ) ]
9
10
#![ doc( rust_logo) ]
10
11
#![ feature( assert_matches) ]
11
12
#![ feature( box_patterns) ]
12
13
#![ feature( decl_macro) ]
13
14
#![ feature( if_let_guard) ]
14
15
#![ feature( let_chains) ]
15
- #![ cfg_attr( bootstrap, feature( lint_reasons) ) ]
16
16
#![ feature( proc_macro_internals) ]
17
17
#![ feature( proc_macro_quote) ]
18
18
#![ feature( rustdoc_internals) ]
Original file line number Diff line number Diff line change @@ -608,7 +608,7 @@ declare_lint! {
608
608
}
609
609
610
610
declare_lint ! {
611
- /// The `unfulfilled_lint_expectations` lint warns if a lint expectation is
611
+ /// The `unfulfilled_lint_expectations` lint detects when a lint expectation is
612
612
/// unfulfilled.
613
613
///
614
614
/// ### Example
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ fn main() {
47
47
#[expect(unused_variables)]
48
48
let unused = " Everyone ignores me" ;
49
49
50
- #[expect(unused_variables)]
51
- let used = " I'm useful" ;
50
+ #[expect(unused_variables)] // `unused_variables` lint is not emitted
51
+ let used = " I'm useful" ; // the expectation is therefore unfulfilled
52
52
println! (" The `used` value is equal to: {:?}" , used );
53
53
}
54
54
```
@@ -65,8 +65,8 @@ warning: this lint expectation is unfulfilled
65
65
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
66
66
```
67
67
68
- This level can only be defined via the ` #[expect] ` attribute and not via the
69
- console . Lints with the special 'force-warn' lint will still be emitted as usual.
68
+ This level can only be defined via the ` #[expect] ` attribute, there is no equivalent
69
+ flag . Lints with the special 'force-warn' level will still be emitted as usual.
70
70
71
71
## warn
72
72
Original file line number Diff line number Diff line change 1
1
//! Tests macro_metavars_in_unsafe with default configuration
2
- #![ feature( decl_macro, lint_reasons ) ]
2
+ #![ feature( decl_macro) ]
3
3
#![ warn( clippy:: macro_metavars_in_unsafe) ]
4
4
#![ allow( clippy:: no_effect) ]
5
5
Original file line number Diff line number Diff line change 1
- error: the feature `lint_reasons` has been stable since 1.81.0-dev and no longer requires an attribute to enable
2
- --> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:2:24
3
- |
4
- LL | #![feature(decl_macro, lint_reasons)]
5
- | ^^^^^^^^^^^^
6
- |
7
- = note: `-D stable-features` implied by `-D warnings`
8
- = help: to override `-D warnings` add `#[allow(stable_features)]`
9
-
10
1
error: this macro expands metavariables in an unsafe block
11
2
--> tests/ui-toml/macro_metavars_in_unsafe/default/test.rs:19:9
12
3
|
@@ -192,5 +183,5 @@ LL | | }
192
183
= help: consider expanding any metavariables outside of this block, e.g. by storing them in a variable
193
184
= help: ... or also expand referenced metavariables in a safe context to require an unsafe block at callsite
194
185
195
- error: aborting due to 15 previous errors
186
+ error: aborting due to 14 previous errors
196
187
Original file line number Diff line number Diff line change 2
2
3
3
#![ allow( stable_features) ]
4
4
#![ feature( cfg_target_feature) ]
5
- #![ feature( lint_reasons) ]
6
5
7
6
use std:: env;
8
7
You can’t perform that action at this time.
0 commit comments