1. 20 6月, 2022 26 次提交
    • B
      Auto merge of #97674 - nnethercote:oblig-forest-tweaks, r=nikomatsakis · 1d601081
      bors 提交于
      Obligation forest tweaks
      
      A few minor improvements to the code.
      
      r? `@nikomatsakis`
      1d601081
    • B
      Auto merge of #98284 - JohnTitor:rollup-7lbs143, r=JohnTitor · 41045962
      bors 提交于
      Rollup of 5 pull requests
      
      Successful merges:
      
       - #98183 (Fix pretty printing of empty bound lists in where-clause)
       - #98268 (Improve `lifetime arguments are not allowed on` error message)
       - #98273 (Fix minor documentation typo)
       - #98274 (Minor improvements on error for `Self` type in items that don't allow it)
       - #98281 (Fix typo in `HashMap::drain` docs)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      41045962
    • Y
      Rollup merge of #98281 - Nilstrieb:map-drain-typo, r=JohnTitor · 66dbc3fd
      Yuki Okushi 提交于
      Fix typo in `HashMap::drain` docs
      
      It's a map, not a vector.
      
      Fixes #98275.
      66dbc3fd
    • Y
      Rollup merge of #98274 - compiler-errors:self-type-error, r=cjgillot · 1888499b
      Yuki Okushi 提交于
      Minor improvements on error for `Self` type in items that don't allow it
      
      Fixes #93796
      1888499b
    • Y
      Rollup merge of #98273 - Piturnah:patch-1, r=compiler-errors · f459d8d6
      Yuki Okushi 提交于
      Fix minor documentation typo
      
      Fixes incorrect pluralisation of `crate` in documentation for rustc_trait_selection
      f459d8d6
    • Y
      Rollup merge of #98268 - compiler-errors:disallowed-generics-better, r=lcnr · e6357046
      Yuki Okushi 提交于
      Improve `lifetime arguments are not allowed on` error message
      
      Actually mention what thing we're improperly trying to add lifetime generics to.
      e6357046
    • Y
      Rollup merge of #98183 - dtolnay:emptybound, r=lcnr · b6fb582c
      Yuki Okushi 提交于
      Fix pretty printing of empty bound lists in where-clause
      
      Repro:
      
      ```rust
      macro_rules! assert_item_stringify {
          ($item:item $expected:literal) => {
              assert_eq!(stringify!($item), $expected);
          };
      }
      
      fn main() {
          assert_item_stringify! {
              fn f<'a, T>() where 'a:, T: {}
              "fn f<'a, T>() where 'a:, T: {}"
          }
      }
      ```
      
      Previously this assertion would fail because rustc renders the where-clause as `where 'a, T` which is invalid syntax.
      
      This PR makes the above assertion pass.
      
      This bug also affects `-Zunpretty=expanded`. The intention is for that to emit syntactically valid code, but the buggy output is not valid Rust syntax.
      
      ```console
      $ rustc <(echo "fn f<'a, T>() where 'a:, T: {}") -Zunpretty=expanded
      #![feature(prelude_import)]
      #![no_std]
      #[prelude_import]
      use ::std::prelude::rust_2015::*;
      #[macro_use]
      extern crate std;
      fn f<'a, T>() where 'a, T {}
      ```
      
      ```console
      $ rustc <(echo "fn f<'a, T>() where 'a:, T: {}") -Zunpretty=expanded | rustc -
      error: expected `:`, found `,`
       --> <anon>:7:23
        |
      7 | fn f<'a, T>() where 'a, T {}
        |                       ^ expected `:`
      ```
      b6fb582c
    • N
      Fix typo in `HashMap::drain` docs · 2ead0d74
      nils 提交于
      It's a map, not a vector.
      2ead0d74
    • B
      Auto merge of #98264 - compiler-errors:missing-arg-placeholder, r=jackh726 · a5c039cd
      bors 提交于
      Make missing argument placeholder more obvious that it's a placeholder
      
      Use `/* ty */` instead of `{ty}`, since people might be misled into thinking that this is valid syntax, and not just a diagnostic placeholder.
      
      Fixes #96880
      a5c039cd
    • B
      Auto merge of #97931 - xldenis:fix-if-let-source-scopes, r=nagisa · 9a0b7749
      bors 提交于
      Fix `SourceScope` for `if let` bindings.
      
      Fixes #97799.
      
      I'm not sure how to test this properly, is there any way to observe the difference in behavior apart from `ui` tests? I'm worried that they would be overlooked in the case of a regression.
      9a0b7749
    • M
      Don't suggest adding Self as a type parameter · 047de83e
      Michael Goulet 提交于
      047de83e
    • M
      Mention what item is using an invalid `Self` type · 018c319b
      Michael Goulet 提交于
      018c319b
    • P
      Fix minor documentation typo · 3ce6e125
      Peter Hebden 提交于
      Incorrect pluralisation of `crate`
      3ce6e125
    • M
      2762d629
    • B
      Auto merge of #98265 - JohnTitor:rollup-wtfqc4g, r=JohnTitor · 17c6bde1
      bors 提交于
      Rollup of 4 pull requests
      
      Successful merges:
      
       - #95534 (Add `core::mem::copy` to complement `core::mem::drop`.)
       - #97912 (Stabilize `Path::try_exists()` and improve doc)
       - #98225 (Make debug_triple depend on target json file content rather than file path)
       - #98257 (Fix typos in `IntoFuture` docs)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      17c6bde1
    • Y
      Rollup merge of #98257 - kadiwa4:into_future_doc_typos, r=Dylan-DPC · 761f83f6
      Yuki Okushi 提交于
      Fix typos in `IntoFuture` docs
      761f83f6
    • Y
      Rollup merge of #98225 - bjorn3:stable_target_json_hash, r=nagisa · bfa6cd9c
      Yuki Okushi 提交于
      Make debug_triple depend on target json file content rather than file path
      
      This ensures that changes to target json files will force a recompilation. And more importantly that moving the files doesn't force a recompilation.
      
      This should fix https://github.com/Rust-for-Linux/linux/issues/792 (cc ``@ojeda)``
      bfa6cd9c
    • Y
      Rollup merge of #97912 - Kixunil:stabilize_path_try_exists, r=dtolnay · 77316a4a
      Yuki Okushi 提交于
      Stabilize `Path::try_exists()` and improve doc
      
      This stabilizes the `Path::try_exists()` method which returns
      `Result<bool, io::Error>` instead of `bool` allowing handling of errors
      unrelated to the file not existing. (e.g permission errors)
      
      Along with the stabilization it also:
      
      * Warns that the `exists()` method is error-prone and suggests to use
        the newly stabilized one.
      * Suggests it instead of `metadata()` to handle errors.
      * Mentions TOCTOU bugs to avoid false assumption that `try_exists()` is
        completely safe fixed version of `exists()`.
      * Renames the feature of still-unstable `std::fs::try_exists()` to
        `fs_try_exists` to avoid name conflict.
      
      The tracking issue #83186 remains open to track `fs_try_exists`.
      77316a4a
    • Y
      Rollup merge of #95534 - jyn514:std-mem-copy, r=joshtriplett · 9d4e08e7
      Yuki Okushi 提交于
      Add `core::mem::copy` to complement `core::mem::drop`.
      
      This is useful for combinators. I didn't add `clone` since you can already
      use `Clone::clone` in its place; copy has no such corresponding function.
      9d4e08e7
    • B
      Auto merge of #97268 - jyn514:faster-assemble, r=Mark-Simulacrum · 611e7b9c
      bors 提交于
      Make "Assemble stage1 compiler" orders of magnitude faster (take 2)
      
      This used to take upwards of 5 seconds for me locally. I found that the culprit was copying the downloaded LLVM shared object:
      ```
      [22:28:03] Install "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so" to "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-14-rust-1.62.0-nightly.so"
      [22:28:09]   c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) } }
      ```
      
      It turned out that `install()` used full copies unconditionally. Change it to try using a hard-link before falling back to copying.
      
      - Panic if we generate a symbolic link in a tarball
      - Change install to use copy internally, like in my previous PR
      - Change copy to dereference symbolic links, which avoids the previous regression in #96803.
      
      I also took the liberty of fixing `x dist llvm-tools` to work even if you don't call `x build` previously.
      611e7b9c
    • M
    • J
      Add `core::mem::copy` to complement `core::mem::drop`. · 9ac6277b
      Joshua Nelson 提交于
      This is useful for combinators. I didn't add `clone` since you can already
      use `Clone::clone` in its place; copy has no such corresponding function.
      9ac6277b
    • J
      Make "Assemble stage1 compiler" orders of magnitude faster · 057eab7a
      Joshua Nelson 提交于
      This used to take upwards of 5 seconds for me locally. I found that the
      culprit was copying the downloaded LLVM shared object:
      ```
      [22:28:03] Install "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/ci-llvm/lib/libLLVM-14-rust-1.62.0-nightly.so" to "/home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libLLVM-14-rust-1.62.0-nightly.so"
      [22:28:09]   c Sysroot { compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) } }
      ```
      
      It turned out that `install()` used full copies unconditionally. Change
      it to use `copy()` internally, which uses hard links instead when
      available.
      
      Note that this has a change in behavior: Installing a file will also
      change permissions on the source, not just the destination, if hard
      links are used.
      
      To avoid changing the behavior on symlinks for existing code, I
      introduce a new function `copy_internal` which only dereferences
      symlinks when told to do so.
      057eab7a
    • J
      Panic if `dist` generates a symbolic link in a generated tarball · b9eedea4
      Joshua Nelson 提交于
      This avoids regressions in rustup-toolchain-install-master
      b9eedea4
    • B
      Auto merge of #98247 - jackh726:regionkind-rustc-type-ir, r=compiler-errors · bb8c2f41
      bors 提交于
      Move RegionKind to rustc_type_ir
      
      (Also UniverseIndex)
      
      r? rust-lang/types
      bb8c2f41
    • B
      Auto merge of #98224 - eddyb:proc-macro-spurious-repr, r=bjorn3 · 2b646bd5
      bors 提交于
      proc_macro/bridge: remove `#[repr(C)]` from non-ABI-relevant types.
      
      Not sure how this happened, maybe some of these were passed through the bridge a long time ago?
      
      r? `@bjorn3`
      2b646bd5
  2. 19 6月, 2022 14 次提交