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

fix: manual_unwrap_or_default suggests error when expression is a None variant #12688

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

t-webber
Copy link

Suggesting error when expression is none : None.unwrap_or_default() raises an error, as explained in the following issue:

fixes #12670

changelog: [manual_unwrap_or_default]: the lint is ignored when matching None, as the unwrap_or_default method can't infer the type of a None variant.

@rustbot
Copy link
Collaborator

rustbot commented Apr 17, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Jarcho (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 17, 2024
@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 18, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@t-webber t-webber force-pushed the fix_manual_unwrap_or_default branch from dcaf974 to 1fd8241 Compare April 18, 2024 10:38
@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 18, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 18, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git rebase -i master
$ # delete any merge commits in the editor that appears
$ git push --force-with-lease

The following commits are merge commits:

@t-webber t-webber force-pushed the fix_manual_unwrap_or_default branch 2 times, most recently from 988b08b to c6167c3 Compare April 18, 2024 19:06
@t-webber t-webber force-pushed the fix_manual_unwrap_or_default branch from c6167c3 to c9f0374 Compare April 18, 2024 21:22
@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Apr 18, 2024
@J-ZhengLi
Copy link
Member

@y21 since you have already reviewed this, do you want to take it over? 😄

(Jarcho has SO many open PR assigned already, and judging by their contribution graph, I assume they might've been busy lately?)

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.

manual_unwrap_or_default suggested fix fails to compile due to missing type annotation
5 participants