-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tweak borrow error on FnMut
when Fn
is expected
#68816
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
r? @varkor |
8f9dff8
to
532623b
Compare
This comment has been minimized.
This comment has been minimized.
532623b
to
109d5c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good! Just one comment.
LL | fn foo() -> Box<dyn Fn() -> usize> { | ||
| --- ---------------------- ...to return `FnMut` instead of `Fn` | ||
| | | ||
| you might have to change this... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of this message seems reversed with the message above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about in this function...
/...you might have to change this to return FnMut instead
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual text is fine — I'm just inclined to read the topmost line first:
...to return `FnMut` instead of `Fn`
you might have to change this...
when it's intended to be read in the opposite order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the span for the method ident with no label and shortened the wording to change this to return FnMut instead of Fn
, as it seems more consistent with the terseness of the other suggestions we give.
@bors r=varkor based on #68816 (review) |
@bors r=varkor |
📌 Commit d51f2bd has been approved by |
🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened |
Tweak borrow error on `FnMut` when `Fn` is expected Fix rust-lang#31701, fix rust-lang#66097.
Rollup of 8 pull requests Successful merges: - #66498 (Remove unused feature gates) - #68816 (Tweak borrow error on `FnMut` when `Fn` is expected) - #68824 (Enable Control Flow Guard in rustbuild) - #69022 (traits: preallocate 2 Vecs of known initial size) - #69031 (Use `dyn Trait` more in tests) - #69044 (Don't run coherence twice for future-compat lints) - #69047 (Don't rustfmt check the vendor directory.) - #69055 (Clean up E0307 explanation) Failed merges: r? @ghost
Fix #31701, fix #66097.