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

Rollup of 6 pull requests #48307

Closed
wants to merge 25 commits into from
Closed

Commits on Feb 1, 2018

  1. Generate documentation for auto-trait impls

    A new section is added to both both struct and trait doc pages.
    
    On struct/enum pages, a new 'Auto Trait Implementations' section displays any
    synthetic implementations for auto traits. Currently, this is only done
    for Send and Sync.
    
    On trait pages, a new 'Auto Implementors' section displays all types
    which automatically implement the trait. Effectively, this is a list of
    all public types in the standard library.
    
    Synthesized impls for a particular auto trait ('synthetic impls') take
    into account generic bounds. For example, a type 'struct Foo<T>(T)' will
    have 'impl<T> Send for Foo<T> where T: Send' generated for it.
    
    Manual implementations of auto traits are also taken into account. If we have
    the following types:
    
    'struct Foo<T>(T)'
    'struct Wrapper<T>(Foo<T>)'
    'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes
    this sound somehow
    
    Then Wrapper will have the following impl generated:
    'impl<T> Send for Wrapper<T>'
    reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send'
    to hold
    
    Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are
    taken into account by synthetic impls
    
    However, if a type can *never* implement a particular auto trait
    (e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be
    generated (in this case, 'impl<T> !Send for MyStruct<T>')
    
    All of this means that a user should be able to copy-paste a synthetic
    impl into their code, without any observable changes in behavior
    (assuming the rest of the program remains unchanged).
    Aaron1011 committed Feb 1, 2018
    Configuration menu
    Copy the full SHA
    0ad7ff4 View commit details
    Browse the repository at this point in the history
  2. Fix merge conflicts

    Aaron1011 committed Feb 1, 2018
    Configuration menu
    Copy the full SHA
    14534ff View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2018

  1. Cleanup formatting

    Aaron1011 committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    4d8b73d View commit details
    Browse the repository at this point in the history
  2. More formatting fixes

    Aaron1011 committed Feb 10, 2018
    Configuration menu
    Copy the full SHA
    764a830 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2018

  1. More formatting fixups

    Aaron1011 committed Feb 15, 2018
    Configuration menu
    Copy the full SHA
    16c1a1e View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2018

  1. Fix inlining

    Aaron1011 committed Feb 16, 2018
    Configuration menu
    Copy the full SHA
    e067470 View commit details
    Browse the repository at this point in the history
  2. Add a warning to File about mutability.

    Alexis Hunt committed Feb 16, 2018
    Configuration menu
    Copy the full SHA
    e9c75a8 View commit details
    Browse the repository at this point in the history
  3. Remove extra whitespace

    Aaron1011 authored Feb 16, 2018
    Configuration menu
    Copy the full SHA
    1713c22 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6e27aa8 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2018

  1. Configuration menu
    Copy the full SHA
    c8f206f View commit details
    Browse the repository at this point in the history
  2. Wording fixes from review for File.

    Alexis Hunt committed Feb 17, 2018
    Configuration menu
    Copy the full SHA
    ec90597 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    01a70c6 View commit details
    Browse the repository at this point in the history
  4. Add a span field to Visibility::Restricted

    This span covers the whole visibility expression: e.g. `pub (in path)`.
    topecongiro committed Feb 17, 2018
    Configuration menu
    Copy the full SHA
    0bddba9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d6bdf29 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b5099a7 View commit details
    Browse the repository at this point in the history
  7. Fix up tests and typos

    topecongiro committed Feb 17, 2018
    Configuration menu
    Copy the full SHA
    291c51b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8e9fa57 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8e46927 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4452446 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#47799 - topecongiro:fix-span-of-visibility,…

    … r=petrochenkov
    
    Fix span of visibility
    
    This PR
    
    1. adds a closing parenthesis to the span of `Visibility::Crate` (e.g. `pub(crate)`). The current span only covers `pub(crate`.
    2. adds a `span` field to `Visibility::Restricted`. This span covers the entire visibility expression (e.g. `pub (in self)`). Currently all we can have is a span for `Path`.
    
    This PR is motivated by the bug found in rustfmt (rust-lang/rustfmt#2398).
    
    The first change is a strict improvement IMHO. The second change may not be desirable, as it adds a field which is currently not used by the compiler.
    GuillaumeGomez authored Feb 17, 2018
    Configuration menu
    Copy the full SHA
    4aedf27 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#47833 - Aaron1011:final_auto_trait, r=Guill…

    …aumeGomez,QuietMisdreavus
    
    Generate documentation for auto-trait impls
    
    A new section is added to both both struct and trait doc pages.
    
    On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync.
    
    ![Auto trait implementations for Cloned](https://i.imgur.com/XtTV6IJ.png)
    
    On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library.
    
    ![Auto trait implementors for Send](https://i.imgur.com/3GRBpTy.png)
    
    Synthesized impls for a particular auto trait ('synthetic impls') take generic bounds into account. For example, a type
    ```rust
    struct Foo<T>(T)
    ```
     will have 'impl<T> Send for Foo<T> where T: Send' generated for it.
    
    Manual implementations of auto traits are also taken into account. If we have
    the following types:
    
    ```rust
    struct Foo<T>(T)
    struct Wrapper<T>(Foo<T>)
    unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow
    ```
    
    Then Wrapper will have the following impl generated:
    ```rust
    impl<T> Send for Wrapper<T>
    ```
    reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold
    
    Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls:
    
    ![A ridiculous demonstration type](https://i.imgur.com/TkZMWuN.png)
    
    However, if a type can *never* implement a particular auto trait (e.g. `struct MyStruct<T>(*const T)`), then a negative impl will be generated (in this case, `impl<T> !Send for MyStruct<T>`)
    
    All of this means that a user should be able to copy-paste a syntheticimpl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
    GuillaumeGomez authored Feb 17, 2018
    Configuration menu
    Copy the full SHA
    79e5bd5 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#48194 - GuillaumeGomez:doc-test-command, r=…

    …Mark-Simulacrum
    
    Doc test command
    
    r? @Mark-Simulacrum
    GuillaumeGomez authored Feb 17, 2018
    Configuration menu
    Copy the full SHA
    6078dc2 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#48273 - alercah:file-warning, r=joshtriplett

    Add a warning to File about mutability.
    
    Fixes rust-lang#47708.
    GuillaumeGomez authored Feb 17, 2018
    Configuration menu
    Copy the full SHA
    c67a636 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#48275 - matthiaskrgr:codespell, r=kennytm,v…

    …arkor
    
    fix more typos found by codespell.
    GuillaumeGomez authored Feb 17, 2018
    Configuration menu
    Copy the full SHA
    bc7d9c7 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#48282 - Centril:spelling-fix/iter-repeat-wi…

    …th, r=kennytm
    
    Fix spelling in core::iter::repeat_with: s/not/note
    
    Fixes spelling error in rust-lang#48156 (comment).
    Tracking issue: rust-lang#48169
    GuillaumeGomez authored Feb 17, 2018
    Configuration menu
    Copy the full SHA
    1825fbe View commit details
    Browse the repository at this point in the history