Skip to content

Commit f732e93

Browse files
fix new location of assert_matches after last-minute stabilisation revert (rust-lang/rust#154999)
1 parent 1572b37 commit f732e93

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ fn main() {
66
let ac = autocfg::new();
77
stable_feature(&ac, "assert_matches");
88

9+
autocfg::emit_possibility("assert_matches_in_module");
10+
let code = r#"
11+
#![feature(assert_matches)]
12+
use std::assert_matches::assert_matches;
13+
"#;
14+
if ac.probe_raw(code).is_ok() {
15+
autocfg::emit("assert_matches_in_module");
16+
}
17+
918
stable_feature(&ac, "let_chains");
1019

1120
stable_feature(&ac, "if_let_guard");

tests/test_usage.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#![feature(try_trait_v2)]
55
#![feature(try_trait_v2_residual)]
66

7-
#[cfg(not(stable_assert_matches))]
7+
#[cfg(assert_matches_in_module)]
88
use std::assert_matches::assert_matches;
99

10-
#[cfg(stable_assert_matches)]
10+
#[cfg(not(assert_matches_in_module))]
1111
use std::assert_matches;
1212

1313
use try_v2::{Try, Try_ConvertResult};

0 commit comments

Comments
 (0)