-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Implement the Fn
trait for bare fn pointers in the compiler
#19449
Conversation
ad91b79
to
e02c49a
Compare
r? @pcwalton |
Could it be that this fixes #19126? 😍 I'll give it a go! |
e02c49a
to
4960a5a
Compare
@japaric that was the idea :) |
4960a5a
to
32252c1
Compare
Very happy to see this being fixed :) |
@nikomatsakis I always get this LLVM assertion:
I'll investigate it later, and open an issue with some minimal reproduction script. (But my guess, is that is something cross-crate related) |
@japaric hmm, ok. I'll add some cross-crate tests. It also occurs to me I forgot to add the cache that I meant to add, so right now it generates fresh adapters as needed. |
The requirement for the |
}; | ||
|
||
let arguments_tuple = ty::mk_tup(self.tcx(), sig.inputs.to_vec()); | ||
let output_type = sig.output.unwrap(); |
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.
Since you cloned the sig above, why not just move inputs
and output
out?
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.
good point, holdover from an older version where I needed the clone for something
…than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions. Fixes rust-lang#19126.
669e59d
to
f2731ff
Compare
…cwalton Implement the `Fn` trait for bare fn pointers in the compiler rather than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions.
Could someone make a snapshot containing this change? This is needed to land the migration to unboxed closures patch. |
One should be on the way! |
Implement the
Fn
trait for bare fn pointers in the compiler ratherthan doing it using hard-coded impls. This means that it works also
for more complex fn types involving bound regions.