Skip to content
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

intra-doc: Use the impl's assoc item where possible #92680

Merged
merged 1 commit into from
Jan 20, 2022

Commits on Jan 19, 2022

  1. intra-doc: Use the impl's assoc item where possible

    Before, the trait's associated item would be used. Now, the impl's
    associated item is used. The only exception is for impls that use
    default values for associated items set by the trait. In that case,
    the trait's associated item is still used.
    
    As an example of the old and new behavior, take this code:
    
        trait MyTrait {
            type AssocTy;
        }
    
        impl MyTrait for String {
            type AssocTy = u8;
        }
    
    Before, when resolving a link to `String::AssocTy`,
    `resolve_associated_trait_item` would return the associated item for
    `MyTrait::AssocTy`. Now, it would return the associated item for
    `<String as MyTrait>::AssocTy`, as it claims in its docs.
    camelid committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    29a2d6b View commit details
    Browse the repository at this point in the history