1. 08 8月, 2021 16 次提交
    • B
      Auto merge of #87827 - eddyb:wrapperless-mem-replace, r=m-ou-se · 4e886d68
      bors 提交于
      Avoid using the `copy_nonoverlapping` wrapper through `mem::replace`.
      
      This is a much simpler way to achieve the pre-#86003 behavior of `mem::replace` not needing dynamically-sized `memcpy`s (at least before inlining), than re-doing #81238 (which needs #86699 or something similar).
      
      I didn't notice it until recently, but `ptr::write` already explicitly avoided using the wrapper, while `ptr::read` just called the wrapper (and was the reason for us observing any behavior change from #86003 in Rust-GPU).
      
      <hr/>
      
      The codegen test I've added fails without the change to `core::ptr::read` like this (ignore the `v0` mangling, I was using a worktree with it turned on by default, for this):
      ```llvm
             13: ; core::intrinsics::copy_nonoverlapping::<u8>
             14: ; Function Attrs: inlinehint nonlazybind uwtable
             15: define internal void `@_RINvNtCscK5tvALCJol_4core10intrinsics19copy_nonoverlappinghECsaS4X3EinRE8_25mem_replace_direct_memcpy(i8*` %src, i8* %dst, i64 %count) unnamed_addr #0 {
             16: start:
             17:  %0 = mul i64 %count, 1
             18:  call void `@llvm.memcpy.p0i8.p0i8.i64(i8*` align 1 %dst, i8* align 1 %src, i64 %0, i1 false)
      not:17      !~~~~~~~~~~~~~~~~~~~~~                                                                     error: no match expected
             19:  ret void
             20: }
      ```
      With the `core::ptr::read` change, `core::intrinsics::copy_nonoverlapping` doesn't get instantiated and the test passes.
      
      <hr/>
      
      r? `@m-ou-se` cc `@nagisa` (codegen test) `@oli-obk` / `@RalfJung` (miri diagnostic changes)
      4e886d68
    • E
    • B
      Auto merge of #87836 - tsoutsman:master, r=petrochenkov · e8c25f26
      bors 提交于
      Change proc_macro::Diagnostics docs
      
      With Rust 1.54 attributes can invoke function-like macros. This allows functions generated by macros to have non-generic documentation. This pull request changes the documentation of `proc_macro::Diagnostics` to be more specific and include a link to the level.
      ## Example
      Before:
      ```markdown
      Adds a new child diagnostic message to `self` with the level
      identified by this method’s name with the given `message`.
      ```
      After:
      ```markdown
      Adds a new child diagnostic message to self with the [`Level::Error`]
      level, and the given `message`.
      ```
      e8c25f26
    • B
      Auto merge of #87815 - BoxyUwU:cec-generics-of-ice, r=eddyb · c4c2986c
      bors 提交于
      encode `generics_of` for fields and ty params
      
      Fixes #87674
      Fixes #87603
      
      ICE was caused by calling `generics_of` on a `DefId` without any `generics_of` results. This was happening when we call `generics_of` on parent `DefId`s of an unevaluated const when we evaluate it.
      
      r? `@lcnr`
      c4c2986c
    • B
      Auto merge of #87798 - durin42:llvm-14, r=nikic · 2d10c2a3
      bors 提交于
      PassWrapper: handle move of OptimizationLevel class out of PassBuilder
      
      This is the first build break of the LLVM 14 cycle, and was caused by
      https://reviews.llvm.org/D107025. Mercifully an easy fix.
      2d10c2a3
    • K
      Merge branch 'rust-lang:master' into master · 26bf0ef0
      Klim Tsoutsman 提交于
      26bf0ef0
    • B
      Auto merge of #86744 - ijackson:sink-default, r=dtolnay · 835dce56
      bors 提交于
      impl Default, Copy, Clone for std::io::Sink and Empty
      
      The omission of `Sink: Default` is causing me a slight inconvenience in a test harness.  There seems little reason for this and `Empty` not to be `Clone` and `Copy` too.
      
      I have made all three of these insta-stable, because:
      
      AIUI `Copy` can only be derived, and I was not able to find any examples of how to unstably derive it.  I think it is probably not possible.
      
      I hunted through the git history for precedent and found
      
      > 79b8ad84
      > Implement `Copy` for `IoSlice`
      > https://github.com/rust-lang/rust/pull/69403
      
      which was also insta-stable.
      835dce56
    • B
      Auto merge of #87772 - npmccallum:naked_abi, r=Amanieu · 798446fe
      bors 提交于
      Move naked function ABI check to its own lint
      
      This check was previously categorized under the lint named
      `UNSUPPORTED_NAKED_FUNCTIONS`. That lint is future incompatible and will
      be turned into an error in a future release. However, as defined in the
      Constrained Naked Functions RFC, this check should only be a warning.
      This is because it is possible for a naked function to be implemented in
      such a way that it does not break even the undefined ABI. For example, a
      `jmp` to a `const`.
      
      Therefore, this patch defines a new lint named
      `UNDEFINED_NAKED_FUNCTION_ABI` which contains just this single check.
      Unlike `UNSUPPORTED_NAKED_FUNCTIONS`, `UNDEFINED_NAKED_FUNCTION_ABI`
      will not be converted to an error in the future.
      
      rust-lang/rfcs#2774
      rust-lang/rfcs#2972
      798446fe
    • B
      Auto merge of #87743 - cuviper:opaque-calls, r=nikic · 574d3756
      bors 提交于
      Prepare call/invoke for opaque pointers
      
      Rather than relying on `getPointerElementType()` from LLVM function
      pointers, we now pass the function type explicitly when building `call`
      or `invoke` instructions.
      574d3756
    • B
      Auto merge of #87851 - JohnTitor:rollup-odvmr47, r=JohnTitor · 399ab460
      bors 提交于
      Rollup of 6 pull requests
      
      Successful merges:
      
       - #87744 (Add x.py option to --force-rerun compiletest tests)
       - #87789 (Make vec-shrink-panic test compatible with v0 mangling)
       - #87833 (Fix typo -- "The" -> "They")
       - #87834 (Fix small typo)
       - #87838 (Document that fs::read_dir skips . and ..)
       - #87842 (Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      399ab460
    • Y
      Rollup merge of #87842 - steffahn:hidden_broken_intra_doc, r=dtolnay · c159806c
      Yuki Okushi 提交于
      Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked
      
      Recently, I edited the import list of the `core::iter::traits::iterator` module (in #85874). This results in a broken intra doc link in a hidden documentation with the effect that `RUSTDOCFLAGS='--document-private-items --document-hidden-items' x doc library/std` fails. (This can be worked around by adding `-Arustdoc::broken-intra-doc-links`; still, it’s a broken link so let’s fix it.)
      
      ``@rustbot`` label C-cleanup, T-libs
      c159806c
    • Y
      Rollup merge of #87838 - jetomit:add-readdir-note, r=dtolnay · 34929004
      Yuki Okushi 提交于
      Document that fs::read_dir skips . and ..
      
      Hi,
      
      I think this is worth noting in the docs since it differs from POSIX `readdir`. I didn’t put it under platform-specific notes because it seems to be consistent across platforms, and changing this behavior in the future could cause pretty nasty bugs.
      
      Thanks!
      34929004
    • Y
      Rollup merge of #87834 - camelid:span-typo, r=CraftSpider · 08f56b7b
      Yuki Okushi 提交于
      Fix small typo
      
      The closing backtick was outside the closing bracket,
      which is why the intra-doc link wasn't working.
      08f56b7b
    • Y
      Rollup merge of #87833 - m-rsha:patch-1, r=Aaron1011 · 6ddbf9ec
      Yuki Okushi 提交于
      Fix typo -- "The" -> "They"
      
      I was reading through source code to try to learn more about the language and how to make the most of it when I ran into a small typo, so I figured I'd offer up a fix! I'm pretty new now, but hopefully I can offer up more substantial changes later. :D
      6ddbf9ec
    • Y
      Rollup merge of #87789 - tmiasko:panik, r=Mark-Simulacrum · dc78ee0c
      Yuki Okushi 提交于
      Make vec-shrink-panic test compatible with v0 mangling
      
      The v0 mangling includes an instantiating crate in a mangled name,
      which crates a false positive match for a word `panic`.
      Rename crate name / test case to avoid the issue.
      dc78ee0c
    • Y
      Rollup merge of #87744 - Smittyvb:xpy-test-force-rerun, r=Mark-Simulacrum · e862383d
      Yuki Okushi 提交于
      Add x.py option to --force-rerun compiletest tests
      
      This can be used like `./x.py test src/test/ui/abi/ --force-rerun`, and is useful when verifying that newly blessed tests don't change between test runs (such as due to being dependent on the current time or memory layout or RNG), without needing to change the test file or find the right file in `build` to remove.
      e862383d
  2. 07 8月, 2021 21 次提交
  3. 06 8月, 2021 3 次提交