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 11 pull requests #76582

Merged
merged 29 commits into from
Sep 10, 2020
Merged

Rollup of 11 pull requests #76582

merged 29 commits into from
Sep 10, 2020

Commits on Sep 9, 2020

  1. Configuration menu
    Copy the full SHA
    5d7e7c2 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2020

  1. Validate removal of AscribeUserType, FakeRead, and Shallow borrow

    Those statements are removed by CleanupNonCodegenStatements pass
    in drop lowering phase, and should not occur afterwards.
    tmiasko committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    00e64ba View commit details
    Browse the repository at this point in the history
  2. Reword trivial_casts lint to better explain.

    The current description of the trivial casts lint under the "allowed
    by default" listing in the rustc book indicates the lint is for lints
    which may be removed, which is less clear than saying it's for lints
    which may be replaced by coercion (which is the wording used by the
    error message included in the doc).
    
    This commit changes the wording slightly to better describe what the
    lint does.
    alilleybrinker committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    01bf350 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8667f93 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2815db1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    36903d7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bec8e5f View commit details
    Browse the repository at this point in the history
  7. fix tidy, small cleanup

    lcnr committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    300b0ac View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8b05998 View commit details
    Browse the repository at this point in the history
  9. take reference to Place directly instead of taking reference to Box<P…

    …lace>
    
    clippy::borrowed_box
    matthiaskrgr committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    6bfe132 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e2a511f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e11c667 View commit details
    Browse the repository at this point in the history
  12. use push(char) instead of push_str(&str) to add single chars to strings

    clippy::single-char-push-str
    matthiaskrgr committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    9bb10cc View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d7a9707 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    fd4dd00 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    fd5859a View commit details
    Browse the repository at this point in the history
  16. typeck/expr: inaccessible private fields

    This commit adjusts the missing field diagnostic logic for struct
    expressions in typeck to improve the diagnostic when the missing
    fields are inaccessible.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    c0894e7 View commit details
    Browse the repository at this point in the history
  17. typeck/pat: inaccessible private fields

    This commit adjusts the missing field diagnostic logic for struct
    patterns in typeck to improve the diagnostic when the missing fields are
    inaccessible.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    409c141 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#75857 - dtolnay:unsafe, r=nagisa

    Syntactically permit unsafety on mods
    
    Similar to rust-lang#66183; we will accept these constructs syntactically but reject with a semantic check after macro expansion if a proc macro hasn't replaced it with something else meaningful to Rust.
    
    ```rust
    #[mymacro]
    unsafe mod m {
        ...
    }
    
    #[mymacro]
    unsafe extern "C++" {
        ...
    }
    ```
    
    The intention is that this might be used as a kind of "item-level unsafe" in attribute macro DSLs -- holding things which are unsafe to declare but potentially safe to use. For example I look forward to using this in https://github.com/dtolnay/cxx.
    
    In the absence of a procedural macro rewriting them to something else, they'll continue to be rejected at compile time though with a better error message than before.
    
    ### Before:
    
    ```console
    error: expected item, found keyword `unsafe`
     --> src/main.rs:1:1
      |
    1 | unsafe mod m {
      | ^^^^^^ expected item
    ```
    
    ### After:
    
    ```console
    error: module cannot be declared unsafe
     --> src/main.rs:1:1
      |
    1 | unsafe mod m {
      | ^^^^^^
    
    error: extern block cannot be declared unsafe
     --> src/main.rs:4:1
      |
    4 | unsafe extern "C++" {
      | ^^^^^^
    ```
    
    Closes rust-lang#68048.
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    5aed495 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#76289 - arijit79:master, r=jyn514

    Add docs about crate level documentation support
    
    Wrote information about how to write documentation on the crate level in rhe rustdoc book
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    91c3ef8 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#76514 - hameerabbasi:const-generics-revs, r…

    …=lcnr
    
    Add revisions to const generic issue UI tests.
    
    Fixes rust-lang#75279.
    
    I have gotten into the flow, so I can do more of these if requested. I'm looking for feedback as to whether my work is on the right track so far.
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    7565ccc View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#76524 - davidtwco:issue-76077-inaccessible-…

    …private-fields, r=estebank
    
    typeck: don't suggest inaccessible private fields
    
    Fixes rust-lang#76077.
    
    This PR adjusts the missing field diagnostic logic in typeck so that when none of the missing fields in a struct expr are accessible then the error is less confusing.
    
    r? @estebank
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    9f8a782 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#76548 - tmiasko:validate, r=davidtwco

    Validate removal of AscribeUserType, FakeRead, and Shallow borrow
    
    Those statements are removed by CleanupNonCodegenStatements pass
    in drop lowering phase, and should not occur afterwards.
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    2df1487 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#76555 - alilleybrinker:reword_trivial_casts…

    …_lint_doc, r=steveklabnik
    
    Reword `trivial_casts` lint in rustc book to better explain what it does.
    
    The current description of the trivial casts lint under the "allowed
    by default" listing in the rustc book indicates the lint is for casts
    which may be removed, which is less clear than saying it's for casts
    which may be replaced by coercion (which is the wording used by the
    error message included in the doc).
    
    This commit changes the wording slightly to better describe what the
    lint does.
    
    This issue bit me in some recent code where I was attempting to
    convert a `Vec<SomeType>` to a `Vec<SomeTraitObject>`, and
    hit my project-wide `#![deny(trivial_casts)]` with
    `map(|o| Box::new(o) as TraitObject)`. I'd read the book docs for
    `trivial_casts` and was surprised by the error, as I took it to mean
    the cast ought to be removed (rather than replaced by ascription
    in this case). Removing the cast meant other code didn't compile,
    and I then found issues like rust-lang#23742 and realized my misunderstanding.
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    f9df658 View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#76559 - lcnr:const-evaluatable, r=oli-obk

    add the `const_evaluatable_checked` feature
    
    Implements a rather small subset of rust-lang/compiler-team#340
    
    Unlike the MCP, this does not try to compare different constant, but instead only adds the constants found in where clauses
    to the predicates of a function. This PR adds the feature gate `const_evaluatable_checked`, without which nothing should change.
    
    r? @oli-obk @eddyb
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    ac85a4d View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#76563 - yokodake:patch-1, r=jonas-schievink

    small typo fix in rustc_parse docs
    
    small typo in rustc_parse::new_parser_from_file's documentation
    
    I'm not sure a PR is the way to do this though.
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    ae46b9e View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#76565 - matthiaskrgr:box_place, r=oli-obk

    take reference to Place directly instead of taking reference to Box<Place>
    
    clippy::borrowed_box
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    94ae5d1 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#76567 - matthiaskrgr:clone_on_copy, r=varkor

    use push(char) to add chars (single-char &strs) to strings instead of push_str(&str)
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    c8f9c72 View commit details
    Browse the repository at this point in the history
  28. Rollup merge of rust-lang#76568 - GuillaumeGomez:add-missing-examples…

    …, r=jyn514
    
    Add missing examples on core traits' method
    
    Linked to rust-lang#76450.
    
    r? @jyn514
    tmandry committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    044f717 View commit details
    Browse the repository at this point in the history