-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Inline direct calls to transmute_copy
in the frontend
#15398
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Does this still need to be done? Did anyone investigate it? The issue is not currently very actionable. Cc @rust-lang/compiler @rust-lang/wg-codegen @rust-lang/wg-compiler-performance |
are there enough |
#91743 should cause |
That PR was merged so I am closing this on the presumption that it is happening just fine now and that if we need followups on that PR it can be tracked in another issue. |
It doesn't get inlined. I think the body of |
Welp, my bad! Thank you for catching that, @bjorn3. |
…r=lnicola Don't provide `generate_default_from_new` when impl self ty is missing Also don't provide the assist when the `Default` trait can't be found. Part of rust-lang#15398
…nicola minor: Remove `unwrap` from `Remove dbg!` Part of rust-lang#15398.
…rts, r=lnicola minor : Deunwrap remove_unused_imports rust-lang#15398 Subtask 3
…_return, r=Veykril minor : Deunwrap convert_to_guarded_return Closes subtask 12 of rust-lang#15398
…methods, r=Veykril minor : Deunwrap generate_delegate_methods rust-lang#15398 subtask 8
…=lnicola minor : Deunwrap generate_derive rust-lang#15398 subtask 1. Since the editing closure has arms, I did something *experimental* ( in this case just a clever term for bad code ) to bypass creating an `Option` but I am ready to change this.
…n_result, r=Veykril minor : Deunwrap wrap_return_type_in_result rust-lang#15398 subtask 7
…r=Veykril minor : Deunwrap extract_function rust-lang#15398 subtask 5.
With current nightly and debug mode I get this:
while with release mode I get
Unless the call should also be inlined in debug mode, I'd say this works as expected. |
…kril minor : Deunwrap inline call rust-lang#15398 subtask 4. There is still one instance of unwrap, which I found pretty hard to change.
…arms, r=Veykril Deunwrap add_missing_match_arms Last subtask of rust-lang#15398
…ock, r=Veykril minor : Deunwrap convert_comment_block and desugar_doc_comment Closes subtask 13 of rust-lang#15398 . I still don't know a more idiomatic way for the for loops I added, any suggestion would make me happy.
When we see a direct call to
mem::transmute_copy
, we should just inline it in the frontend. This has two important benefits, one obvious and one not-so-obvious: (1) it reduces compilation time; (2) it can sometimes avoid onememcpy
by translating the destination in place if the argument is an rvalue.The text was updated successfully, but these errors were encountered: