Skip to content

Commit c3038d0

Browse files
Add ui test for incompatible_msrv lint
1 parent 5d811a4 commit c3038d0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/ui/incompatible_msrv.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![warn(clippy::incompatible_msrv)]
2+
#![feature(custom_inner_attributes)]
3+
#![clippy::msrv = "1.10.0"]
4+
5+
use std::collections::hash_map::Entry;
6+
use std::collections::HashMap;
7+
8+
fn foo() {
9+
let mut map: HashMap<&str, u32> = HashMap::new();
10+
// Stable since 1.10, so should not warn.
11+
assert_eq!(map.entry("poneyland").key(), &"poneyland");
12+
if let Entry::Vacant(v) = map.entry("poneyland") {
13+
v.into_key();
14+
//~^ ERROR: bla
15+
}
16+
}
17+
18+
fn main() {}

0 commit comments

Comments
 (0)