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

Add documentation to more From::from implementations. #89869

Merged
merged 1 commit into from
Feb 17, 2022

Commits on Dec 4, 2021

  1. Add documentation to more From::from implementations.

    For users looking at documentation through IDE popups, this gives them
    relevant information rather than the generic trait documentation wording
    “Performs the conversion”. For users reading the documentation for a
    specific type for any reason, this informs them when the conversion may
    allocate or copy significant memory versus when it is always a move or
    cheap copy.
    
    Notes on specific cases:
    * The new documentation for `From<T> for T` explains that it is not a
      conversion at all.
    * Also documented `impl<T, U> Into<U> for T where U: From<T>`, the other
      central blanket implementation of conversion.
    * I did not add documentation to conversions of a specific error type to
      a more general error type.
    * I did not add documentation to unstable code.
    
    This change was prepared by searching for the text "From<... for" and so
    may have missed some cases that for whatever reason did not match. I
    also looked for `Into` impls but did not find any worth documenting by
    the above criteria.
    kpreid committed Dec 4, 2021
    Configuration menu
    Copy the full SHA
    6fd5cf5 View commit details
    Browse the repository at this point in the history