1. 11 1月, 2020 12 次提交
    • L
      Rename Result::as_deref_ok to as_deref · a5f42397
      Lzu Tao 提交于
      a5f42397
    • B
      Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichton · e6217972
      bors 提交于
      build-std compatible sanitizer support
      
      ### Motivation
      
      When using `-Z sanitizer=*` feature it is essential that both user code and
      standard library is instrumented. Otherwise the utility of sanitizer will be
      limited, or its use will be impractical like in the case of memory sanitizer.
      
      The recently introduced cargo feature build-std makes it possible to rebuild
      standard library with arbitrary rustc flags. Unfortunately, those changes alone
      do not make it easy to rebuild standard library with sanitizers, since runtimes
      are dependencies of std that have to be build in specific environment,
      generally not available outside rustbuild process. Additionally rebuilding them
      requires presence of llvm-config and compiler-rt sources.
      
      The goal of changes proposed here is to make it possible to avoid rebuilding
      sanitizer runtimes when rebuilding the std, thus making it possible to
      instrument standard library for use with sanitizer with simple, although
      verbose command:
      
      ```
      env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu
      ```
      
      ### Implementation
      
      * Sanitizer runtimes are no long packed into crates. Instead, libraries build
        from compiler-rt are used as is, after renaming them into `librusc_rt.*`.
      * rustc obtains runtimes from target libdir for default sysroot, so that
        they are not required in custom build sysroots created with build-std.
      * The runtimes are only linked-in into executables to address issue #64629.
        (in previous design it was hard to avoid linking runtimes into static
        libraries produced by rustc as demonstrated by sanitizer-staticlib-link
        test, which still passes despite changes made in #64780).
      
      cc @kennytm, @japaric, @firstyear, @choller
      e6217972
    • B
      Auto merge of #68101 - JohnTitor:rollup-mvmjukr, r=JohnTitor · 17563131
      bors 提交于
      Rollup of 8 pull requests
      
      Successful merges:
      
       - #66045 (Add method Result::into_ok)
       - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)
       - #68014 (Unify output of "variant not found" errors)
       - #68019 (Build compiletest with in-tree libtest)
       - #68039 (remove explicit strip-hidden pass from compiler doc generation)
       - #68050 (Canonicalize rustc_error imports)
       - #68059 (Allow specifying LLVM args in target specifications)
       - #68075 (rustbuild: Cleanup book generation)
      
      Failed merges:
      
       - #68089 (Unstabilize `Vec::remove_item`)
      
      r? @ghost
      17563131
    • Y
      Rollup merge of #68075 - ollie27:rustbuild_books, r=Mark-Simulacrum · bcfb3806
      Yuki Okushi 提交于
      rustbuild: Cleanup book generation
      
      The Cargo book can be generated the same way as the other books.
      bcfb3806
    • Y
      Rollup merge of #68059 - jethrogb:jb/target-llvm-args, r=alexcrichton · 1af7524d
      Yuki Okushi 提交于
      Allow specifying LLVM args in target specifications
      1af7524d
    • Y
      Rollup merge of #68050 - Centril:canon-error, r=Mark-Simulacrum · 7ae0618e
      Yuki Okushi 提交于
      Canonicalize rustc_error imports
      
      r? @Mark-Simulacrum
      7ae0618e
    • Y
      Rollup merge of #68039 - euclio:remove-strip-hidden, r=dtolnay · 93f0ba97
      Yuki Okushi 提交于
      remove explicit strip-hidden pass from compiler doc generation
      
      `strip-hidden` is now implied by `--document-private-items` with #67875, so there's no need to specify it anymore.
      93f0ba97
    • Y
      Rollup merge of #68019 - cuviper:in-tree-compiletest, r=Mark-Simulacrum · a74c7907
      Yuki Okushi 提交于
      Build compiletest with in-tree libtest
      
      This updates compiletest to build in `Mode::ToolStd`, using the locally-built crates for `std` and especially `test`. This way we're immune to unstable differences in the bootstrap compiler crates, whether that's a prior-release stage0 or a current release local rebuild. Fixes #59264.
      
      As a minor cleanup, this also removes the unused `llvm_tools` flag.
      a74c7907
    • Y
      Rollup merge of #68014 - estebank:unify-e0599, r=cramertj · a491100a
      Yuki Okushi 提交于
      Unify output of "variant not found" errors
      
      Fix #49566.
      a491100a
    • Y
      Rollup merge of #67258 - Centril:open-ended-ranges, r=oli-obk · 793b1be6
      Yuki Okushi 提交于
      Introduce `X..`, `..X`, and `..=X` range patterns
      
      Tracking issue: https://github.com/rust-lang/rust/issues/67264
      Feature gate: `#![feature(half_open_range_patterns)]`
      
      ---------------------------
      
      In this PR, we introduce range-from (`X..`), range-to (`..X`), and range-to-inclusive (`..=X`) patterns.
      These correspond to the `RangeFrom`, `RangeTo`, and `RangeToInclusive` expression forms introduced with the same syntaxes. The correspondence is both syntactic and semantic (in the sense that e.g. a `X..` pattern matching on a scrutinee `s` holds exactly when `(X..).contains(&s)` holds).
      
      ---------------------------
      
      Noteworthy:
      
      - The compiler complexity added with this PR is around 10 lines (discounting new tests, which account for the large PR size).
      
      - `...X` is accepted syntactically with the same meaning as `..=X`. This is done primarily to simplify and unify the implementation & spec. If-and-when we decide to make `X...Y` a hard error on a new edition, we can do the same for `...X` patterns as well.
      
      - `X...` and `X..=` is rejected syntactically just like it is for the expression equivalents. We should perhaps make these into semantic restrictions (cc @petrochenkov).
      
      - In HAIR, these half-open ranges are represented by inserting the max/min values for the approprate types. That is, `X..` where `X: u8` would become `X..=u8::MAX` in HAIR (note the `..=` since `RangeFrom` includes the end).
      
      - Exhaustive integer / char matching does not (yet) allow for e.g. exhaustive matching on `0usize..` or `..5usize | 5..` (same idea for `isize`). This would be a substantially more invasive change, and could be added in some other PR.
      
      - The issues with slice pattern syntax has been resolved as we decided to use `..` to mean a "rest-pattern" and `[xs @ ..]` to bind the rest to a name in a slice pattern.
      
      - Like with https://github.com/rust-lang/rust/pull/35712, which provided `X..Y` range patterns, this is not yet backed up by an RFC. I'm providing this experimental implementation now to have something concrete to discuss. I would be happy to provide an RFC for this PR as well as for #35712 to finalize and confirm the ideas with the larger community.
      
      Closes https://github.com/rust-lang/rfcs/issues/947.
      
      ---------------------------
      
      r? @varkor cc @matthewjasper @oli-obk
      
      I would recommend reviewing this (in particular HAIR-lowering and pattern parsing changes) with whitespace changes ignored.
      793b1be6
    • Y
      Rollup merge of #66045 - mzabaluev:unwrap-infallible, r=dtolnay · 2dbcf084
      Yuki Okushi 提交于
      Add method Result::into_ok
      
      Implementation of https://github.com/rust-lang/rfcs/pull/2799
      
      Tracking issue #61695
      2dbcf084
    • B
      Auto merge of #67996 - JohnTitor:clippy-up, r=JohnTitor · ac6eb0db
      bors 提交于
      Update Clippy
      
      Fixes #67994
      
      r? @ghost
      ac6eb0db
  2. 10 1月, 2020 28 次提交