Skip to content

Commit 240bc38

Browse files
committed
Delete no_non_exhaustive configuration
1 parent 5cd9f02 commit 240bc38

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

build.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,13 @@ fn main() {
1111
};
1212

1313
if compiler >= 80 {
14-
println!("cargo:rustc-check-cfg=cfg(no_non_exhaustive)");
1514
println!("cargo:rustc-check-cfg=cfg(no_nonzero_bitscan)");
1615
println!("cargo:rustc-check-cfg=cfg(no_str_strip_prefix)");
1716
println!("cargo:rustc-check-cfg=cfg(no_track_caller)");
1817
println!("cargo:rustc-check-cfg=cfg(no_unsafe_op_in_unsafe_fn_lint)");
1918
println!("cargo:rustc-check-cfg=cfg(test_node_semver)");
2019
}
2120

22-
if compiler < 40 {
23-
// #[non_exhaustive].
24-
// https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html#non_exhaustive-structs-enums-and-variants
25-
println!("cargo:rustc-cfg=no_non_exhaustive");
26-
}
27-
2821
if compiler < 45 {
2922
// String::strip_prefix.
3023
// https://doc.rust-lang.org/std/primitive.str.html#method.strip_prefix

src/display.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ impl Display for Comparator {
5656
Op::Tilde => "~",
5757
Op::Caret => "^",
5858
Op::Wildcard => "",
59-
#[cfg(no_non_exhaustive)]
60-
Op::__NonExhaustive => unreachable!(),
6159
};
6260
formatter.write_str(op)?;
6361
write!(formatter, "{}", self.major)?;

src/eval.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ fn matches_impl(cmp: &Comparator, ver: &Version) -> bool {
3636
Op::LessEq => matches_exact(cmp, ver) || matches_less(cmp, ver),
3737
Op::Tilde => matches_tilde(cmp, ver),
3838
Op::Caret => matches_caret(cmp, ver),
39-
#[cfg(no_non_exhaustive)]
40-
Op::__NonExhaustive => unreachable!(),
4139
}
4240
}
4341

src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ pub struct Comparator {
250250
/// - &ensp;**`I.J.*`**&emsp;&mdash;&emsp;equivalent to `=I.J`
251251
/// - &ensp;**`I.*`**&ensp;or&ensp;**`I.*.*`**&emsp;&mdash;&emsp;equivalent to `=I`
252252
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
253-
#[cfg_attr(not(no_non_exhaustive), non_exhaustive)]
253+
#[non_exhaustive]
254254
pub enum Op {
255255
Exact,
256256
Greater,
@@ -260,10 +260,6 @@ pub enum Op {
260260
Tilde,
261261
Caret,
262262
Wildcard,
263-
264-
#[cfg(no_non_exhaustive)] // rustc <1.40
265-
#[doc(hidden)]
266-
__NonExhaustive,
267263
}
268264

269265
/// Optional pre-release identifier on a version string. This comes after `-` in

0 commit comments

Comments
 (0)