1. 31 1月, 2021 10 次提交
  2. 30 1月, 2021 30 次提交
    • B
      Auto merge of #6653 - flip1995:rustup, r=flip1995 · 4db76a6b
      bors 提交于
      Rustup
      
      changelog: Deprecate `unknown_clippy_lints` (integrated in `unknown_lints`)
      
      r? `@ghost`
      4db76a6b
    • F
      Bump nightly version -> 2021-01-30 · 60ab57e4
      flip1995 提交于
      60ab57e4
    • F
      e2859437
    • B
      Auto merge of #81545 - JohnTitor:rollup-zlt3tn6, r=JohnTitor · 7ce1b3b2
      bors 提交于
      Rollup of 16 pull requests
      
      Successful merges:
      
       - #79023 (Add `core::stream::Stream`)
       - #80562 (Consider Scalar to be a bool only if its unsigned)
       - #80886 (Stabilize raw ref macros)
       - #80959 (Stabilize `unsigned_abs`)
       - #81291 (Support FRU pattern with `[feature(capture_disjoint_fields)]`)
       - #81409 (Slight simplification of chars().count())
       - #81468 (cfg(version): treat nightlies as complete)
       - #81473 (Warn write-only fields)
       - #81495 (rustdoc: Remove unnecessary optional)
       - #81499 (Updated Vec::splice documentation)
       - #81501 (update rustfmt to v1.4.34)
       - #81505 (`fn cold_path` doesn't need to be pub)
       - #81512 (Add missing variants in match binding)
       - #81515 (Fix typo in pat.rs)
       - #81519 (Don't print error output from rustup when detecting default build triple)
       - #81520 (Don't clone LLVM submodule when download-ci-llvm is set)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      7ce1b3b2
    • B
      Auto merge of #81521 - nikic:update-dist-various, r=Mark-Simulacrum · ebaea9e8
      bors 提交于
      Update dist-various to Ubuntu 20.04
      
      This updates the dist-various-1 and dist-various-2 images to Ubuntu
      20.04. This requires some adjustments:
      
       * `DEBIAN_FRONTEND=noninteractive` required for apt install.
       * `team-gcc-argm-embedded` PPA does not support focal. However,
         we can simply use the distro-provided `gcc-arm-none-eabi`. Per
         the comment, the PPA was only used to get a newer version.
       * rumprun has to be updated to avoid a linker error.
       * We need to build rumrun with `NOGCCERROR`, which disables use
         of `-Werror` and allows building with a newer compiler.
       * We need to install `libtinfo5`, which appears to be a dependency
         of the clang used during the fuchsia build.
       * We need to switch to `g++-8` rather than `g++-7`, as at least
         `g++-7-arm-linux-gnueabi` is not available on focal.
       * We need to upgrade to GCC 6.5 for the Solaris build, as GCC 6.4
         does not support the newer libisl version.
      
      r? `@Mark-Simulacrum`
      ebaea9e8
    • Y
      Rollup merge of #81520 - jyn514:rustc2, r=Mark-Simulacrum · 31e76347
      Yuki Okushi 提交于
      Don't clone LLVM submodule when download-ci-llvm is set
      
      Previously, `downloading_llvm` would check `self.build` while it was
      still an empty string, and think it was always false. This fixes the
      check.
      
      This addresses the worst part of https://github.com/rust-lang/rust/issues/76653. There are still some large submodules being downloaded (in particular, `rustc-by-example` is 146 MB, and all the submodules combined are 311 MB), but this is a lot better than the whopping 1.4 GB before.
      31e76347
    • Y
      Rollup merge of #81519 - jyn514:rustup-toolchain, r=Mark-Simulacrum · e3905aa5
      Yuki Okushi 提交于
      Don't print error output from rustup when detecting default build triple
      
      Before, it could print this error if no toolchain was configured:
      
      ```
      error: no default toolchain configured
      error: backtrace:
      error: stack backtrace:
         0: error_chain::backtrace::imp::InternalBacktrace::new
         1: rustup::config::Cfg::toolchain_for_dir
         2: rustup_init::run_rustup_inner
         3: rustup_init::main
         4: std::rt::lang_start::{{closure}}
         5: main
         6: __libc_start_main
         7: _start
      ```
      e3905aa5
    • Y
      Rollup merge of #81515 - eltociear:patch-7, r=jonas-schievink · 5df611c5
      Yuki Okushi 提交于
      Fix typo in pat.rs
      
      parentesized -> parenthesized
      5df611c5
    • Y
      Rollup merge of #81512 - GuillaumeGomez:cleanup-fixme-rustdoc, r=bugadani · 596b394d
      Yuki Okushi 提交于
      Add missing variants in match binding
      
      cc `````@bugadani````` `````@CraftSpider`````
      r? `````@camelid`````
      596b394d
    • Y
      Rollup merge of #81505 - henryboisdequin:cold_path-not-pub, r=sanxiyn · ba40cea4
      Yuki Okushi 提交于
      `fn cold_path` doesn't need to be pub
      
      Fixes #81429
      
      Note: this PR also fixes a small typo that I found
      ba40cea4
    • Y
      Rollup merge of #81501 - calebcartwright:update-rustfmt, r=sanxiyn · 6090c571
      Yuki Okushi 提交于
      update rustfmt to v1.4.34
      
      Short summary: Various formatting fixes (several const generic related) and introduction of `imports_granularity` config option
      
      Long summary copied from changelog:
      
      #### Changed
      - `merge_imports` configuration has been deprecated in favor of the new `imports_granularity` option. Any existing usage of `merge_imports` will be automatically mapped to the corresponding value on `imports_granularity` with a warning message printed to encourage users to update their config files.
      
      #### Added
      - New `imports_granularity` option has been added which succeeds `merge_imports`. This new option supports several additional variants which allow users to merge imports at different levels (crate or module), and even flatten imports to have a single use statement per item. ([PR rust-lang/rustfmt#4634](https://github.com/rust-lang/rustfmt/pull/4634), [PR rust-lang/rustfmt#4639](https://github.com/rust-lang/rustfmt/pull/4639))
      
      See the section on the configuration site for more information
      https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity
      
      #### Fixed
      - Fix erroneous removal of `const` keyword on const trait impl ([rust-lang/rustfmt#4084](https://github.com/rust-lang/rustfmt/issues/4084))
      - Fix incorrect span usage wit const generics in supertraits ([rust-lang/rustfmt#4204](https://github.com/rust-lang/rustfmt/issues/4204))
      - Use correct span for const generic params ([rust-lang/rustfmt#4263](https://github.com/rust-lang/rustfmt/issues/4263))
      - Correct span on const generics to include type bounds ([rust-lang/rustfmt#4310](https://github.com/rust-lang/rustfmt/issues/4310))
      - Idempotence issue on blocks containing only empty statements ([rust-lang/rustfmt#4627](https://github.com/rust-lang/rustfmt/issues/4627) and [#3868](https://github.com/rust-lang/rustfmt/issues/3868))
      - Fix issue with semicolon placement on required functions that have a trailing comment that ends in a line-style comment before the semicolon ([rust-lang/rustfmt#4646](https://github.com/rust-lang/rustfmt/issues/4646))
      - Avoid shared interned cfg_if symbol since rustfmt can re-initialize the rustc_ast globals on multiple inputs ([rust-lang/rustfmt#4656](https://github.com/rust-lang/rustfmt/issues/4656))
      - Don't insert trailing comma on (base-less) rest in struct literals within macros ([rust-lang/rustfmt#4675](https://github.com/rust-lang/rustfmt/issues/4675))
      6090c571
    • Y
      Rollup merge of #81499 - SOF3:patch-1, r=sanxiyn · 0f11a943
      Yuki Okushi 提交于
      Updated Vec::splice documentation
      
      Replacing with equal number of values does not increase the length of the vec.
      
      Reference: https://stackoverflow.com/a/62559271/3990767
      0f11a943
    • Y
      Rollup merge of #81495 - camelid:rustdoc-output_format-optional, r=GuillaumeGomez · b43c1d50
      Yuki Okushi 提交于
      rustdoc: Remove unnecessary optional
      
      Previously, the HTML output format was represented by both
      `Some(OutputFormat::Html)` and `None` so there's no need to have an
      optional. Instead, `OutputFormat::Html` is explicitly the default and we
      no longer have a "tri-state enum".
      
      r? `````@GuillaumeGomez`````
      b43c1d50
    • Y
      Rollup merge of #81473 - sanxiyn:write-only-field, r=oli-obk · 774ba832
      Yuki Okushi 提交于
      Warn write-only fields
      
      cc `@Boscop's` example in #49256.
      774ba832
    • Y
      Rollup merge of #81468 - est31:cfg_version, r=petrochenkov · fe27dea4
      Yuki Okushi 提交于
      cfg(version): treat nightlies as complete
      
      This PR makes cfg(version) treat the nightlies
      for version 1.n.0 as 1.n.0, even though that nightly
      version might not have all stabilizations and features
      of the released 1.n.0. This is done for greater
      convenience for people who want to test a newly
      stabilized feature on nightly, or in other words,
      give newly stabilized features as many eyeballs
      as possible.
      
      For users who wish to pin nightlies, this commit adds
      a -Z assume-incomplete-release option that they can
      enable if they run into any issues due to this change.
      Implements the suggestion in https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454
      fe27dea4
    • Y
      Rollup merge of #81409 - gilescope:chars_count, r=joshtriplett · c26dd4d4
      Yuki Okushi 提交于
      Slight simplification of chars().count()
      
      Slight simplification: No need to call len(), we can just count the number of non continuation bytes.
      
      I can't see any reason not to do this, can you?
      c26dd4d4
    • Y
      Rollup merge of #81291 -... · 7fa991fb
      Yuki Okushi 提交于
      Rollup merge of #81291 - sexxi-goose:fix-struct-update-functional-record-update-syntax-error, r=nikomatsakis
      
      Support FRU pattern with `[feature(capture_disjoint_fields)]`
      
      In case of a functional record update syntax for creating a structure, `ExprUseVisitor` to only detect the precise use of some of the field in the `..x` part of the syntax. However, when we start building MIR, we
      1. First, build the place for `x`
      2. and then, add precise field projections so that only some parts of `x` end up getting read.
      
      When `capture_disjoint_fields` is enabled, and FRU is used within a closure `x` won't be completely captured, and therefore the first step will fail. This PR updates `mir_build` to create a place builder in the first step and then create place from the builder only after applying the field projection.
      
      Closes https://github.com/rust-lang/project-rfc-2229/issues/32
      r? ``````@nikomatsakis``````
      7fa991fb
    • Y
      Rollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-se · 91ea1cbc
      Yuki Okushi 提交于
      Stabilize `unsigned_abs`
      
      Resolves #74913.
      
      This PR stabilizes the `i*::unsigned_abs()` method, which returns the absolute value of an integer _as its unsigned equivalent_. This has the advantage that it does not overflow on `i*::MIN`.
      
      I have gone ahead and used this in a couple locations throughout the repository.
      91ea1cbc
    • Y
      Rollup merge of #80886 - RalfJung:stable-raw-ref-macros, r=m-ou-se · b94d84d3
      Yuki Okushi 提交于
      Stabilize raw ref macros
      
      This stabilizes `raw_ref_macros` (https://github.com/rust-lang/rust/issues/73394), which is possible now that https://github.com/rust-lang/rust/issues/74355 is fixed.
      
      However, as I already said in https://github.com/rust-lang/rust/issues/73394#issuecomment-751342185, I am not particularly happy with the current names of the macros. So I propose we also change them, which means I am proposing to stabilize the following in `core::ptr`:
      ```rust
      pub macro const_addr_of($e:expr) {
          &raw const $e
      }
      
      pub macro mut_addr_of($e:expr) {
          &raw mut $e
      }
      ```
      
      The macro name change means we need another round of FCP. Cc `````@rust-lang/libs`````
      Fixes #73394
      b94d84d3
    • Y
      Rollup merge of #80562 - nagisa:nagisa/bools-are-unsigned, r=eddyb · a5c12ea7
      Yuki Okushi 提交于
      Consider Scalar to be a bool only if its unsigned
      
      This seems right, given that conceptually bools are unsigned, but the
      implications of this change may have more action at distance that I'm
      not sure how to exhaustively consider.
      
      For instance there are a number of cases where code attaches range
      metadata if `scalar.is_bool()` holds. Supposedly it would no longer be
      attached to the `repr(i8)` enums? Though I'm not sure why booleans are
      being special-cased here in the first place...
      
      Fixes #80556
      
      cc `@EddyB`
      a5c12ea7
    • Y
      Rollup merge of #79023 - yoshuawuyts:stream, r=KodrAus · ecd7cb1c
      Yuki Okushi 提交于
      Add `core::stream::Stream`
      
      [[Tracking issue: #79024](https://github.com/rust-lang/rust/issues/79024)]
      
      This patch adds the `core::stream` submodule and implements `core::stream::Stream` in accordance with [RFC2996](https://github.com/rust-lang/rfcs/pull/2996). The RFC hasn't been merged yet, but as requested by the libs team in https://github.com/rust-lang/rfcs/pull/2996#issuecomment-725696389 I'm filing this PR to get the ball rolling.
      
      ## Documentatation
      
      The docs in this PR have been adapted from [`std::iter`](https://doc.rust-lang.org/std/iter/index.html), [`async_std::stream`](https://docs.rs/async-std/1.7.0/async_std/stream/index.html), and [`futures::stream::Stream`](https://docs.rs/futures/0.3.8/futures/stream/trait.Stream.html). Once this PR lands my plan is to follow this up with PRs to add helper methods such as `stream::repeat` which can be used to document more of the concepts that are currently missing. That will allow us to cover concepts such as "infinite streams" and "laziness" in more depth.
      
      ## Feature gate
      
      The feature gate for `Stream` is `stream_trait`. This matches the `#[lang = "future_trait"]` attribute name. The intention is that only the APIs defined in RFC2996 will use this feature gate, with future additions such as `stream::repeat` using their own feature gates. This is so we can ensure a smooth path towards stabilizing the `Stream` trait without needing to stabilize all the APIs in `core::stream` at once. But also don't start expanding the API until _after_ stabilization, as was the case with `std::future`.
      
      __edit:__ the feature gate has been changed to `async_stream` to match the feature gate proposed in the RFC.
      
      ## Conclusion
      
      This PR introduces `core::stream::{Stream, Next}` and re-exports it from `std` as `std::stream::{Stream, Next}`. Landing `Stream` in the stdlib has been a mult-year process; and it's incredibly exciting for this to finally happen!
      
      ---
      
      r? `````@KodrAus`````
      cc/ `````@rust-lang/wg-async-foundations````` `````@rust-lang/libs`````
      ecd7cb1c
    • B
      Auto merge of #81489 - nikic:x86-64-dist-update, r=Mark-Simulacrum · cb6787ae
      bors 提交于
      Update Python and Clang on x86 dist images
      
      LLVM 12 no longer builds with Python 2, so install Python 3 in
      preparation for the upgrade (#81451).
      
      However, Clang 10 does not build with Python 3, so we need update
      to Clang 11 as well, which supports both.
      
      Unfortunately, doing so results in errors while linking the
      libLLVM.so into other binaries:
      > __morestack: invalid needed version 2
      
      This is fixed by using LLD instead. Possibly this is due to a binutils
      linker bug, but updating to the latest binutils version does not fix
      it.
      
      r? `@Mark-Simulacrum`
      cc `@cuviper`
      cb6787ae
    • B
      Auto merge of #81398 - bugadani:rustdoc-perf, r=GuillaumeGomez · 0248c6f1
      bors 提交于
      rustdoc tweaking
      
      * Reuse memory
      * simplify `next_def_id`, avoid multiple hashing and unnecessary lookups
      * remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...)
      * convert `add_deref_target` to iterative implementation
      * use `ArrayVec` where we know the max number of elements
      * minor touchups here and there
      * avoid building temporary vectors that get appended to other vectors
      
      At most places I may or may not be doing the compiler's job is this PR.
      0248c6f1
    • B
      rustdoc tweaking · 4b806878
      bors 提交于
      * Reuse memory
      * simplify `next_def_id`, avoid multiple hashing and unnecessary lookups
      * remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...)
      * convert `add_deref_target` to iterative implementation
      * use `ArrayVec` where we know the max number of elements
      * minor touchups here and there
      * avoid building temporary vectors that get appended to other vectors
      
      At most places I may or may not be doing the compiler's job is this PR.
      4b806878
    • S
      Consider Scalar to be a bool only if its unsigned · 915a04e2
      Simonas Kazlauskas 提交于
      This seems right, given that conceptually bools are unsigned, but the
      implications of this change may have more action at distance that I'm
      not sure how to exhaustively consider.
      
      For instance there are a number of cases where code attaches range
      metadata if `scalar.is_bool()` holds. Supposedly it would no longer be
      attached to the `repr(i8)` enums? Though I'm not sure why booleans are
      being special-cased here in the first place...
      
      Fixes #80556
      915a04e2
    • B
      Auto merge of #81534 - RalfJung:miri, r=RalfJung · 9fa9b58a
      bors 提交于
      update Miri
      
      Fixes https://github.com/rust-lang/rust/issues/81467
      Cc `@rust-lang/miri` r? `@ghost`
      9fa9b58a
    • R
      update Miri · 9b09991d
      Ralf Jung 提交于
      9b09991d
    • N
      Update dist-various to Ubuntu 20.04 · b7c8bc7a
      Nikita Popov 提交于
      This updates the dist-various-1 and dist-various-2 images to Ubuntu
      20.04. This requires some adjustments:
      
       * `DEBIAN_FRONTEND=noninteractive` required for apt install.
       * `team-gcc-argm-embedded` PPA does not support focal. However,
         we can simply use the distro-provided `gcc-arm-none-eabi`. Per
         the comment, the PPA was only used to get a newer version.
       * rumprun has to be updated to avoid a linker error.
       * We need to build rumrun with `NOGCCERROR`, which disables use
         of `-Werror` and allows building with a newer compiler.
       * We need to install `libtinfo5`, which appears to be a dependency
         of the clang used during the fuchsia build.
       * We need to switch to `g++-8` rather than `g++-7`, as at least
         `g++-7-arm-linux-gnueabi` is not available on focal.
       * We need to upgrade to GCC 6.5 for the Solaris build, as GCC 6.4
         does not support the newer libisl version.
      b7c8bc7a
    • J
      Don't clone LLVM submodule when download-ci-llvm is set · db115f13
      Joshua Nelson 提交于
      Previously, `downloading_llvm` would check `self.build` while it was
      still an empty string, and think it was always false. This fixes the
      check.
      db115f13
    • J
      Don't print error output from rustup when detecting default build triple · 807b5f55
      Joshua Nelson 提交于
      Before, it could print this error if no toolchain was configured:
      
      ```
      error: no default toolchain configured
      error: backtrace:
      error: stack backtrace:
         0: error_chain::backtrace::imp::InternalBacktrace::new
         1: rustup::config::Cfg::toolchain_for_dir
         2: rustup_init::run_rustup_inner
         3: rustup_init::main
         4: std::rt::lang_start::{{closure}}
         5: main
         6: __libc_start_main
         7: _start
      ```
      807b5f55