Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Diagnose some incorrect usages of the question mark operator #13354

Merged
merged 1 commit into from
Oct 16, 2022

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Oct 5, 2022

Trying to figure out how the type stuff in r-a works some more, I think I am doing this correct here but I am not quite sure :)

match self.resolve_try_impl_for(inner_ty.clone()) {
Some((_, Some((output, residual)))) => {
if let Some((_trait, false)) =
self.implements_from_residual(self.return_ty.clone(), residual)
Copy link
Member

Choose a reason for hiding this comment

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

it might not be possible to solve this uniquely at this point, which means we'll miss some cases here -- the proper place to emit these diagnostics would be in resolve_obligations_as_possible, which of course means we have to track where the obligations come from

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, ye I see what you mean. The way this is done shouldn't cause wrong diagnostics though if I see this right, only miss some?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

@Veykril Veykril changed the title Diagnose incorrect usages of the question mark operator Diagnose some incorrect usages of the question mark operator Oct 10, 2022
@Veykril Veykril changed the title Diagnose some incorrect usages of the question mark operator feat: Diagnose some incorrect usages of the question mark operator Oct 10, 2022
@bors
Copy link
Contributor

bors commented Oct 10, 2022

☔ The latest upstream changes (presumably #13329) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril Veykril force-pushed the try-stuff branch 2 times, most recently from 3e8b6ff to 16cf939 Compare October 16, 2022 10:49
@Veykril
Copy link
Member Author

Veykril commented Oct 16, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Oct 16, 2022

📌 Commit 381366f has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 16, 2022

⌛ Testing commit 381366f with merge ee2d9ed...

@bors
Copy link
Contributor

bors commented Oct 16, 2022

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

@bors bors merged commit ee2d9ed into rust-lang:master Oct 16, 2022
@Veykril Veykril deleted the try-stuff branch October 16, 2022 11:25
@lnicola
Copy link
Member

lnicola commented Oct 17, 2022

try-diagnostics.mp4

bors added a commit that referenced this pull request Oct 18, 2022
Revert "feat: Diagnose some incorrect usages of the question mark operator"

Reverts #13354

It seems like we are getting stuck with inference variables here, not just placeholders and errors so there is probably more wrong here that I don't understand. Reverting seems like the best solution right now as I don't have the time to look into this this week.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants