Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b9e0e6c

Browse files
committedJul 25, 2024
Show that a test fails on the new solver, too
1 parent 7fd53c3 commit b9e0e6c

3 files changed

+25
-2
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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`.

‎tests/ui/auto-traits/opaque_type_candidate_selection.stderr ‎tests/ui/auto-traits/opaque_type_candidate_selection.old.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0284]: type annotations needed
2-
--> $DIR/opaque_type_candidate_selection.rs:8:20
2+
--> $DIR/opaque_type_candidate_selection.rs:11:20
33
|
44
LL | pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
55
| ^ cannot infer type
66
|
77
= note: cannot satisfy `<Alias<T> as Trait<T>>::Assoc == _`
88
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
1010
|
1111
LL | struct Container<T: Trait<U>, U> {
1212
| ^^^^^^^^^

‎tests/ui/auto-traits/opaque_type_candidate_selection.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//@revisions: old next
2+
//@[next] compile-flags: -Znext-solver
3+
14
//! used to ICE: #119272
25
36
#![feature(type_alias_impl_trait)]
@@ -23,6 +26,7 @@ impl<T> Trait<T> for T {
2326
type Assoc = Box<u32>;
2427
}
2528
impl<T> Trait<T> for defining_scope::Alias<T> {
29+
//[next]~^ ERROR conflicting implementations of trait
2630
type Assoc = usize;
2731
}
2832

0 commit comments

Comments
 (0)
Failed to load comments.