-
Notifications
You must be signed in to change notification settings - Fork 124
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
Docs for AsMut
shows AsRef
docs instead
#398
Comments
Okay, I did indeed find the right place for this. The change would have to be here in some fashion. diff --git a/impl/src/lib.rs b/impl/src/lib.rs
index eeccdb0..0eebc3b 100644
--- a/impl/src/lib.rs
+++ b/impl/src/lib.rs
@@ -97,9 +97,12 @@ impl Output for Result<proc_macro2::TokenStream, ParseError> {
macro_rules! create_derive(
($feature:literal, $mod_:ident $(:: $mod_rest:ident)*, $trait_:ident, $fn_name: ident $(,$attribute:ident)* $(,)?) => {
+ create_derive!($feature, $feature, $mod_ $(:: $mod_rest)*, $trait_, $fn_name $(,$attribute)*);
+ };
+ ($feature:literal, $documentation:literal, $mod_:ident $(:: $mod_rest:ident)*, $trait_:ident, $fn_name: ident $(,$attribute:ident)* $(,)?) => {
#[cfg(feature = $feature)]
#[proc_macro_derive($trait_, attributes($($attribute),*))]
- #[doc = include_str!(concat!("../doc/", $feature, ".md"))]
+ #[doc = include_str!(concat!("../doc/", $documentation, ".md"))]
pub fn $fn_name(input: TokenStream) -> TokenStream {
let ast = syn::parse(input).unwrap();
Output::process($mod_$(:: $mod_rest)*::expand(&ast, stringify!($trait_)))
@@ -134,7 +137,7 @@ create_derive!(
bit_xor_assign_derive,
);
-create_derive!("as_ref", r#as::r#mut, AsMut, as_mut_derive, as_mut);
+create_derive!("as_ref", "as_mut", r#as::r#mut, AsMut, as_mut_derive, as_mut);
create_derive!("as_ref", r#as::r#ref, AsRef, as_ref_derive, as_ref);
create_derive!("constructor", constructor, Constructor, constructor_derive); |
Hello @JelteF. Sorry for the ping, I just want to say, that there is this issue too, and it has a suggested solution, although it is not too elegant. What do you think? |
Afaict this is another instance of #348, it's a bit special because previously |
The issue is seen in https://docs.rs/derive_more/latest/derive_more/derive.AsMut.html#
Here's a screenshot:
Suggestion?
It might be this place:
I'm getting a compile error:
Sorry, I'm either dense or something is slightly wrong.
The text was updated successfully, but these errors were encountered: