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 11 pull requests #81406

Closed
wants to merge 29 commits into from
Closed

Commits on Jan 10, 2021

  1. Add unwrap_unchecked() methods for Option and Result

    In particular:
      - `unwrap_unchecked()` for `Option`.
      - `unwrap_unchecked()` and `unwrap_err_unchecked()` for `Result`.
    
    These complement other `*_unchecked()` methods in `core` etc.
    
    Currently there are a couple of places it may be used inside rustc
    (`LinkedList`, `BTree`). It is also easy to find other repositories
    with similar functionality.
    
    Fixes rust-lang#48278.
    
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 10, 2021
    Configuration menu
    Copy the full SHA
    679f6f3 View commit details
    Browse the repository at this point in the history
  2. Add SAFETY annotations

    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 10, 2021
    Configuration menu
    Copy the full SHA
    76299b3 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2021

  1. Reset LateContext enclosing body in nested items

    Prevents LateContext::maybe_typeck_results() from returning data in a
    nested item without a body. Consequently, LateContext::qpath_res is less
    likely to ICE when called in a nested item. Would have prevented
    rust-lang/rust-clippy#4545, presumably.
    camsteffen committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    63a1eee View commit details
    Browse the repository at this point in the history
  2. Query for TypeckResults in LateContext::qpath_res

    Actually fulfills the documented guarantees.
    camsteffen committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    21fb586 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    def0e9b View commit details
    Browse the repository at this point in the history
  4. Move test to src/test/ui/consts/

    Apparently `tidy` has a hard limit of 2830 tests in the
    `src/test/ui/issues/` directory, and this test hit that limit.
    
    `src/test/ui/consts/` is probably a better location anyway.
    camelid committed Jan 18, 2021
    Configuration menu
    Copy the full SHA
    a7b7a43 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    eaba3da View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2021

  1. Make -Z time-passes less noisy

    - Add the module name to `pre_AST_expansion_passes` and don't make it a
      verbose event (since it normally doesn't take very long, and it's
      emitted many times)
    - Don't make the following rustdoc events verbose; they're emitted many times.
      + build_extern_trait_impl
      + build_local_trait_impl
      + build_primitive_trait_impl
      + get_auto_trait_impls
      + get_blanket_trait_impls
    - Remove `get_auto_trait_and_blanket_synthetic_impls`; it's wholly
      covered by get_{auto,blanket}_trait_impls and not very useful.
    jyn514 committed Jan 23, 2021
    Configuration menu
    Copy the full SHA
    3b8f1b7 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2021

  1. Fix spelling in documentation for error E0207

    I have trouble parsing the the wording "type parameter parameter".
    jockbert committed Jan 24, 2021
    Configuration menu
    Copy the full SHA
    1d03648 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2021

  1. Configuration menu
    Copy the full SHA
    2be1993 View commit details
    Browse the repository at this point in the history
  2. rustc_codegen_ssa: use wall time for codegen_to_LLVM_IR time-passes e…

    …ntry
    
    Use elapsed wall time spent on codegen_to_LLVM_IR for all CGUs as a
    whole, rather than the sum for each CGU (the distinction matters for
    parallel builds, where some CGUs are processed in parallel).
    tgnottingham committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    59195a2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    088c89d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    042facb View commit details
    Browse the repository at this point in the history
  5. Link the reference about undefined behavior

    Suggested-by: Mara Bos <m-ou.se@m-ou.se>
    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    0140dac View commit details
    Browse the repository at this point in the history
  6. Add tracking issue

    Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    ojeda committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    01250fc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1c0a52d View commit details
    Browse the repository at this point in the history
  8. rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo

    This commit adds a new stable codegen option to rustc,
    `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
    subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
    subsumed by this flag but still requires `-Zunstable-options` to
    actually activate. The `-Csplit-debuginfo` flag takes one of
    three values:
    
    * `off` - This indicates that split-debuginfo from the final artifact is
      not desired. This is not supported on Windows and is the default on
      Unix platforms except macOS. On macOS this means that `dsymutil` is
      not executed.
    
    * `packed` - This means that debuginfo is desired in one location
      separate from the main executable. This is the default on Windows
      (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
      `-Zsplit-dwarf=single` and produces a `*.dwp` file.
    
    * `unpacked` - This means that debuginfo will be roughly equivalent to
      object files, meaning that it's throughout the build directory
      rather than in one location (often the fastest for local development).
      This is not the default on any platform and is not supported on Windows.
    
    Each target can indicate its own default preference for how debuginfo is
    handled. Almost all platforms default to `off` except for Windows and
    macOS which default to `packed` for historical reasons.
    
    Some equivalencies for previous unstable flags with the new flags are:
    
    * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
    * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
    * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
    * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`
    
    Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
    non-macOS platforms since split-dwarf support was *just* implemented in
    rustc.
    
    There's some more rationale listed on rust-lang#79361, but the main gist of the
    motivation for this commit is that `dsymutil` can take quite a long time
    to execute in debug builds and provides little benefit. This means that
    incremental compile times appear that much worse on macOS because the
    compiler is constantly running `dsymutil` over every single binary it
    produces during `cargo build` (even build scripts!). Ideally rustc would
    switch to not running `dsymutil` by default, but that's a problem left
    to get tackled another day.
    
    Closes rust-lang#79361
    alexcrichton committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    b8852d4 View commit details
    Browse the repository at this point in the history
  9. Update books

    ehuss committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    fdd592a View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2021

  1. Rollup merge of rust-lang#79570 - alexcrichton:split-debuginfo, r=bjorn3

    rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`
    
    This commit adds a new stable codegen option to rustc,
    `-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
    subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
    subsumed by this flag but still requires `-Zunstable-options` to
    actually activate. The `-Csplit-debuginfo` flag takes one of
    three values:
    
    * `off` - This indicates that split-debuginfo from the final artifact is
      not desired. This is not supported on Windows and is the default on
      Unix platforms except macOS. On macOS this means that `dsymutil` is
      not executed.
    
    * `packed` - This means that debuginfo is desired in one location
      separate from the main executable. This is the default on Windows
      (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
      `-Zsplit-dwarf=single` and produces a `*.dwp` file.
    
    * `unpacked` - This means that debuginfo will be roughly equivalent to
      object files, meaning that it's throughout the build directory
      rather than in one location (often the fastest for local development).
      This is not the default on any platform and is not supported on Windows.
    
    Each target can indicate its own default preference for how debuginfo is
    handled. Almost all platforms default to `off` except for Windows and
    macOS which default to `packed` for historical reasons.
    
    Some equivalencies for previous unstable flags with the new flags are:
    
    * `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
    * `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
    * `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
    * `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`
    
    Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
    non-macOS platforms since split-dwarf support was *just* implemented in
    rustc.
    
    There's some more rationale listed on rust-lang#79361, but the main gist of the
    motivation for this commit is that `dsymutil` can take quite a long time
    to execute in debug builds and provides little benefit. This means that
    incremental compile times appear that much worse on macOS because the
    compiler is constantly running `dsymutil` over every single binary it
    produces during `cargo build` (even build scripts!). Ideally rustc would
    switch to not running `dsymutil` by default, but that's a problem left
    to get tackled another day.
    
    Closes rust-lang#79361
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    4ace4e6 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#80876 - ojeda:option-result-unwrap_unchecke…

    …d, r=m-ou-se
    
    Add `unwrap_unchecked()` methods for `Option` and `Result`
    
    In particular:
      - `unwrap_unchecked()` for `Option`.
      - `unwrap_unchecked()` and `unwrap_err_unchecked()` for `Result`.
    
    These complement other `*_unchecked()` methods in `core` etc.
    
    Currently there are a couple of places it may be used inside rustc (`LinkedList`, `BTree`). It is also easy to find other repositories with similar functionality.
    
    Fixes rust-lang#48278.
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    544c07b View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#80900 - camelid:readpointerasbytes-ice, r=o…

    …li-obk
    
    Fix ICE with `ReadPointerAsBytes` validation error
    
    Fixes rust-lang#79690.
    
    r? `````@oli-obk`````
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    541a73f View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#81176 - camsteffen:qpath-res, r=oli-obk

    Improve safety of `LateContext::qpath_res`
    
    This is my first rustc code change, inspired by hacking on clippy!
    
    The first change is to clear cached `TypeckResults` from `LateContext` when visiting a nested item. I took a hint from [here](https://github.com/rust-lang/rust/blob/5e91c4ecc09312d8b63d250a432b0f3ef83f1df7/compiler/rustc_privacy/src/lib.rs#L1300).
    
    Clippy has a `qpath_res` util function to avoid a possible ICE in `LateContext::qpath_res`. But the docs of `LateContext::qpath_res` promise no ICE. So this updates the `LateContext` method to keep its promises, and removes the util function.
    
    Related: rust-lang/rust-clippy#4545
    
    CC ````@eddyb```` since you've done related work
    CC ````@flip1995```` FYI
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    5e28acc View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#81195 - estebank:suggest-bound-on-trait-wit…

    …h-params, r=oli-obk
    
    Account for generics when suggesting bound
    
    Fix rust-lang#81175.
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    b78f52d View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#81284 - jyn514:impl-times, r=wesleywiser

    Make `-Z time-passes` less noisy
    
    - Add the module name to `pre_AST_expansion_passes` and don't make it a
      verbose event (since it normally doesn't take very long, and it's
      emitted many times)
    - Don't make the following rustdoc events verbose; they're emitted many times.
      + build_extern_trait_impl
      + build_local_trait_impl
      + build_primitive_trait_impl
      + get_auto_trait_impls
      + get_blanket_trait_impls
    - Remove the `get_auto_trait_and_blanket_synthetic_impls` rustdoc event; it's wholly
      covered by get_{auto,blanket}_trait_impls and not very useful.
    
    I found this while working on rust-lang#81275 but it's independent of those changes.
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    76f4a04 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#81299 - GuillaumeGomez:fix-eslint-detected-…

    …bugs, r=Nemo157
    
    Fix some bugs reported by eslint
    
    Simply went into `src/librustdoc/html/static/` and ran `eslint *.js` in case you want to reproduce. :)
    
    r? `````@Nemo157`````
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    796bd53 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#81353 - jockbert:spelling_in_e0207, r=petro…

    …chenkov
    
    Fix spelling in documentation for error E0207
    
    I have trouble parsing the the wording "type parameter parameter".
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    da955bc View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#81369 - tgnottingham:codegen-to-llvm-ir-wal…

    …l-time, r=lcnr
    
    rustc_codegen_ssa: use wall time for codegen_to_LLVM_IR time-passes entry
    
    Use elapsed wall time spent on codegen_to_LLVM_IR for all CGUs as a
    whole, rather than the sum for each CGU (the distinction matters for
    parallel builds, where some CGUs are processed in parallel).
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    766afeb View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#81389 - ehuss:rustdoc-cmark-extensions, r=G…

    …uillaumeGomez
    
    rustdoc: Document CommonMark extensions.
    
    This updates the rustdoc book to include some documentation on the CommonMark extensions that rustdoc supports.
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    07ade39 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#81399 - ehuss:update-books, r=ehuss

    Update books
    
    ## nomicon
    
    7 commits in a8584998eacdea7106a1dfafcbf6c1c06fcdf925..bbf06ad39d1f45654047e9596b750cc6e6d1b693
    2021-01-06 12:49:49 -0500 to 2021-01-22 07:07:31 -0800
    - Fix alloc link in exotic-sizes for local docs (rust-lang/nomicon#255)
    - Remove TODO
    - Fix small punctuation error
    - Arc revisions (Clone atomic explanation) (pt2/3(+?))
    - Fix Arc Clone
    - Arc revisions (pt1/2(+?))
    - Simple Arc implementation (without Weak refs)
    
    ## reference
    
    5 commits in 50af691f838937c300b47812d0507c6d88c14f97..f02b09eb6e8af340ad1256a54adb7aae2ff3163e
    2021-01-12 21:19:20 -0800 to 2021-01-22 01:53:02 -0800
    - Fix missing space (rust-lang/reference#941)
    - Start documenting name resolution. (rust-lang/reference#937)
    - Fix plural and delete spurious words in comparison ops (rust-lang/reference#932)
    - Document execution order (rust-lang/reference#888)
    - Compound operator expressions (rust-lang/reference#915)
    
    ## book
    
    3 commits in ac57a0ddd23d173b26731ccf939f3ba729753275..e724bd826580ff95df48a8533af7dec1080693d4
    2021-01-09 14:18:45 -0500 to 2021-01-20 08:19:49 -0600
    - Fixes rust-lang/book#2417. Get the index from user input instead of a const. (rust-lang/book#2566)
    - Turn off the playground in a bunch more lib.rs inclusions (rust-lang/book#2569)
    - Merge pull request rust-lang/book#2567 from rust-lang/rust-1.49
    
    ## rust-by-example
    
    1 commits in 03e23af01f0b4f83a3a513da280e1ca92587f2ec..f633769acef68574427a6fae6c06f13bc2199573
    2021-01-09 10:20:28 -0300 to 2021-01-13 20:58:25 -0300
    - Fixed styling on closure example (rust-lang/rust-by-example#1405)
    JohnTitor committed Jan 26, 2021
    Configuration menu
    Copy the full SHA
    554f8c3 View commit details
    Browse the repository at this point in the history