3 files changed +24
-1
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:23
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[E0119]: conflicting implementations of trait `Trait<_>`
2
- --> $DIR/opaque_type_candidate_selection.rs:24 :1
2
+ --> $DIR/opaque_type_candidate_selection.rs:28 :1
3
3
|
4
4
LL | impl<T> Trait<T> for T {
5
5
| ---------------------- first implementation here
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) ]
@@ -6,6 +9,7 @@ mod defining_scope {
6
9
pub type Alias < T > = impl Sized ;
7
10
8
11
pub fn cast < T > ( x : Container < Alias < T > , T > ) -> Container < T , T > {
12
+ //[next]~^ ERROR: type annotations needed
9
13
x
10
14
}
11
15
}
0 commit comments