Skip to content

Commit f7b9d03

Browse files
Update error message to be clearer
1 parent fb77402 commit f7b9d03

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clippy_lints/src/incompatible_msrv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl IncompatibleMsrv {
9999
INCOMPATIBLE_MSRV,
100100
span,
101101
&format!(
102-
"current MSRV is `{}` but this item is stable since `{version}`",
102+
"current MSRV (Minimum Supported Rust Version) is `{}` but this item is stable since `{version}`",
103103
self.msrv
104104
),
105105
);

tests/ui/incompatible_msrv.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ use std::time::Duration;
99

1010
fn foo() {
1111
let mut map: HashMap<&str, u32> = HashMap::new();
12-
// Stable since 1.10, so should not warn.
1312
assert_eq!(map.entry("poneyland").key(), &"poneyland");
13+
//~^ ERROR: is `1.3.0` but this item is stable since `1.10.0`
1414
if let Entry::Vacant(v) = map.entry("poneyland") {
1515
v.into_key();
16-
//~^ ERROR: MSRV is `1.3.0` but this item is stable since `1.12.0`
16+
//~^ ERROR: is `1.3.0` but this item is stable since `1.12.0`
1717
}
1818
// Should warn for `sleep` but not for `Duration` (which was added in `1.3.0`).
1919
sleep(Duration::new(1, 0));
20-
//~^ ERROR: MSRV is `1.3.0` but this item is stable since `1.4.0`
20+
//~^ ERROR: is `1.3.0` but this item is stable since `1.4.0`
2121
}
2222

2323
fn main() {}

tests/ui/incompatible_msrv.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
error: current MSRV is `1.3.0` but this item is stable since `1.10.0`
2-
--> $DIR/incompatible_msrv.rs:13:39
1+
error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.10.0`
2+
--> $DIR/incompatible_msrv.rs:12:39
33
|
44
LL | assert_eq!(map.entry("poneyland").key(), &"poneyland");
55
| ^^^^^
66
|
77
= note: `-D clippy::incompatible-msrv` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::incompatible_msrv)]`
99

10-
error: current MSRV is `1.3.0` but this item is stable since `1.12.0`
10+
error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.12.0`
1111
--> $DIR/incompatible_msrv.rs:15:11
1212
|
1313
LL | v.into_key();
1414
| ^^^^^^^^^^
1515

16-
error: current MSRV is `1.3.0` but this item is stable since `1.4.0`
16+
error: current MSRV (Minimum Supported Rust Version) is `1.3.0` but this item is stable since `1.4.0`
1717
--> $DIR/incompatible_msrv.rs:19:5
1818
|
1919
LL | sleep(Duration::new(1, 0));

0 commit comments

Comments
 (0)