Skip to content

Commit 87a6300

Browse files
committedJan 25, 2024
1 parent 42d13f8 commit 87a6300

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
 

‎tests/ui/unconditional_recursion.rs

+24
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,30 @@ mod issue12154 {
321321
*other == *self
322322
}
323323
}
324+
325+
// Issue #12181 but also fixed by the same PR
326+
struct Foo;
327+
328+
impl Foo {
329+
fn as_str(&self) -> &str {
330+
"Foo"
331+
}
332+
}
333+
334+
impl PartialEq for Foo {
335+
fn eq(&self, other: &Self) -> bool {
336+
self.as_str().eq(other.as_str())
337+
}
338+
}
339+
340+
impl<T> PartialEq<T> for Foo
341+
where
342+
for<'a> &'a str: PartialEq<T>,
343+
{
344+
fn eq(&self, other: &T) -> bool {
345+
(&self.as_str()).eq(other)
346+
}
347+
}
324348
}
325349

326350
fn main() {}

0 commit comments

Comments
 (0)