We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42d13f8 commit 87a6300Copy full SHA for 87a6300
tests/ui/unconditional_recursion.rs
@@ -321,6 +321,30 @@ mod issue12154 {
321
*other == *self
322
}
323
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
348
349
350
fn main() {}
0 commit comments