-
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.
Method resolution constrains hidden types instead of rejecting method…
… candidates
- Loading branch information
Showing
11 changed files
with
20 additions
and
132 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
error: opaque type's hidden type cannot be another opaque type from the same scope | ||
--> $DIR/issue-70877.rs:31:12 | ||
error[E0282]: type annotations needed | ||
--> $DIR/issue-70877.rs:30:9 | ||
| | ||
LL | let func = bar.next().unwrap(); | ||
| ^^^^ | ||
LL | return func(&"oof"); | ||
| ^^^^^^^^^^^^ one of the two opaque types used here has to be outside its defining scope | ||
| ------------ type must be known at this point | ||
| | ||
note: opaque type whose hidden type is being assigned | ||
--> $DIR/issue-70877.rs:28:19 | ||
help: consider giving `func` an explicit type | ||
| | ||
LL | fn oof(_: Foo) -> impl std::fmt::Debug { | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
note: opaque type being used as hidden type | ||
--> $DIR/issue-70877.rs:4:15 | ||
| | ||
LL | type FooRet = impl std::fmt::Debug; | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
LL | let func: /* Type */ = bar.next().unwrap(); | ||
| ++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.