Skip to content

Commit 691c144

Browse files
authored
Rollup merge of rust-lang#131923 - ranger-ross:impl-copy-hash-interrorkind, r=tgross35
Derive `Copy` and `Hash` for `IntErrorKind` This PR derives `Copy` and `Hash` for `IntErrorKind` to make it easier to work with. (see rust-lang#131826) I think an argument could be made to also derive `PartialOrd` + `Ord` as well given that other error kinds in the std like [`io::ErrorKind`](https://doc.rust-lang.org/src/std/io/error.rs.html#212-428) do this. Granted these seem much less useful for errors. Fixes rust-lang#131826
2 parents 0cedc03 + 3b8230d commit 691c144

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/num/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub struct ParseIntError {
7979
/// # }
8080
/// ```
8181
#[stable(feature = "int_error_matching", since = "1.55.0")]
82-
#[derive(Debug, Clone, PartialEq, Eq)]
82+
#[derive(Debug, Clone, PartialEq, Eq, Copy, Hash)]
8383
#[non_exhaustive]
8484
pub enum IntErrorKind {
8585
/// Value being parsed is empty.

0 commit comments

Comments
 (0)