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 6e73868

Browse files
committedDec 3, 2024
Show that a test fails on the new solver, too
1 parent c1e3455 commit 6e73868

3 files changed

+24
-1
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: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`.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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
33
|
44
LL | impl<T> Trait<T> for T {
55
| ---------------------- first implementation here

‎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)]
@@ -6,6 +9,7 @@ mod defining_scope {
69
pub type Alias<T> = impl Sized;
710

811
pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
12+
//[next]~^ ERROR: type annotations needed
913
x
1014
}
1115
}

0 commit comments

Comments
 (0)
Failed to load comments.