Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 16 pull requests #81545

Merged
merged 42 commits into from
Jan 30, 2021
Merged

Rollup of 16 pull requests #81545

merged 42 commits into from
Jan 30, 2021

Commits on Jan 13, 2021

  1. Stabilize unsigned_abs

    jhpratt committed Jan 13, 2021
    Configuration menu
    Copy the full SHA
    8539425 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    edf2e37 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2021

  1. Add core::stream::Stream

    This patch adds the `core::stream` submodule and implements `core::stream::Stream` in accordance with RFC2996.
    
    Add feedback from @camelid
    yoshuawuyts committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    0c8db16 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. Make functional record update/struct update syntax works inside closu…

    …res when feature capture_disjoint_fields is enabled
    null-sleep committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    e94cf57 View commit details
    Browse the repository at this point in the history
  2. Remove Stream::next

    This is a temporary change only, as we wait to resolve dynamic dispatch issues. The `Stream::next` method and corresponding documentation are expected to be fully restored once we have a path to proceed.
    
    Ref: rust-lang/rfcs#2996 (comment)
    
    update docs
    yoshuawuyts committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    a1b1132 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2021

  1. Configuration menu
    Copy the full SHA
    328abfb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    425a70a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c07e558 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a623ea5 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2021

  1. Warn write-only fields

    sanxiyn committed Jan 28, 2021
    Configuration menu
    Copy the full SHA
    d3c69a4 View commit details
    Browse the repository at this point in the history
  2. Simplify base_expr

    Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
    sanxiyn and oli-obk authored Jan 28, 2021
    Configuration menu
    Copy the full SHA
    899aae4 View commit details
    Browse the repository at this point in the history
  3. Add missing brace

    oli-obk authored Jan 28, 2021
    Configuration menu
    Copy the full SHA
    85ad773 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2021

  1. 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".
    camelid committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    f620b5c View commit details
    Browse the repository at this point in the history
  2. 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
    SOF3 authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    02094f9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5e983d7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    63714af View commit details
    Browse the repository at this point in the history
  5. Treat nightlies for a version as complete

    This commit 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.
    
    For users who wish to pin nightlies, this commit adds
    a -Z assume-incomplete-release option that they can
    enable if there are any issues due to this change.
    est31 committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    d8b5745 View commit details
    Browse the repository at this point in the history
  6. Add tests

    est31 committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    dd18c48 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c2c2e8d View commit details
    Browse the repository at this point in the history
  8. fix typo

    henryboisdequin committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    fd5fb86 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    08141a5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    13ffa43 View commit details
    Browse the repository at this point in the history
  11. Fix typo in pat.rs

    parentesized -> parenthesized
    eltociear authored Jan 29, 2021
    Configuration menu
    Copy the full SHA
    718398c View commit details
    Browse the repository at this point in the history
  12. 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
    ```
    jyn514 committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    807b5f5 View commit details
    Browse the repository at this point in the history
  13. 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.
    jyn514 committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    db115f1 View commit details
    Browse the repository at this point in the history
  14. 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 rust-lang#80556
    nagisa committed Jan 29, 2021
    Configuration menu
    Copy the full SHA
    915a04e View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2021

  1. Rollup merge of rust-lang#79023 - yoshuawuyts:stream, r=KodrAus

    Add `core::stream::Stream`
    
    [[Tracking issue: rust-lang#79024](rust-lang#79024)]
    
    This patch adds the `core::stream` submodule and implements `core::stream::Stream` in accordance with [RFC2996](rust-lang/rfcs#2996). The RFC hasn't been merged yet, but as requested by the libs team in rust-lang/rfcs#2996 (comment) 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`````
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    ecd7cb1 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#80562 - nagisa:nagisa/bools-are-unsigned, r…

    …=eddyb
    
    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 rust-lang#80556
    
    cc `@eddyb`
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    a5c12ea View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#80886 - RalfJung:stable-raw-ref-macros, r=m…

    …-ou-se
    
    Stabilize raw ref macros
    
    This stabilizes `raw_ref_macros` (rust-lang#73394), which is possible now that rust-lang#74355 is fixed.
    
    However, as I already said in rust-lang#73394 (comment), 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 rust-lang#73394
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    b94d84d View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#80959 - jhpratt:unsigned_abs-stabilization,…

    … r=m-ou-se
    
    Stabilize `unsigned_abs`
    
    Resolves rust-lang#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.
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    91ea1cb View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#81291 - sexxi-goose:fix-struct-update-funct…

    …ional-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 rust-lang/project-rfc-2229#32
    r? ``````@nikomatsakis``````
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    7fa991f View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#81409 - gilescope:chars_count, r=joshtriplett

    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?
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    c26dd4d View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#81468 - est31:cfg_version, r=petrochenkov

    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 rust-lang#64796 (comment)
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    fe27dea View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#81473 - sanxiyn:write-only-field, r=oli-obk

    Warn write-only fields
    
    cc `@Boscop's` example in rust-lang#49256.
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    774ba83 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#81495 - camelid:rustdoc-output_format-optio…

    …nal, r=GuillaumeGomez
    
    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`````
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    b43c1d5 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#81499 - SOF3:patch-1, r=sanxiyn

    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
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    0f11a94 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#81501 - calebcartwright:update-rustfmt, r=s…

    …anxiyn
    
    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](rust-lang/rustfmt#4634), [PR rust-lang/rustfmt#4639](rust-lang/rustfmt#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](rust-lang/rustfmt#4084))
    - Fix incorrect span usage wit const generics in supertraits ([rust-lang/rustfmt#4204](rust-lang/rustfmt#4204))
    - Use correct span for const generic params ([rust-lang/rustfmt#4263](rust-lang/rustfmt#4263))
    - Correct span on const generics to include type bounds ([rust-lang/rustfmt#4310](rust-lang/rustfmt#4310))
    - Idempotence issue on blocks containing only empty statements ([rust-lang/rustfmt#4627](rust-lang/rustfmt#4627) and [rust-lang#3868](rust-lang/rustfmt#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](rust-lang/rustfmt#4646))
    - Avoid shared interned cfg_if symbol since rustfmt can re-initialize the rustc_ast globals on multiple inputs ([rust-lang/rustfmt#4656](rust-lang/rustfmt#4656))
    - Don't insert trailing comma on (base-less) rest in struct literals within macros ([rust-lang/rustfmt#4675](rust-lang/rustfmt#4675))
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    6090c57 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#81505 - henryboisdequin:cold_path-not-pub, …

    …r=sanxiyn
    
    `fn cold_path` doesn't need to be pub
    
    Fixes rust-lang#81429
    
    Note: this PR also fixes a small typo that I found
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    ba40cea View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#81512 - GuillaumeGomez:cleanup-fixme-rustdo…

    …c, r=bugadani
    
    Add missing variants in match binding
    
    cc `````@bugadani````` `````@CraftSpider`````
    r? `````@camelid`````
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    596b394 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#81515 - eltociear:patch-7, r=jonas-schievink

    Fix typo in pat.rs
    
    parentesized -> parenthesized
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    5df611c View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#81519 - jyn514:rustup-toolchain, r=Mark-Sim…

    …ulacrum
    
    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
    ```
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    e3905aa View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#81520 - jyn514:rustc2, r=Mark-Simulacrum

    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 rust-lang#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.
    JohnTitor authored Jan 30, 2021
    Configuration menu
    Copy the full SHA
    31e7634 View commit details
    Browse the repository at this point in the history