Skip to content

Commit 07b162d

Browse files
committed
Drop PartialEq impl for Regex (fixes rust-lang#178)
1 parent 4332c9c commit 07b162d

File tree

3 files changed

+0
-25
lines changed

3 files changed

+0
-25
lines changed

src/re_unicode.rs

-12
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,6 @@ impl From<Exec> for Regex {
133133
}
134134
}
135135

136-
/// Equality comparison is based on the original string. It is possible that
137-
/// different regular expressions have the same matching behavior, but are
138-
/// still compared unequal. For example, `\d+` and `\d\d*` match the same set
139-
/// of strings, but are not considered equal.
140-
impl PartialEq for Regex {
141-
fn eq(&self, other: &Regex) -> bool {
142-
self.as_str() == other.as_str()
143-
}
144-
}
145-
146-
impl Eq for Regex {}
147-
148136
impl FromStr for Regex {
149137
type Err = Error;
150138

tests/api_str.rs

-6
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,3 @@ fn empty_match_unicode_captures_iter() {
1919
.collect();
2020
assert_eq!(vec![(0, 0), (3, 3), (4, 4), (7, 7), (8, 8)], ms);
2121
}
22-
23-
#[test]
24-
fn eq() {
25-
use regex::Regex;
26-
assert_eq!(regex!(r"[a-z]+"), Regex::new("[a-z]+").unwrap());
27-
}

tests/misc.rs

-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use regex::Regex;
12-
1311
mat!(prefix_literal_match, r"^abc", r"abc", Some((0, 3)));
1412
mat!(prefix_literal_nomatch, r"^abc", r"zabc", None);
1513
mat!(one_literal_edge, r"abc", r"xxxxxab", None);
16-
17-
#[test]
18-
fn eq() {
19-
assert_eq!(regex!(r"[a-z]+"), Regex::new("[a-z]+").unwrap());
20-
}

0 commit comments

Comments
 (0)