-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize opaques before defining them in the new solver
- Loading branch information
1 parent
5333b87
commit e4952af
Showing
19 changed files
with
136 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/ui/impl-trait/issues/issue-83919.stderr → ...l-trait/issues/issue-83919.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-83919.rs:25:9 | ||
| | ||
LL | fn get_fut(&self) -> Self::Fut { | ||
| --------- expected `<Implementor as Foo>::Fut` because of return type | ||
LL | | ||
LL | / async move { | ||
LL | | | ||
LL | | 42 | ||
LL | | // 42 does not impl Future and rustc does actually point out the error, | ||
LL | | // but rustc used to panic. | ||
LL | | // Putting a valid Future here always worked fine. | ||
LL | | } | ||
| |_________^ types differ | ||
| | ||
= note: expected associated type `<Implementor as Foo>::Fut` | ||
found `async` block `{async block@$DIR/issue-83919.rs:25:9: 31:10}` | ||
= help: consider constraining the associated type `<Implementor as Foo>::Fut` to `{async block@$DIR/issue-83919.rs:25:9: 31:10}` or calling a method that returns `<Implementor as Foo>::Fut` | ||
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../ui/impl-trait/recursive-generator.stderr → ...-trait/recursive-generator.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0720]: cannot resolve opaque type | ||
--> $DIR/recursive-generator.rs:8:13 | ||
| | ||
LL | fn foo() -> impl Generator<Yield = (), Return = ()> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive opaque type | ||
... | ||
LL | let mut gen = Box::pin(foo()); | ||
| ------- generator captures itself here | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0720`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...trait/two_tait_defining_each_other.stderr → ...o_tait_defining_each_other.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...rait/two_tait_defining_each_other3.stderr → ..._tait_defining_each_other3.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
tests/ui/traits/new-solver/opaque-hidden-ty-is-rigid-projection.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// known-bug: unknown | ||
// compile-flags: -Ztrait-solver=next | ||
|
||
fn test<T: Iterator>(x: T::Item) -> impl Sized { | ||
x | ||
} | ||
|
||
fn main() {} |
21 changes: 21 additions & 0 deletions
21
tests/ui/traits/new-solver/opaque-hidden-ty-is-rigid-projection.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/opaque-hidden-ty-is-rigid-projection.rs:5:5 | ||
| | ||
LL | fn test<T: Iterator>(x: T::Item) -> impl Sized { | ||
| ---------- | ||
| | | ||
| the expected opaque type | ||
| expected `impl Sized` because of return type | ||
LL | x | ||
| ^ types differ | ||
| | ||
= note: expected opaque type `impl Sized` | ||
found associated type `<T as Iterator>::Item` | ||
help: consider constraining the associated type `<T as Iterator>::Item` to `impl Sized` | ||
| | ||
LL | fn test<T: Iterator<Item = impl Sized>>(x: T::Item) -> impl Sized { | ||
| +++++++++++++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters