Skip to content

Conversation

WaffleLapkin
Copy link
Member

Peek 2022-12-29 01-40

Fixes #11843

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 28, 2022
// The ok-ish type that is expected from the last expression
let ok_ty = self.resolve_associated_type(try_ty.clone(), self.resolve_ops_try_ok());

self.with_breakable_ctx(BreakableKind::Block, ok_ty.clone(), None, |this| {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that BreakableKind::Block is entirely correct, but as long as we do not check that Expr::Try is in a context where it can be used, this does not matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ye I imagine we'd need to add a new variant here once we check whether Expr::Try is in a correct context (we did for a week with an implementation I did, but that caused too many problems due to some things missing).

@Veykril
Copy link
Member

Veykril commented Dec 30, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Dec 30, 2022

📌 Commit aaa682c has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 30, 2022

⌛ Testing commit aaa682c with merge ea8897c...

@bors
Copy link
Contributor

bors commented Dec 30, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing ea8897c to master...

@bors bors merged commit ea8897c into rust-lang:master Dec 30, 2022
@WaffleLapkin WaffleLapkin deleted the typeck_try{} branch January 9, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try blocks give false errors (type-mismatch false positive)
4 participants