3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change
1
+ error[E0119]: conflicting implementations of trait `Trait<_>`
2
+ --> $DIR/opaque_type_candidate_selection.rs:28:1
3
+ |
4
+ LL | impl<T> Trait<T> for T {
5
+ | ---------------------- first implementation here
6
+ ...
7
+ LL | impl<T> Trait<T> for defining_scope::Alias<T> {
8
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
9
+
10
+ error[E0282]: type annotations needed
11
+ --> $DIR/opaque_type_candidate_selection.rs:11:20
12
+ |
13
+ LL | pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
14
+ | ^ cannot infer type
15
+
16
+ error: aborting due to 2 previous errors
17
+
18
+ Some errors have detailed explanations: E0119, E0282.
19
+ For more information about an error, try `rustc --explain E0119`.
Original file line number Diff line number Diff line change 1
1
error[E0284]: type annotations needed
2
- --> $DIR/opaque_type_candidate_selection.rs:8 :20
2
+ --> $DIR/opaque_type_candidate_selection.rs:11 :20
3
3
|
4
4
LL | pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
5
5
| ^ cannot infer type
6
6
|
7
7
= note: cannot satisfy `<Alias<T> as Trait<T>>::Assoc == _`
8
8
note: required because it appears within the type `Container<Alias<T>, T>`
9
- --> $DIR/opaque_type_candidate_selection.rs:14 :8
9
+ --> $DIR/opaque_type_candidate_selection.rs:17 :8
10
10
|
11
11
LL | struct Container<T: Trait<U>, U> {
12
12
| ^^^^^^^^^
Original file line number Diff line number Diff line change
1
+ //@revisions: old next
2
+ //@[next] compile-flags: -Znext-solver
3
+
1
4
//! used to ICE: #119272
2
5
3
6
#![ feature( type_alias_impl_trait) ]
@@ -23,6 +26,7 @@ impl<T> Trait<T> for T {
23
26
type Assoc = Box < u32 > ;
24
27
}
25
28
impl < T > Trait < T > for defining_scope:: Alias < T > {
29
+ //[next]~^ ERROR conflicting implementations of trait
26
30
type Assoc = usize ;
27
31
}
28
32
0 commit comments