This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ aux-build: anyid-repro-125197.rs
2+ //@ check-pass
3+
4+ // Makes sure that we don't check `specializes(impl1, impl2)` for a pair of impls that don't
5+ // actually participate in specialization. Since <https://github.com/rust-lang/rust/pull/122791>,
6+ // we don't treat inductive cycles as errors -- so we may need to winnow more pairs of impls, and
7+ // we try to winnow impls in favor of other impls. However, if we're *inside* the `specializes`
8+ // query, then may have a query cycle if we call `specializes` again!
9+
10+ extern crate anyid_repro_125197;
11+ use anyid_repro_125197:: AnyId ;
12+
13+ fn main ( ) {
14+ let x = "hello, world" ;
15+ let y: AnyId = x. into ( ) ;
16+ let _ = y == x;
17+ }
Original file line number Diff line number Diff line change 1+ use std:: fmt:: Display ;
2+ use std:: sync:: Arc ;
3+
4+ pub struct AnyId ( ( ) ) ;
5+
6+ impl PartialEq < Self > for AnyId {
7+ fn eq ( & self , _: & Self ) -> bool {
8+ todo ! ( )
9+ }
10+ }
11+
12+ impl < T : Identifier > PartialEq < T > for AnyId {
13+ fn eq ( & self , _: & T ) -> bool {
14+ todo ! ( )
15+ }
16+ }
17+
18+ impl < T : Identifier > From < T > for AnyId {
19+ fn from ( _: T ) -> Self {
20+ todo ! ( )
21+ }
22+ }
23+
24+ pub trait Identifier : Display + ' static { }
25+
26+ impl < T > Identifier for T where T : PartialEq + Display + ' static { }
You can’t perform that action at this time.
0 commit comments