Skip to content

Commit dbb93b9

Browse files
committed
Address review comments and (Hopefully) fix CI
Thanks
1 parent 996564b commit dbb93b9

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

src/doc/rustc/src/lints/levels.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@ talk about later in this section.
3737
## expect
3838

3939
Sometimes, it can be helpful to suppress lints, but at the same time ensure that
40-
the code in question still emits them. The 'expect' level does exactly this, with
41-
it a lint can be expected. If the lint in question is not an emitted, a new lint
42-
`unfulfilled_lint_expectation` at the attribute notifying you that the expectation,
43-
is no longer fulfilled.
40+
the code in question still emits them. The 'expect' level does exactly this. If
41+
the lint in question is not emitted, the `unfulfilled_lint_expectation` lint
42+
triggers on the `expect` attribute, notifying you that the expectation is no
43+
longer fulfilled.
4444

4545
```rust
4646
fn main() {
4747
#[expect(unused_variables)]
4848
let unused = "Everyone ignores me";
4949

5050
#[expect(unused_variables)]
51-
let used = "I'm usefull";
51+
let used = "I'm useful";
5252
println!("The `used` value is equal to: {:?}", used);
5353
}
5454
```
@@ -67,7 +67,6 @@ warning: this lint expectation is unfulfilled
6767

6868
This level can only be defined via the `#[expect]` attribute and not via the
6969
console. Lints with the special 'force-warn' lint will still be emitted as usual.
70-
The fulfillment of expectations is still tracked.
7170

7271
## warn
7372

src/tools/clippy/tests/ui/let_unit.fixed

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-rustfix
22

3-
#![feature(lint_reasons)]
43
#![warn(clippy::let_unit_value)]
54
#![allow(unused, clippy::no_effect, clippy::needless_late_init, path_statements)]
65

src/tools/clippy/tests/ui/let_unit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-rustfix
22

3-
#![feature(lint_reasons)]
43
#![warn(clippy::let_unit_value)]
54
#![allow(unused, clippy::no_effect, clippy::needless_late_init, path_statements)]
65

src/tools/clippy/tests/ui/let_unit.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: this let-binding has unit value
2-
--> $DIR/let_unit.rs:14:5
2+
--> $DIR/let_unit.rs:13:5
33
|
44
LL | let _x = println!("x");
55
| ^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `println!("x");`
66
|
77
= note: `-D clippy::let-unit-value` implied by `-D warnings`
88

99
error: this let-binding has unit value
10-
--> $DIR/let_unit.rs:18:9
10+
--> $DIR/let_unit.rs:17:9
1111
|
1212
LL | let _a = ();
1313
| ^^^^^^^^^^^^ help: omit the `let` binding: `();`
1414

1515
error: this let-binding has unit value
16-
--> $DIR/let_unit.rs:53:5
16+
--> $DIR/let_unit.rs:52:5
1717
|
1818
LL | / let _ = v
1919
LL | | .into_iter()
@@ -36,43 +36,43 @@ LL + .unwrap();
3636
|
3737

3838
error: this let-binding has unit value
39-
--> $DIR/let_unit.rs:80:5
39+
--> $DIR/let_unit.rs:79:5
4040
|
4141
LL | let x: () = f(); // Lint.
4242
| ^^^^-^^^^^^^^^^^
4343
| |
4444
| help: use a wild (`_`) binding: `_`
4545

4646
error: this let-binding has unit value
47-
--> $DIR/let_unit.rs:83:5
47+
--> $DIR/let_unit.rs:82:5
4848
|
4949
LL | let x: () = f2(0i32); // Lint.
5050
| ^^^^-^^^^^^^^^^^^^^^^
5151
| |
5252
| help: use a wild (`_`) binding: `_`
5353

5454
error: this let-binding has unit value
55-
--> $DIR/let_unit.rs:85:5
55+
--> $DIR/let_unit.rs:84:5
5656
|
5757
LL | let _: () = f3(()); // Lint
5858
| ^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f3(());`
5959

6060
error: this let-binding has unit value
61-
--> $DIR/let_unit.rs:86:5
61+
--> $DIR/let_unit.rs:85:5
6262
|
6363
LL | let x: () = f3(()); // Lint
6464
| ^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `f3(());`
6565

6666
error: this let-binding has unit value
67-
--> $DIR/let_unit.rs:102:5
67+
--> $DIR/let_unit.rs:101:5
6868
|
6969
LL | let x: () = if true { f() } else { f2(0) }; // Lint
7070
| ^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7171
| |
7272
| help: use a wild (`_`) binding: `_`
7373

7474
error: this let-binding has unit value
75-
--> $DIR/let_unit.rs:113:5
75+
--> $DIR/let_unit.rs:112:5
7676
|
7777
LL | / let _: () = match Some(0) {
7878
LL | | None => f2(1),
@@ -93,7 +93,7 @@ LL + };
9393
|
9494

9595
error: this let-binding has unit value
96-
--> $DIR/let_unit.rs:160:13
96+
--> $DIR/let_unit.rs:159:13
9797
|
9898
LL | let _: () = z;
9999
| ^^^^^^^^^^^^^^ help: omit the `let` binding: `z;`

0 commit comments

Comments
 (0)