File tree Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Expand file tree Collapse file tree 3 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( generic_const_exprs) ]
2+ #![ feature( specialization) ]
3+ #![ allow( incomplete_features) ]
4+
5+ //--------------------------------------------------
6+
7+ trait Depth {
8+ const C : usize ;
9+ }
10+
11+ trait Type {
12+ type AT : Depth ;
13+ }
14+
15+ //--------------------------------------------------
16+
17+ enum Predicate < const B : bool > { }
18+
19+ trait Satisfied { }
20+
21+ impl Satisfied for Predicate < true > { }
22+
23+ //--------------------------------------------------
24+
25+ trait Spec1 { }
26+
27+ impl < T : Type > Spec1 for T where Predicate < { T :: AT :: C > 0 } > : Satisfied { }
28+
29+ trait Spec2 { }
30+
31+ //impl<T: Type > Spec2 for T where Predicate<{T::AT::C > 1}>: Satisfied {}
32+ impl < T : Type > Spec2 for T where Predicate < true > : Satisfied { }
33+
34+ //--------------------------------------------------
35+
36+ trait Foo {
37+ fn Bar ( ) ;
38+ }
39+
40+ impl < T : Spec1 > Foo for T {
41+ default fn Bar ( ) { }
42+ }
43+
44+ impl < T : Spec2 > Foo for T {
45+ //~^ ERROR conflicting implementations of trait
46+ fn Bar ( ) { }
47+ }
48+
49+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0119]: conflicting implementations of trait `Foo`
2+ --> $DIR/issue-72845.rs:44:1
3+ |
4+ LL | impl<T: Spec1> Foo for T {
5+ | ------------------------ first implementation here
6+ ...
7+ LL | impl<T: Spec2> Foo for T {
8+ | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
9+
10+ error: aborting due to previous error
11+
12+ For more information about this error, try `rustc --explain E0119`.
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed
2020LL | let x: &'static i32 = &X;
2121 | ^ referenced constant has errors
2222query stack during panic:
23- #0 [normalize_mir_const_after_erasing_regions ] normalizing `main::promoted[1]`
23+ #0 [try_normalize_mir_const_after_erasing_regions ] normalizing `main::promoted[1]`
2424#1 [optimized_mir] optimizing MIR for `main`
2525#2 [collect_and_partition_mono_items] collect_and_partition_mono_items
2626end of query stack
You can’t perform that action at this time.
0 commit comments