You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.
/// This trait is implemented on function pointers with any number of arguments.
impl<Ret,T>Cloneforfn(T) -> Ret{
fnclone(&self) -> Self{
loop{}
}
}
The text was updated successfully, but these errors were encountered:
lcnr
added
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
and removed
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
labels
May 4, 2023
Hi @lcnr ! Sorry it took me a bit to get to this after I claimed it. Just want to make sure I'm understanding correctly what the documentation should look like:
All function pointers implement FnPtr, which means they all implement:
(pulled from the FnPtr docs), and so those traits should be included in the function pointer doc? And then would the dummy impl look something like this:
// Fake impl that's only really used for docs.#[cfg(doc)]#[unstable(feature = "fn_ptr_trait")]#[doc(fake_variadic)]/// This trait is implemented on function pointers with any number of arguments. impl<Ret,T>FnPtrforfn(T) -> Ret{fnaddr(&self) -> *const(){// empty}}
A-docsArea: documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.
Location
https://doc.rust-lang.org/nightly/std/primitive.fn.html#trait-implementations-1
Summary
we now implement all of these traits for all function pointers. We should change the documentation to mention that.
we may also want to add a dummy impl for rustdoc for https://doc.rust-lang.org/nightly/std/marker/trait.FnPtr.html, similar to
rust/library/core/src/primitive_docs.rs
Lines 1574 to 1583 in 6f8c055
The text was updated successfully, but these errors were encountered: