Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
Thanks Ralf for document it. Also are you interested in writing this part in Reference? |
Do you think the reference should repeat the same information? That seems a bit strange... |
|
I don't know if function items and function pointer concepts belong to language or just Rust implementation. |
|
I don't think that the documentation added in this PR belongs in the reference, though ideally we'd eventually document the rules on when coercion takes place and what kinds of coercion exist. I don't think we need to do that now, though. r=me with commits squashed |
|
I mean, this is not implementation-specific, it is a general Rust thing. But then so is much of what is documented in the standard library. |
|
@bors r=Mark-Simulacrum rollup |
|
📌 Commit 47739bb481ca43e565cf13cbe7990c9fbfc1bcd4 has been approved by |
library/std/src/primitive_docs.rs
Outdated
There was a problem hiding this comment.
Can we mention that function item value doesn't store actual function pointer?
There was a problem hiding this comment.
What do you mean? It is a zero-sized type; it cannot store anything?
There was a problem hiding this comment.
I mean to make it clear and to confirm that function item doesn't contain function pointer.
Otherwise peple may think that *&bar will deref to function pointer.
@LukasKalbertodt has a related answer on stackoverflow: https://stackoverflow.com/a/54629954/5456794
There was a problem hiding this comment.
I think that it is fine as-is, but you are of course welcome to submit follow-up PRs with specific language.
There was a problem hiding this comment.
I like some of the wording in that post and will try to incorporate it.
There was a problem hiding this comment.
@RalfJung In case with "that post" you are talking about my StackOverflow answer, note that it is licensed as CC0 (which I also state on my profile). So feel free to copy whatever you want. Just FYI.
There was a problem hiding this comment.
@LukasKalbertodt that's great, thanks! I am not sure if individual sentences are copyrighted but this means I do not have to worry. :D
|
@bors r- |
|
@bors r=Mark-Simulacrum rollup |
|
📌 Commit 2338903 has been approved by |
Rollup of 12 pull requests Successful merges: - rust-lang#74650 (Correctly parse `{} && false` in tail expression) - rust-lang#75319 (Fix ICE rust-lang#75307 in `format`) - rust-lang#75417 (Don't spill operands onto the stack in naked functions) - rust-lang#75452 (self-profile: Cache more query key strings when doing self-profiling.) - rust-lang#75459 (fix LocalInfo doc comment) - rust-lang#75462 (Remove unused tcx parameter) - rust-lang#75467 (Fix E0741 error code explanation) - rust-lang#75471 (Change registered "program name" for -Cllvm-args usage messages) - rust-lang#75477 (Expand function pointer docs) - rust-lang#75479 (make rustc-docs component available to rustup) - rust-lang#75496 (Prioritization WG: Open Zulip topics only for `I-prioritize` issues) - rust-lang#75500 (Disable zlib in LLVM on aarch64-apple-darwin) Failed merges: r? @ghost
Be more explicit in the ABI section, and add a section on how to obtain a function pointer, which can be somewhat confusing.
Cc #75239