-
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
Suggest returning closure as impl Fn
#101019
Suggest returning closure as impl Fn
#101019
Conversation
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
p!(")"); | ||
|
||
if !sig.output().is_unit() { | ||
p!(" -> ", print(sig.output())); |
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 happens if one of the printed types is an APIT?
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 don't think APITs are is_suggestable
. I can try tho
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.
Confirmed that this falls back to the old suggestion and doesn't suggest something like -> Fn() -> impl Fn()
or anything like that. Added test for it.
@bors r+ |
…gestion, r=cjgillot Suggest returning closure as `impl Fn` Fixes rust-lang#100936
Rollup of 9 pull requests Successful merges: - rust-lang#95376 (Add `vec::Drain{,Filter}::keep_rest`) - rust-lang#100092 (Fall back when relating two opaques by substs in MIR typeck) - rust-lang#101019 (Suggest returning closure as `impl Fn`) - rust-lang#101022 (Erase late bound regions before comparing types in `suggest_dereferences`) - rust-lang#101101 (interpret: make read-pointer-as-bytes a CTFE-only error with extra information) - rust-lang#101123 (Remove `register_attr` feature) - rust-lang#101175 (Don't --bless in pre-push hook) - rust-lang#101176 (rustdoc: remove unused CSS selectors for `.table-display`) - rust-lang#101180 (Add another MaybeUninit array test with const) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #100936