• A
    rustdoc: Create anchor pages for primitive types · c2e3aa37
    Alex Crichton 提交于
    This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]`
    attribute. This attribute indicates that the current module is the "owner" of
    the primitive type `foo`. For rustdoc, this means that the doc-comment for the
    module is the doc-comment for the primitive type, plus a signal to all
    downstream crates that hyperlinks for primitive types will be directed at the
    crate containing the `#[doc]` directive.
    
    Additionally, rustdoc will favor crates closest to the one being documented
    which "implements the primitive type". For example, documentation of libcore
    links to libcore for primitive types, but documentation for libstd and beyond
    all links to libstd for primitive types.
    
    This change involves no compiler modifications, it is purely a rustdoc change.
    The landing pages for the primitive types primarily serve to show a list of
    implemented traits for the primitive type itself.
    
    The primitive types documented includes both strings and slices in a semi-ad-hoc
    way, but in a way that should provide at least somewhat meaningful
    documentation.
    
    Closes #14474
    c2e3aa37
u64.rs 595 字节