1. 22 11月, 2020 23 次提交
    • B
      Auto merge of #78816 - SkiFire13:fix-slice-pointer-provenance, r=RalfJung · 828461b4
      bors 提交于
      <[T]>::reverse: Fix pointer provenance rules
      
      Should fix #78749
      828461b4
    • B
      Auto merge of #77872 - Xaeroxe:stabilize-clamp, r=scottmcm · 5d5ff841
      bors 提交于
      Stabilize clamp
      
      Tracking issue: https://github.com/rust-lang/rust/issues/44095
      
      Clamp has been merged and unstable for about a year and a half now. How do we feel about stabilizing this?
      5d5ff841
    • B
      Auto merge of #79275 - integer32llc:doc-style, r=jonas-schievink · 20328b53
      bors 提交于
      More consistently use spaces after commas in lists in docs
      
      This PR changes instances of lists that didn't use spaces after commas, like `vec![1,2,3]`, to `vec![1, 2, 3]` to be more consistent with idiomatic Rust style (the way these were looks strange to me, especially because there are often lists that *do* use spaces after the commas later in the same code block 😬).
      
      I noticed one of these in an example in the stdlib docs and went looking for more, but as far as I can see, I'm only changing those spots in user-facing documentation or rustc output, and the changes make no semantic difference.
      20328b53
    • B
      Auto merge of #79229 - sdroege:slice-fill-memset, r=dtolnay · 8ca930aa
      bors 提交于
      Add "memset" as doc alias to slice::fill()
      
      Similar to 53f969df and should make it easier for people coming from C to find this function.
      8ca930aa
    • B
      Auto merge of #78752 - jyn514:html-diff, r=GuillaumeGomez · 70090118
      bors 提交于
      Give a better error when rustdoc tests fail
      
      - Run the default rustdoc against the current rustdoc
      - Diff output recursively
      - Colorize diff output
      
      Closes https://github.com/rust-lang/rust/issues/78750.
      
      ## Resolved questions
      
      - Should this be opt-in instead of on by default?
        + No
      - Should this call through to `delta`? That's not a very common program to have installed, but I'm not sure how to do diffs after the fact. Maybe `compiletest` can take a `--syntax-highlighter` parameter or something?
        + I decided to use `delta` if available and `diff --color` otherwise. It prints a warning if delta isn't installed so you know you can get nicer diffs
      
      ## Open questions.
      
      - What version of rustdoc would this compare against? Ideally it would compare against `$(git merge-base HEAD origin/master)` - maybe that's feasible if we install those artifacts from CI?
      - Does it always make sense to compare the tests? Especially for new tests, I'm not sure how useful it would be ... but then again, one of the questions I want to know most as a reviewer is 'did it break before?'.
      
      r? `@GuillaumeGomez`
      cc `@Mark-Simulacrum`
      70090118
    • B
      Auto merge of #78461 - TimDiekmann:vec-alloc, r=Amanieu · a1a13b2b
      bors 提交于
      Add support for custom allocators in `Vec`
      
      This follows the [roadmap](https://github.com/rust-lang/wg-allocators/issues/7) of the allocator WG to add custom allocators to collections.
      
      r? `@Amanieu`
      
      This pull request requires a crater run.
      
      ### Prior work:
      - #71873: Crater-test to solve rust-lang/wg-allocators#1
      - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate
      a1a13b2b
    • B
      Auto merge of #79273 - Dylan-DPC:rollup-zd10xlt, r=Dylan-DPC · da384694
      bors 提交于
      Rollup of 8 pull requests
      
      Successful merges:
      
       - #77844 (clarify rules for ZST Boxes)
       - #79067 (Refactor the abi handling code a bit)
       - #79182 (Fix links to extern types in rustdoc (fixes #78777))
       - #79231 (Exhaustively match in variant count instrinsic)
       - #79238 (Direct RUSTC_LOG (tracing/log) output to stderr instead of stdout.)
       - #79256 (Fix typos)
       - #79264 (Get rid of some doctree items)
       - #79272 (Support building clone shims for arrays with generic size)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      da384694
    • C
    • D
      Rollup merge of #79272 - tmiasko:array-clone, r=jonas-schievink · 68c9caa6
      Dylan DPC 提交于
      Support building clone shims for arrays with generic size
      
      Fixes #79269.
      68c9caa6
    • D
      Rollup merge of #79264 - jyn514:less-doctree, r=GuillaumeGomez · c20657c1
      Dylan DPC 提交于
      Get rid of some doctree items
      
      They can be derived directly from the `hir::Item`, there's no special logic.
      
      - TypeDef
      - OpaqueTy
      - Constant
      - Static
      - TraitAlias
      - Enum
      - Union
      - Struct
      
      Part of #78082 (the easiest part, I'm still debugging some other changes).
      r? `@GuillaumeGomez`
      c20657c1
    • D
      Rollup merge of #79256 - bugadani:query-typo, r=jonas-schievink · 96ec5d29
      Dylan DPC 提交于
      Fix typos
      96ec5d29
    • D
      Rollup merge of #79238 - eddyb:rustc-log-stderr, r=jyn514 · 3958cecc
      Dylan DPC 提交于
      Direct RUSTC_LOG (tracing/log) output to stderr instead of stdout.
      
      Looks like this got missed in the initial implementation, AFAIK the old behavior was to output on stderr.
      (Hit this while trying to debug `rustc` running inside a build script which was only letting stderr through)
      
      r? ``@oli-obk`` cc ``@davidbarsky`` ``@hawkw``
      3958cecc
    • D
      Rollup merge of #79231 - wusyong:issue-79137, r=lcnr · bb73ea67
      Dylan DPC 提交于
      Exhaustively match in variant count instrinsic
      
      Fix #79137
      bb73ea67
    • D
      Rollup merge of #79182 - lochsh:78777-fix-extern-types-ref, r=jyn514 · 5d428cae
      Dylan DPC 提交于
      Fix links to extern types in rustdoc (fixes #78777)
      
       r? `@jyn514`
       Fixes #78777.
      The initial fix we tried was:
      ```diff
      diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
      index 8be9482acff..c4b7086fdb1 100644
      --- a/src/librustdoc/passes/collect_intra_doc_links.rs
      +++ b/src/librustdoc/passes/collect_intra_doc_links.rs
      `@@` -433,8 +433,9 `@@` impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
                   Res::PrimTy(prim) => Some(
                       self.resolve_primitive_associated_item(prim, ns, module_id, item_name, item_str),
                   ),
      -            Res::Def(DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::TyAlias, did) => {
      +            Res::Def(kind, did) if kind.ns() == Some(Namespace::TypeNS) => {
                       debug!("looking for associated item named {} for item {:?}", item_name, did);
      +
                       // Checks if item_name belongs to `impl SomeItem`
                       let assoc_item = cx
                           .tcx
      ```
      
      However, this caused traits to be matched, resulting in a panic when `resolve_associated_trait_item` is called further down in this function.
      
      This PR also adds an error message for that panic. Currently it will look something like:
      ```rust
      thread 'rustc' panicked at 'Not a type: DefIndex(8624)', compiler/rustc_metadata/src/rmeta/decoder.rs:951:32
      ```
      I wasn't sure how to get a better debug output than `DefIndex(...)`, and am open to suggestions.
      5d428cae
    • D
      Rollup merge of #79067 - bjorn3:abi_refactor, r=nagisa · 42683576
      Dylan DPC 提交于
      Refactor the abi handling code a bit
      
      I am not quite sure if all changes are improvements.
      42683576
    • D
      Rollup merge of #77844 - RalfJung:zst-box, r=nikomatsakis · 6cd02a85
      Dylan DPC 提交于
      clarify rules for ZST Boxes
      
      LLVM's rules around `getelementptr inbounds` with offset 0 are a bit annoying, and as a consequence we have no choice but say that a `Box<()>` pointing to previously allocated memory that has since been freed is UB. Clarify the docs to reflect this.
      
      This is based on conversations on the LLVM mailing list.
      * Here's my initial mail: https://lists.llvm.org/pipermail/llvm-dev/2019-February/130452.html
      * The first email of the March part of that thread: https://lists.llvm.org/pipermail/llvm-dev/2019-March/130831.html
      * First email of the April part: https://lists.llvm.org/pipermail/llvm-dev/2019-April/131693.html
      
      The conclusion for me at least was that `getelementptr inbounds` with offset 0 is *not* the identity function, but can sometimes return `poison` even when the input is a regular pointer -- specifically, it returns `poison` when this pointer points into something that LLVM "knows has been deallocated", i.e., a former LLVM-managed allocation. It is however the identity function on pointers obtained by casting integers.
      
      Note that there [are formal proposals](https://people.mpi-sws.org/~jung/twinsem/twinsem.pdf) for LLVM semantics where `getelementptr inbounds` with offset 0 isn't quite the identity function but never returns `poison` (it affects the provenance of the pointer but in a way that doesn't matter if this pointer is never used for memory accesses), and indeed this is likely necessary to consistently describe LLVM semantics. But with the informal LLVM LangRef that we have right now, and with LLVM devs insisting otherwise, it seems unwise to rely on this.
      6cd02a85
    • B
      Replace sext() and zext() with single ext() method · 43968aa8
      bjorn3 提交于
      43968aa8
    • B
      Rename prefix_chunk to prefix_chunk_size · 6a5f537f
      bjorn3 提交于
      6a5f537f
    • B
      Remove StructRet arg attr · 39b8b2b6
      bjorn3 提交于
      It is applied exactly when the return value has an indirect pass mode.
      Except for InReg on x86 fastcall, arg attrs are now only used for
      optimization purposes and thus are fine to ignore.
      39b8b2b6
    • B
      Replace ByVal attribute with on_stack field for Indirect · 42b0b808
      bjorn3 提交于
      This makes it clearer that only PassMode::Indirect allows ByVal
      42b0b808
    • B
      Replace ZExt and SExt flags with ArgExtension enum · 967a2282
      bjorn3 提交于
      Both flags are mutually exclusive
      967a2282
    • B
      Auto merge of #79237 - alexcrichton:update-backtrace, r=Mark-Simulacrum · 3adedb8f
      bors 提交于
      std: Update the bactrace crate submodule
      
      This commit updates the `library/backtrace` submodule which primarily
      pulls in support for split-debuginfo on macOS, avoiding the need for
      `dsymutil` to get run to get line numbers and filenames in backtraces.
      3adedb8f
    • J
      x.py test --bless · e280ae86
      Joshua Nelson 提交于
      e280ae86
  2. 21 11月, 2020 17 次提交