1. 11 9月, 2020 17 次提交
    • A
      Note when a a move/borrow error is caused by a deref coercion · d18b4bb7
      Aaron Hill 提交于
      Fixes #73268
      
      When a deref coercion occurs, we may end up with a move error if the
      base value has been partially moved out of. However, we do not indicate
      anywhere that a deref coercion is occuring, resulting in an error
      message with a confusing span.
      
      This PR adds an explicit note to move errors when a deref coercion is
      involved. We mention the name of the type that the deref-coercion
      resolved to, as well as the `Deref::Target` associated type being used.
      d18b4bb7
    • B
      Auto merge of #76574 - flip1995:clippyup, r=Manishearth · a1947b3f
      bors 提交于
      Update Clippy
      
      Biweekly Clippy update
      
      r? `@Manishearth`
      a1947b3f
    • B
      Auto merge of #76582 - tmandry:rollup-lwwc93b, r=tmandry · ad3a6f70
      bors 提交于
      Rollup of 11 pull requests
      
      Successful merges:
      
       - #75857 (Syntactically permit unsafety on mods)
       - #76289 (Add docs about crate level documentation support)
       - #76514 (Add revisions to const generic issue UI tests.)
       - #76524 (typeck: don't suggest inaccessible private fields)
       - #76548 (Validate removal of AscribeUserType, FakeRead, and Shallow borrow)
       - #76555 (Reword `trivial_casts` lint in rustc book to better explain what it does.)
       - #76559 (add the `const_evaluatable_checked` feature)
       - #76563 (small typo fix in rustc_parse docs)
       - #76565 (take reference to Place directly instead of taking reference to Box<Place>)
       - #76567 (use push(char) to add chars (single-char &strs) to strings instead of push_str(&str))
       - #76568 (Add missing examples on core traits' method)
      
      Failed merges:
      
      r? `@ghost`
      ad3a6f70
    • T
      Rollup merge of #76568 - GuillaumeGomez:add-missing-examples, r=jyn514 · 044f7179
      Tyler Mandry 提交于
      Add missing examples on core traits' method
      
      Linked to #76450.
      
      r? @jyn514
      044f7179
    • T
      Rollup merge of #76567 - matthiaskrgr:clone_on_copy, r=varkor · c8f9c728
      Tyler Mandry 提交于
      use push(char) to add chars (single-char &strs) to strings instead of push_str(&str)
      c8f9c728
    • T
      Rollup merge of #76565 - matthiaskrgr:box_place, r=oli-obk · 94ae5d18
      Tyler Mandry 提交于
      take reference to Place directly instead of taking reference to Box<Place>
      
      clippy::borrowed_box
      94ae5d18
    • T
      Rollup merge of #76563 - yokodake:patch-1, r=jonas-schievink · ae46b9e4
      Tyler Mandry 提交于
      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.
      ae46b9e4
    • T
      Rollup merge of #76559 - lcnr:const-evaluatable, r=oli-obk · ac85a4d7
      Tyler Mandry 提交于
      add the `const_evaluatable_checked` feature
      
      Implements a rather small subset of https://github.com/rust-lang/compiler-team/issues/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
      ac85a4d7
    • T
      Rollup merge of #76555 - alilleybrinker:reword_trivial_casts_lint_doc, r=steveklabnik · f9df658a
      Tyler Mandry 提交于
      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 #23742 and realized my misunderstanding.
      f9df658a
    • T
      Rollup merge of #76548 - tmiasko:validate, r=davidtwco · 2df1487f
      Tyler Mandry 提交于
      Validate removal of AscribeUserType, FakeRead, and Shallow borrow
      
      Those statements are removed by CleanupNonCodegenStatements pass
      in drop lowering phase, and should not occur afterwards.
      2df1487f
    • T
      Rollup merge of #76524 - davidtwco:issue-76077-inaccessible-private-fields, r=estebank · 9f8a7827
      Tyler Mandry 提交于
      typeck: don't suggest inaccessible private fields
      
      Fixes #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
      9f8a7827
    • T
      Rollup merge of #76514 - hameerabbasi:const-generics-revs, r=lcnr · 7565ccc3
      Tyler Mandry 提交于
      Add revisions to const generic issue UI tests.
      
      Fixes #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.
      7565ccc3
    • T
      Rollup merge of #76289 - arijit79:master, r=jyn514 · 91c3ef8b
      Tyler Mandry 提交于
      Add docs about crate level documentation support
      
      Wrote information about how to write documentation on the crate level in rhe rustdoc book
      91c3ef8b
    • T
      Rollup merge of #75857 - dtolnay:unsafe, r=nagisa · 5aed4957
      Tyler Mandry 提交于
      Syntactically permit unsafety on mods
      
      Similar to https://github.com/rust-lang/rust/pull/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 #68048.
      5aed4957
    • D
      typeck/pat: inaccessible private fields · 409c1419
      David Wood 提交于
      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: NDavid Wood <david@davidtw.co>
      409c1419
    • D
      typeck/expr: inaccessible private fields · c0894e72
      David Wood 提交于
      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: NDavid Wood <david@davidtw.co>
      c0894e72
    • B
      Auto merge of #76564 - pietroalbini:ci-avoid-wasting-10-minutes, r=Mark-Simulacrum · 8c35a927
      bors 提交于
      ci: avoid moving the build directory on GHA
      
      While waiting for a PR job to start testing my code, I noticed the symlink-build-dir step took 10 minutes to complete, so I investigated what caused that.
      
      It seems like something changed in the build environment between version 20200901.1 (where the step took 45 seconds) and version 20200908.1 (where the step took 10 minutes). At the time of writing this commit, the rust-lang organization is on vertsion 20200908.1, while the rust-lang-ci organization is at version 20200901.1 (and is not affected by this yet).
      
      There is no need for this step anymore on GHA, as our XL builders got an increase in the root paritition size, so this commit removes the code that moved stuff around on GHA (while keeping it on Azure).
      
      For the record, at the time of writing this, the disk situation is:
      
      ```
      Filesystem      Size  Used Avail Use% Mounted on
      /dev/sda1       667G   60G  607G   9% /
      /dev/sdb1       110G  4.1G  101G   4% /mnt
      ```
      
      r? `@Mark-Simulacrum`
      8c35a927
  2. 10 9月, 2020 23 次提交