Skip to content

Commit

Permalink
Show that a test fails on the new solver, too
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 3, 2024
1 parent 3b2d0ec commit 6aa66e4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tests/ui/auto-traits/opaque_type_candidate_selection.next.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0119]: conflicting implementations of trait `Trait<_>`
--> $DIR/opaque_type_candidate_selection.rs:28:1
|
LL | impl<T> Trait<T> for T {
| ---------------------- first implementation here
...
LL | impl<T> Trait<T> for defining_scope::Alias<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation

error[E0282]: type annotations needed
--> $DIR/opaque_type_candidate_selection.rs:11:23
|
LL | pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
| ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0119, E0282.
For more information about an error, try `rustc --explain E0119`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Trait<_>`
--> $DIR/opaque_type_candidate_selection.rs:24:1
--> $DIR/opaque_type_candidate_selection.rs:28:1
|
LL | impl<T> Trait<T> for T {
| ---------------------- first implementation here
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/auto-traits/opaque_type_candidate_selection.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//@revisions: old next
//@[next] compile-flags: -Znext-solver

//! used to ICE: #119272
#![feature(type_alias_impl_trait)]
Expand All @@ -6,6 +9,7 @@ mod defining_scope {
pub type Alias<T> = impl Sized;

pub fn cast<T>(x: Container<Alias<T>, T>) -> Container<T, T> {
//[next]~^ ERROR: type annotations needed
x
}
}
Expand Down

0 comments on commit 6aa66e4

Please sign in to comment.