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

update from origin 2020-06-23 #6

Merged
merged 334 commits into from
Jun 24, 2020
Merged

update from origin 2020-06-23 #6

merged 334 commits into from
Jun 24, 2020
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Jun 19, 2020

  1. Remove old commented code

    Lucretiel committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    0094f44 View commit details
    Browse the repository at this point in the history
  2. Remove the const_raw_ptr_comparison feature gate.

    We can never supply a meaningful implementation of this.
    Instead, the follow up commits will create two intrinsics
    that approximate comparisons:
    
    * `ptr_maybe_eq`
    * `ptr_maybe_ne`
    
    The fact that `ptr_maybe_eq(a, b)` is not necessarily the same
    value as `!ptr_maybe_ne(a, b)` is a symptom of this entire
    problem.
    oli-obk committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    9245ba8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e09b620 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    84f1d73 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #71568 - hbina:document_unsafety_slice_sort, r=joshtr…

    …iplett
    
    Document unsafety in slice/sort.rs
    
    Let me know if these documentations are accurate c:
    
    I don't think I am capable enough to document the safety of `partition_blocks`, however.
    
    Related issue #66219
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    85e1c3b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #72709 - LeSeulArtichaut:unsafe-liballoc, r=nikomatsakis

    `#[deny(unsafe_op_in_unsafe_fn)]` in liballoc
    
    This PR proposes to make use of the new `unsafe_op_in_unsafe_fn` lint, i.e. no longer consider the body of an unsafe function as an unsafe block and require explicit unsafe block to perform unsafe operations.
    
    This has been first (partly) suggested by @Mark-Simulacrum in #69245 (comment)
    
    Tracking issue for the feature: #71668.
    ~~Blocked on #71862.~~
    r? @Mark-Simulacrum cc @nikomatsakis can you confirm that those changes are desirable? Should I restrict it to only BTree for the moment?
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    55479de View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #73214 - androm3da:hex_inline_asm_00, r=Amanieu

    Add asm!() support for hexagon
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    bc773fe View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #73248 - marmeladema:save-analysis-various-fixes, r=X…

    …anewok
    
    save_analysis: improve handling of enum struct variant
    
    Fixes #61385
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    186640a View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #73257 - davidtwco:issue-73249-improper-ctypes-projec…

    …tion, r=lcnr,varkor
    
    ty: projections in `transparent_newtype_field`
    
    Fixes #73249.
    
    This PR modifies `transparent_newtype_field` so that it handles
    projections with generic parameters, where `normalize_erasing_regions`
    would ICE.
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    17064da View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #73261 - estebank:generics-sized, r=nikomatsakis

    Suggest `?Sized` when applicable for ADTs
    
    Address #71790, fix #27964.
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    4910206 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #73300 - crlf0710:crate_level_only_check, r=petrochenkov

    Implement crate-level-only lints checking.
    
    This implements a crate_level_only flag on lints, and when it is true, it becomes an error when user tries  to specify this flag upon nodes other than crate node.
    
    This also turns on this flag for all non_ascii_ident lints.
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    058971c View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #73334 - ayazhafiz:err/num-type-cannot-fit, r=estebank

    Note numeric literals that can never fit in an expected type
    
    re #72380 (comment)
    
    Given the toy code
    
    ```rust
    fn is_positive(n: usize) {
      n > -1_isize;
    }
    ```
    
    We currently get a type mismatch error like the following:
    
    ```
    error[E0308]: mismatched types
     --> src/main.rs:2:9
      |
    2 |     n > -1_isize;
      |         ^^^^^^^^ expected `usize`, found `isize`
      |
    help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
      |
    2 |     n > (-1_isize).try_into().unwrap();
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ```
    
    But clearly, `-1` can never fit into a `usize`, so the suggestion will
    always panic. A more useful message would tell the user that the value
    can never fit in the expected type:
    
    ```
    error[E0308]: mismatched types
     --> test.rs:2:9
      |
    2 |     n > -1_isize;
      |         ^^^^^^^^ expected `usize`, found `isize`
      |
    note: `-1_isize` can never fit into `usize`
     --> test.rs:2:9
      |
    2 |     n > -1_isize;
      |         ^^^^^^^^
    ```
    
    Which is what this commit implements.
    
    I only added this check for negative literals because
    
    - Currently we can only perform such a check for literals (constant
      value propagation is outside the scope of the typechecker at this
      point)
    - A lint error for out-of-range numeric literals is already emitted
    
    IMO it makes more sense to put this check in librustc_lint, but as far
    as I can tell the typecheck pass happens before the lint pass, so I've
    added it here.
    
    r? @estebank
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    b285d68 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #73357 - petrochenkov:tmap, r=davidtwco

    Use `LocalDefId` for import IDs in trait map
    
    cc #73291 (comment)
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    65c33ed View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #73364 - joshtriplett:inline-asm, r=Amanieu

    asm: Allow multiple template string arguments; interpret them as newline-separated
    
    Allow the `asm!` macro to accept a series of template arguments, and interpret them as if they were concatenated with a '\n' between them. This allows writing an `asm!` where each line of assembly appears in a separate template string argument.
    
    This syntax makes it possible for rustfmt to reliably format and indent each line of assembly, without risking changes to the inside of a template string. It also avoids the complexity of having the user carefully format and indent a multi-line string (including where to put the surrounding quotes), and avoids the extra indentation and lines of a call to `concat!`.
    
    For example, rewriting the second example from the [blog post on the new inline assembly syntax](https://blog.rust-lang.org/inside-rust/2020/06/08/new-inline-asm.html) using multiple template strings:
    
    ```rust
    
    fn main() {
        let mut bits = [0u8; 64];
        for value in 0..=1024u64 {
            let popcnt;
            unsafe {
                asm!(
                    "    popcnt {popcnt}, {v}",
                    "2:",
                    "    blsi rax, {v}",
                    "    jz 1f",
                    "    xor {v}, rax",
                    "    tzcnt rax, rax",
                    "    stosb",
                    "    jmp 2b",
                    "1:",
                    v = inout(reg) value => _,
                    popcnt = out(reg) popcnt,
                    out("rax") _, // scratch
                    inout("rdi") bits.as_mut_ptr() => _,
                );
            }
            println!("bits of {}: {:?}", value, &bits[0..popcnt]);
        }
    }
    ```
    
    Note that all the template strings must appear before all other arguments; you cannot, for instance, provide a series of template strings intermixed with the corresponding operands.
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    687f929 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #73382 - Aaron1011:fix/self-receiver-candidates, r=pe…

    …trochenkov
    
    Only display other method receiver candidates if they actually apply
    
    Previously, we would suggest `Box<Self>` as a valid receiver, even if
    method resolution only succeeded due to an autoderef (e.g. to `&self`)
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    b443a10 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of #73465 - lzutao:spec-char-tostring, r=sfackler

    Add specialization of `ToString for char`
    
    Closes #73462
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    d2272d4 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of #73489 - sexxi-goose:init_place_refactor, r=nikomatsakis

    Refactor hir::Place
    
    For the following code
    ```rust
    let c = || bar(foo.x, foo.x)
    ```
    
    We generate two different `hir::Place`s for both `foo.x`.
    Handling this adds overhead for analysis we need to do for RFC 2229.
    
    We also want to store type information at each Projection to support
    analysis as part of the RFC. This resembles what we have for
    `mir::Place`
    
    This commit modifies the Place as follows:
    - Rename to `PlaceWithHirId`, where there `hir_id` is that of the
    expressioin.
    - Move any other information that describes the access out to another
    struct now called `Place`.
    - Removed `Span`, it can be accessed using the [hir
    API](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.span)
    - Modify `Projection` to be a strucutre of its own, that currently only
    contains the `ProjectionKind`.
    
    Adding type information to projections wil be completed as part of rust-lang/project-rfc-2229#5
    
    Closes rust-lang/project-rfc-2229#3
    Manishearth authored Jun 19, 2020
    Configuration menu
    Copy the full SHA
    a88182f View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    33b304c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    2f9d338 View commit details
    Browse the repository at this point in the history
  20. update tests

    pvdrz committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    014e605 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    1f48465 View commit details
    Browse the repository at this point in the history
  22. code coverage foundation for hash and num_counters

    Replaced dummy values for hash and num_counters with computed values,
    and refactored InstrumentCoverage pass to simplify injecting more
    counters per function in upcoming versions.
    
    Improved usage documentation and error messaging.
    richkadel committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    8c7c84b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    8fc2eeb View commit details
    Browse the repository at this point in the history
  24. Look for stores between non-conflicting generator saved locals

    This is to prevent the miscompilation in #73137 from reappearing.
    Only runs with `-Zvalidate-mir`.
    ecstatic-morse committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    c178e64 View commit details
    Browse the repository at this point in the history
  25. Incorporate review suggestions

    Co-authored-by: Tyler Mandry <tmandry@gmail.com>
    ecstatic-morse and tmandry committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    b2ec645 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    006b482 View commit details
    Browse the repository at this point in the history
  27. Update chalk

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    16dd584 View commit details
    Browse the repository at this point in the history
  28. Update chalk

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    6aa2e9d View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    7c09ad0 View commit details
    Browse the repository at this point in the history
  30. Implement fn_def_datum

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    a42e5a1 View commit details
    Browse the repository at this point in the history
  31. Remove RustDefId

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    d0ad15d View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    e997375 View commit details
    Browse the repository at this point in the history
  33. Update Chalk

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    90e01ee View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    64c486b View commit details
    Browse the repository at this point in the history
  35. Lower consts

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    6a979d8 View commit details
    Browse the repository at this point in the history
  36. Fix building

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    a1c769b View commit details
    Browse the repository at this point in the history
  37. Update chalk to 0.11.0

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    b5d5994 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    16ad3f3 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    890cef6 View commit details
    Browse the repository at this point in the history
  40. Return type is bound too

    jackh726 committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    d63195b View commit details
    Browse the repository at this point in the history
  41. Auto merge of #73257 - davidtwco:issue-73249-improper-ctypes-projecti…

    …on, r=lcnr,varkor
    
    ty: projections in `transparent_newtype_field`
    
    Fixes #73249.
    
    This PR modifies `transparent_newtype_field` so that it handles
    projections with generic parameters, where `normalize_erasing_regions`
    would ICE.
    bors committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    2d8bd9b View commit details
    Browse the repository at this point in the history
  42. add new error code

    pvdrz committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    96031e2 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    8f0bd5f View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    e75fbae View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    562f496 View commit details
    Browse the repository at this point in the history
  46. Refactor try_find a little

    The `E` type parameter was unnecessary, so it's now removed. The folding
    closure now has reduced parametricity on just `T = Self::Item`, rather
    than the whole `Self` iterator type. There's otherwise no functional
    change in this.
    cuviper committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    db0d70e View commit details
    Browse the repository at this point in the history
  47. Auto merge of #73511 - Manishearth:rollup-3iffxd8, r=Manishearth

    Rollup of 13 pull requests
    
    Successful merges:
    
     - #71568 (Document unsafety in slice/sort.rs)
     - #72709 (`#[deny(unsafe_op_in_unsafe_fn)]` in liballoc)
     - #73214 (Add asm!() support for hexagon)
     - #73248 (save_analysis: improve handling of enum struct variant)
     - #73257 (ty: projections in `transparent_newtype_field`)
     - #73261 (Suggest `?Sized` when applicable for ADTs)
     - #73300 (Implement crate-level-only lints checking.)
     - #73334 (Note numeric literals that can never fit in an expected type)
     - #73357 (Use `LocalDefId` for import IDs in trait map)
     - #73364 (asm: Allow multiple template string arguments; interpret them as newline-separated)
     - #73382 (Only display other method receiver candidates if they actually apply)
     - #73465 (Add specialization of `ToString for char`)
     - #73489 (Refactor hir::Place)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    34c5cd9 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2020

  1. Fix -Z unpretty=everybody_loops

    It turns out that this has not been working for who knows how long.
    Previously:
    
    ```
    pub fn h() { 1 + 2; }
    ```
    
    After this change:
    
    ```
    pub fn h() { loop {} }
    ```
    
    This only affected the pass when run with the command line
    pretty-printing option, so rustdoc was still replacing bodies with
    `loop {}`.
    jyn514 committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    95f8daa View commit details
    Browse the repository at this point in the history
  2. Rollup merge of #71420 - RalfJung:specialization-incomplete, r=matthe…

    …wjasper
    
    Specialization is unsound
    
    As discussed in #31844 (comment), it might be a good idea to warn users of specialization that the feature they are using is unsound.
    
    I also expanded the "incomplete feature" warning to link the user to the tracking issue.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    203305d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of #71899 - cuviper:try_find_map, r=dtolnay

    Refactor `try_find` a little
    
    ~~This works like `find_map`, but mapping to a `Try` type. It stops when `Ok` is `Some(value)`, with an additional short-circuit on `Try::Error`. This is similar to the unstable `try_find`, but has the advantage of being able to directly return the user's `R: Try` type directly, rather than converting to `Result`.~~
    (removed -- `try_find_map` was declined in review)
    
    This PR also refactors `try_find` a little to match style. The `E` type parameter was unnecessary, so it's now removed. The folding closure now has reduced parametricity on just `T = Self::Item`, rather
    than the whole `Self` iterator type. There's otherwise no functional change in this.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    5c9cd82 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of #72689 - lcnr:common_str, r=estebank

    add str to common types
    
    I already expected this to be the case and it may slightly improve perf.
    
    Afaict if we ever want to change str into a lang item this would have to get reverted.
    As that would be fairly simple I don't believe this to cause any problems in the future.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    218b90f View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #72791 - lcnr:coerce-refactor, r=estebank

    update coerce docs and unify relevant tests
    
    Merges `test/ui/coerce` with `test/ui/coercion`.
    Updates the documentation of `librustc_typeck/check/coercion.rs`.
    Adds 2 new coercion tests.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c0a25be View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #72934 - christianpoveda:mut-borrows-in-consts, r=oli…

    …-obk
    
    forbid mutable references in all constant contexts except for const-fns
    
    PR to address #71212
    
    cc: @ecstatic-morse
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    dac512e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #73027 - doctorn:issue-72690, r=estebank

    Make `need_type_info_err` more conservative
    
    Makes sure arg patterns we are going to suggest on are actually contained within the span of the obligation that caused the inference error (credit to @lcnr for suggesting this fix).
    
    There's a subtle trade-off regarding the handling of local patterns which I've left a comment about.
    
    Resolves #72690
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    2d1bd57 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #73347 - tmiasko:incompatible-sanitizers, r=nikic

    Diagnose use of incompatible sanitizers
    
    Emit an error when incompatible sanitizer are configured through command
    line options. Previously the last one configured prevailed and others
    were silently ignored.
    
    Additionally use a set to represent configured sanitizers, making it
    possible to enable multiple sanitizers at once. At least in principle,
    since currently all of them are considered to be incompatible with
    others.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    17b80d9 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #73359 - jonas-schievink:do-the-shimmy, r=matthewjasper

    shim.rs: avoid creating `Call` terminators calling `Self`
    
    Also contains some cleanup and doc comment additions so I could make sense of the code.
    
    Fixes #73109
    Closes #73175
    
    r? @matthewjasper
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    fe4b485 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #73399 - GuillaumeGomez:cleanup-e0668, r=Dylan-DPC

    Clean up E0668 explanation
    
    r? @Dylan-DPC
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    2dbb8b6 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #73436 - GuillaumeGomez:cleanup-e0670, r=Dylan-DPC

    Clean up E0670 explanation
    
    r? @Dylan-DPC
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    2377a50 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #73440 - jyn514:bootstrap/build-rustdoc, r=Mark-Simul…

    …acrum
    
    Add src/librustdoc as an alias for src/tools/rustdoc
    
    No one actually works with src/tools/rustdoc, it's almost empty.
    
    Closes #73439
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    d69d4c3 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #73442 - davidtwco:issue-72181-pretty-print-const-val…

    …-enum-no-variants, r=oli-obk
    
    pretty/mir: const value enums with no variants
    
    Fixes #72181.
    
    This PR modifies the pretty printer and const eval in the MIR so that `destructure_const` (used in `pretty_print_const_value`) can handle enums with no variants (or types containing enums with no variants).
    
    I'm not convinced that this is the correct approach, folks more familiar with `destructure_const` would be able to say - happy to adjust the PR. Looking through `destructure_const` and the functions that it invokes, it didn't seem like it was written to handle zero-variant-enums - I assume that case is handled earlier in some way so `destructure_const` doesn't need to under normal circumstances. It didn't seem like it would be straightforward to make `destructure_const` handle this case in a first-class-feeling way (e.g. adding a `Variants::None` variant), so this PR makes some minimal changes to avoid ICEs.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    db7203d View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #73452 - matthewjasper:auto-rec, r=nikomatsakis

    Unify region variables when projecting associated types
    
    This is required to avoid cycles when evaluating auto trait predicates.
    Notably, this is required to be able add Chalk types to `CtxtInterners` for `cfg(parallel_compiler)`.
    
    r? @nikomatsakis
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    61f8c3e View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #73458 - tmiasko:arena-layout, r=matthewjasper

    Use alloc::Layout in DroplessArena API
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    fd1c783 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of #73484 - poliorcetics:use-prelude-doc, r=sfackler

    Update the doc for std::prelude to the correct behavior
    
    Fixes #64686.
    
    One line change to ensure the docs are correct about the behavior of the compiler when inserting`std::prelude::v1`.
    
    I don't think examples are necessary but I can add some (especially those from the original issue) if needed.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    7777b0b View commit details
    Browse the repository at this point in the history
  17. Rollup merge of #73506 - Xanewok:update-rls, r=Xanewok

    Bump Rustfmt and RLS
    
    Fixes #73406
    Fixes #73199
    Fixes #73407
    Fixes #73200
    
    cc @calebcartwright @topecongiro
    
    r? @ghost
    
    Let's see what CI says first
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    3e40cca View commit details
    Browse the repository at this point in the history
  18. Auto merge of #73528 - Manishearth:rollup-7djz8nd, r=Manishearth

    Rollup of 16 pull requests
    
    Successful merges:
    
     - #71420 (Specialization is unsound)
     - #71899 (Refactor `try_find` a little)
     - #72689 (add str to common types)
     - #72791 (update coerce docs and unify relevant tests)
     - #72934 (forbid mutable references in all constant contexts except for const-fns)
     - #73027 (Make `need_type_info_err` more conservative)
     - #73347 (Diagnose use of incompatible sanitizers)
     - #73359 (shim.rs: avoid creating `Call` terminators calling `Self`)
     - #73399 (Clean up E0668 explanation)
     - #73436 (Clean up E0670 explanation)
     - #73440 (Add src/librustdoc as an alias for src/tools/rustdoc)
     - #73442 (pretty/mir: const value enums with no variants)
     - #73452 (Unify region variables when projecting associated types)
     - #73458 (Use alloc::Layout in DroplessArena API)
     - #73484 (Update the doc for std::prelude to the correct behavior)
     - #73506 (Bump Rustfmt and RLS)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    033013c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    a540b1b View commit details
    Browse the repository at this point in the history
  20. Add ClashingExternDecl lint.

    This lint checks that all declarations for extern fns of the same name
    are declared with the same types.
    jumbatm committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    6b74e3c View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8f07952 View commit details
    Browse the repository at this point in the history
  22. Update existing test cases.

    - Allow ClashingExternDecl for lint-dead-code-3
    - Update test case for #5791
    - Update test case for #1866
    - Update extern-abi-from-macro test case
    jumbatm committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    556b7ba View commit details
    Browse the repository at this point in the history
  23. Squashed all commits

    rakshith-ravi committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    0624a5a View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    2851c9f View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    a3e88be View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    d2e6e93 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    66e7a14 View commit details
    Browse the repository at this point in the history
  28. skol -> placeholder

    lcnr committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c4840db View commit details
    Browse the repository at this point in the history
  29. int -> i32

    lcnr committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    a24c897 View commit details
    Browse the repository at this point in the history
  30. remove pop_placeholders

    lcnr committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    180334c View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    ef10694 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    936b6bf View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    a98f35f View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    6a0f1af View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    94817e3 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    1e6e082 View commit details
    Browse the repository at this point in the history
  37. Decouple Autoderef with FnCtxt and move Autoderef to `librustc_…

    …trait_selection`.
    ldm0 committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    5155518 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    ef68bf3 View commit details
    Browse the repository at this point in the history
  39. lint: normalize projections using opaque types

    This commit normalizes projections which contain opaque types (opaque types
    are otherwise linted against, which is would have previously made the
    test cases added in this commit fail).
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    2e781dd View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    29272fc View commit details
    Browse the repository at this point in the history
  41. Consider fewer predicates for projection candidates

    We now require that projection candidates are applicable with the
    idenitity substs of the trait, rather than allowing predicates that are
    only applicable for certain substs.
    matthewjasper committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    04e589c View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    59d8c45 View commit details
    Browse the repository at this point in the history
  43. update Miri

    RalfJung committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    5eaee0d View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    f1e0710 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    13104ef View commit details
    Browse the repository at this point in the history
  46. Refer just to the issue in the raw ptr cmp diagnostic instead of expl…

    …aining everything in the diagnostic
    oli-obk committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9e88b48 View commit details
    Browse the repository at this point in the history
  47. Satisfy tidy

    oli-obk committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    53686b9 View commit details
    Browse the repository at this point in the history
  48. Address review comments

    oli-obk committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    98e97a4 View commit details
    Browse the repository at this point in the history
  49. Check associated type satisfy their bounds

    This was currently only happening due to eager normalization, which
    isn't possible if there's specialization or bound variables.
    matthewjasper committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    d660dbc View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    9818bc0 View commit details
    Browse the repository at this point in the history
  51. Move bounds on associated types to the type

    Given `trait X { type U; }` the bound `<Self as X>::U` now lives
    on the type, rather than the trait. This is feature gated on
    `feature(generic_associated_types)` for now until more testing can
    be done.
    
    The also enabled type-generic associated types since we no longer
    need "implies bounds".
    matthewjasper committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    db4826d View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    5e8c9f4 View commit details
    Browse the repository at this point in the history
  53. Rollup merge of #72600 - Aaron1011:fix/anon-const-encoding, r=varkor

    Properly encode AnonConst into crate metadata
    
    Fixes #68104
    
    Previous, we were encoding AnonConst as a regular Const, causing us to
    treat them differently after being deserialized in another compilation
    session.
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    5431ef6 View commit details
    Browse the repository at this point in the history
  54. Rollup merge of #73055 - lcnr:skol-no-more, r=matthewjasper

    remove leftover mentions of `skol` and `int` from the compiler
    
    This PR mostly changes `skol` -> `placeholder` and all cases where `int` is used as a type to `i32`.
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    b015b28 View commit details
    Browse the repository at this point in the history
  55. Rollup merge of #73058 - tmiasko:aarch64-san, r=nagisa

    Support sanitizers on aarch64-unknown-linux-gnu
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    913aac8 View commit details
    Browse the repository at this point in the history
  56. Rollup merge of #73171 - tblah:riscv-qemu-test, r=pietroalbini

    RISC-V Emulated Testing
    
    Adds a disabled docker image on which to run RISC-V tests. Based on the armhf image.
    
    Test using
    ```
    ./src/ci/docker/run.sh riscv64gc-linux
    ```
    
    cc: @msizanoen1
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    77efcab View commit details
    Browse the repository at this point in the history
  57. Rollup merge of #73404 - ajpaverd:cfguard_syntax, r=Mark-Simulacrum

    Update CFGuard syntax
    
    Update the naming and syntax of the control-flow-guard option, as discussed in #68793.
    
    r? @Mark-Simulacrum
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    91bd333 View commit details
    Browse the repository at this point in the history
  58. Rollup merge of #73444 - pietroalbini:ci-remove-try-alt, r=Mark-Simul…

    …acrum
    
    ci: disable alt build during try builds
    
    The alt build is not actually needed often, and it can be added back on a case-by-case basis if a specific PR needs access to it.
    
    This will free up a builder.
    
    r? @Mark-Simulacrum
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    7930ee6 View commit details
    Browse the repository at this point in the history
  59. Rollup merge of #73471 - raoulstrackx:raoul/fpu_tag_word, r=jethrogb

    Prevent attacker from manipulating FPU tag word used in SGX enclave
    
    Insufficient sanitization of the x87 FPU tag word in the trusted enclave runtime allowed unprivileged adversaries in the containing host application to induce incoherent or unexpected results for ABI-compliant compiled enclave application code that uses the x87 FPU.
    
    Vulnerability was disclosed to us by Fritz Alder, Jo Van Bulck, David Oswald and Frank Piessens
    
    cc: @jethrogb
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    96b86ea View commit details
    Browse the repository at this point in the history
  60. Rollup merge of #73539 - LukasKalbertodt:deprecate-vec-remove-item, r…

    …=Mark-Simulacrum
    
    Deprecate `Vec::remove_item`
    
    In #40062 we decided to remove that method. In #71834 it was said that we want to deprecate it for a few cycles before removing it. That's what this PR does.
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c1cad70 View commit details
    Browse the repository at this point in the history
  61. Rollup merge of #73543 - GuillaumeGomez:cleanup-e0695, r=Dylan-DPC

    Clean up E0695 explanation
    
    r? @Dylan-DPC
    RalfJung authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    bb0016b View commit details
    Browse the repository at this point in the history
  62. core/time: Add Duration methods for zero

    This patch adds two methods to `Duration`. The first, `Duration::zero`,
    provides a `const` constructor for getting an zero-length duration. This
    is also what `Default` provides (this was clarified in the docs), though
    `default` is not `const`.
    
    The second, `Duration::is_zero`, returns true if a `Duration` spans no
    time (i.e., because its components are all zero). Previously, the way to
    do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
    compare against `Duration::new(0, 0)`, or to use the `u128` method
    `as_nanos`, none of which were particularly elegant.
    jonhoo committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    3ff5879 View commit details
    Browse the repository at this point in the history
  63. Doctests need feature

    jonhoo committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    ad7fd62 View commit details
    Browse the repository at this point in the history
  64. Revise according to review

    jonhoo committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    386114b View commit details
    Browse the repository at this point in the history
  65. Allow multiple asm! options

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c883fa4 View commit details
    Browse the repository at this point in the history
  66. Update tests

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    e614116 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    1d2acdf View commit details
    Browse the repository at this point in the history
  68. Clean up

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    27cc7c7 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    820bba1 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    2be403c View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    7aaadb6 View commit details
    Browse the repository at this point in the history
  72. Make warning an error; use help instead of suggestion; clean up code

    For some reason, the help message is now in a separate message, which
    adds a lot of noise. I would like to try to get it back to one message.
    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    b94b7e7 View commit details
    Browse the repository at this point in the history
  73. Use span_label

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    ac54265 View commit details
    Browse the repository at this point in the history
  74. Update duplicate options test

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    7c5b66f View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    c7da50d View commit details
    Browse the repository at this point in the history
  76. Configuration menu
    Copy the full SHA
    e8be797 View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    b00b1a4 View commit details
    Browse the repository at this point in the history
  78. Configuration menu
    Copy the full SHA
    f4dfc61 View commit details
    Browse the repository at this point in the history
  79. Configuration menu
    Copy the full SHA
    4ba6697 View commit details
    Browse the repository at this point in the history
  80. Create a separate, tool-only suggestion for the comma

    That way the comma isn't highlighted as part of the option in the UI.
    
    Weirdly, the comma removal suggestion shows up in the UI.
    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    8fe6710 View commit details
    Browse the repository at this point in the history
  81. Add documentation

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    db9d376 View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    58f812b View commit details
    Browse the repository at this point in the history
  83. Fix duplicate options error

    The UI isn't glitching anymore.
    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    8d80cc5 View commit details
    Browse the repository at this point in the history
  84. Run ./x.py fmt

    camelid committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c31785a View commit details
    Browse the repository at this point in the history
  85. Configuration menu
    Copy the full SHA
    5a8e915 View commit details
    Browse the repository at this point in the history
  86. Auto merge of #73550 - RalfJung:rollup-5huj1k1, r=RalfJung

    Rollup of 9 pull requests
    
    Successful merges:
    
     - #72600 (Properly encode AnonConst into crate metadata)
     - #73055 (remove leftover mentions of `skol` and `int` from the compiler)
     - #73058 (Support sanitizers on aarch64-unknown-linux-gnu)
     - #73171 (RISC-V Emulated Testing)
     - #73404 (Update CFGuard syntax)
     - #73444 (ci: disable alt build during try builds)
     - #73471 (Prevent attacker from manipulating FPU tag word used in SGX enclave)
     - #73539 (Deprecate `Vec::remove_item`)
     - #73543 (Clean up E0695 explanation)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    f455e46 View commit details
    Browse the repository at this point in the history
  87. Configuration menu
    Copy the full SHA
    bfb0e8d View commit details
    Browse the repository at this point in the history
  88. update tests

    Christian Poveda committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9355168 View commit details
    Browse the repository at this point in the history
  89. Rollup merge of #72456 - ldm0:dereftrait, r=estebank

    Try to suggest dereferences on trait selection failed
    
    Fixes #39029 Fixes #62530
    This PR consists of two parts:
    1. Decouple `Autoderef` with `FnCtxt` and move `Autoderef` to `librustc_trait_selection`.
    2. Try to suggest dereferences when trait selection failed.
    
    The first is needed because:
    1. For suggesting dereferences, the struct `Autoderef` should be used. But before this PR, it is placed in `librustc_typeck`, which depends on `librustc_trait_selection`. But trait selection error emitting happens in `librustc_trait_selection`, if we want to use `Autoderef` in it, dependency loop is inevitable. So I moved the `Autoderef` to `librustc_trait_selection`.
    2. Before this PR, `FnCtxt` is coupled to `Autoderef`, and `FnCtxt` only exists in `librustc_typeck`. So decoupling is needed.
    
    After this PR, we can get suggestion like this:
    ```
    error[E0277]: the trait bound `&Baz: Happy` is not satisfied
      --> $DIR/trait-suggest-deferences-multiple.rs:34:9
       |
    LL | fn foo<T>(_: T) where T: Happy {}
       |                          ----- required by this bound in `foo`
    ...
    LL |     foo(&baz);
       |         ^^^^
       |         |
       |         the trait `Happy` is not implemented for `&Baz`
       |         help: consider adding dereference here: `&***baz`
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0277`.
    ```
    
    r? @estebank
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    a1404a9 View commit details
    Browse the repository at this point in the history
  90. Rollup merge of #72788 - matthewjasper:projection-bound-validation, r…

    …=nikomatsakis
    
    Projection bound validation
    
    During selection we use bounds declared on associated types (e.g. `type X: Copy`) to satisfy trait/projection bounds. This would be fine so long as those bounds are checked on any impls/trait objects. For simple cases they are because the bound `Self::X: Copy` gets normalized when we check the impl.
    
    However, for default values with specialization and higher-ranked bounds from GATs or otherwise, we can't normalize when checking the impl, and so we use the bound from the trait to prove that the bound applies to the impl, which is clearly unsound.
    
    This PR makes 2 fixes for this:
    
    1. Requiring that the bounds on the trait apply to a projection type with the corresponding substs, so a bound `for<'a> <Self as X<'a>>::U: Copy` on the trait cannot be used to prove `<T as X<'_>>::U: Copy`.
    2. Actually checking that the bounds that we still allow apply to generic/default associated types.
    
    Opening for a crater run.
    
    Closes #68641
    Closes #68642
    Closes #68643
    Closes #68644
    Closes #68645
    Closes #68656
    
    r? @ghost
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    1a171d0 View commit details
    Browse the repository at this point in the history
  91. Rollup merge of #72790 - jonhoo:duration-is-zero, r=LukasKalbertodt

    core/time: Add Duration methods for zero
    
    This patch adds two methods to `Duration`. The first, `Duration::zero`,
    provides a `const` constructor for getting an zero-length duration. This
    is also what `Default` provides (this was clarified in the docs), though
    `default` is not `const`.
    
    The second, `Duration::is_zero`, returns true if a `Duration` spans no
    time (i.e., because its components are all zero). Previously, the way to
    do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
    compare against `Duration::new(0, 0)`, or to use the `u128` method
    `as_nanos`, none of which were particularly elegant.
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    c47550f View commit details
    Browse the repository at this point in the history
  92. Rollup merge of #73227 - camelid:multiple-asm-options, r=Amanieu

    Allow multiple `asm!` options groups and report an error on duplicate options
    
    Fixes #73193
    
    Cc @joshtriplett @Amanieu
    
    - [x] Allow multiple options
    - [x] Update existing test
    - [x] Add new tests
    - [x] Check for duplicate options
    - [x] Add duplicate options tests
    - [x] Finalize suggestion format for duplicate options error
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    45d6aef View commit details
    Browse the repository at this point in the history
  93. Rollup merge of #73287 - davidtwco:issue-73251-opaque-types-in-projec…

    …tions, r=estebank
    
    lint: normalize projections using opaque types
    
    Fixes #73251.
    
    This PR normalizes projections which use opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this PR fail).
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9003087 View commit details
    Browse the repository at this point in the history
  94. Rollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petroche…

    …nkov
    
    Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs
    
    cc #50928
    
    I don't know who is exactly the best person to review this.
    
    r? @petrochenkov
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    0a8fd43 View commit details
    Browse the repository at this point in the history
  95. Rollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk

    Remove use of specialization from librustc_arena
    
    This reworks the macro so that specialization, `transmute` and `#[marker]` are not used.
    
    r? @oli-obk
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    a876a5a View commit details
    Browse the repository at this point in the history
  96. Rollup merge of #73411 - ehuss:bump-stage0, r=Mark-Simulacrum

    Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15)
    
    Pulls in changes from #73326.
    
    Closes #73286
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9a82736 View commit details
    Browse the repository at this point in the history
  97. Rollup merge of #73443 - pietroalbini:gha-auto-fallible, r=Mark-Simul…

    …acrum
    
    ci: allow gating GHA on everything but macOS
    
    In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called `auto-fallible`), allowing us to gate on the auto job without failing due to macOS spurious failures.
    
    cc rust-lang/rust-central-station#848
    r? @Mark-Simulacrum
    Manishearth authored Jun 20, 2020
    Configuration menu
    Copy the full SHA
    929f032 View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    fc60282 View commit details
    Browse the repository at this point in the history
  99. Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth

    Rollup of 9 pull requests
    
    Successful merges:
    
     - #72456 (Try to suggest dereferences on trait selection failed)
     - #72788 (Projection bound validation)
     - #72790 (core/time: Add Duration methods for zero)
     - #73227 (Allow multiple `asm!` options groups and report an error on duplicate options)
     - #73287 (lint: normalize projections using opaque types)
     - #73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs)
     - #73378 (Remove use of specialization from librustc_arena)
     - #73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d 2020-06-15))
     - #73443 (ci: allow gating GHA on everything but macOS)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    7058471 View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    4896a06 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2020

  1. Clarify --extern documentation.

    Fixes #64731, #73531.
    
    See also #64402#issuecomment-530852886
    adetaylor committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    a63eb3c View commit details
    Browse the repository at this point in the history
  2. Auto merge of #70946 - jumbatm:clashing-extern-decl, r=nagisa

    Add a lint to catch clashing `extern` fn declarations.
    
    Closes #69390.
    
    Adds lint `clashing_extern_decl` to detect when, within a single crate, an extern function of the same name is declared with different types. Because two symbols of the same name cannot be resolved to two different functions at link time, and one function cannot possibly have two types, a clashing extern declaration is almost certainly a mistake.
    
    This lint does not run between crates because a project may have dependencies which both rely on the same extern function, but declare it in a different (but valid) way. For example, they may both declare an opaque type for one or more of the arguments (which would end up distinct types), or use types that are valid conversions in the language the extern fn is defined in. In these cases, we can't say that the clashing declaration is incorrect.
    
    r? @eddyb
    bors committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    228a0ed View commit details
    Browse the repository at this point in the history
  3. Fix typos in doc comments

    This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'
    JOE1994 authored Jun 21, 2020
    Configuration menu
    Copy the full SHA
    6374054 View commit details
    Browse the repository at this point in the history
  4. Auto merge of #71911 - wesleywiser:const_prop_small_cleanups, r=oli-obk

    [mir-opt] Small ConstProp cleanup
    bors committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    38bd83d View commit details
    Browse the repository at this point in the history
  5. Fix typo in error_codes doc

    dario23 committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    e3d735d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8ea55f1 View commit details
    Browse the repository at this point in the history
  7. Cache flags and escaping vars for predicates

    Also hash predicates by address
    matthewjasper committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    f802ee1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6e12272 View commit details
    Browse the repository at this point in the history
  9. Auto merge of #73546 - RalfJung:miri, r=RalfJung

    update Miri
    
    Fixes #73405
    Cc @rust-lang/miri r? @ghost
    bors committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    7adbc0d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1c74ab4 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    e465b22 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    467415d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a657be4 View commit details
    Browse the repository at this point in the history
  14. Auto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrum

    Enable LLVM zlib
    
    Compilers may generate ELF objects with compressed sections (although rustc currently doesn't do this). Currently, when linking these with `rust-lld`, you'll get this error:
    
    `rust-lld: error: ...: contains a compressed section, but zlib is not available`
    
    This enables zlib when building LLVM.
    bors committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    349f6bf View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    726b6f4 View commit details
    Browse the repository at this point in the history
  16. Update UI tests

    GuillaumeGomez committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    c14d85f View commit details
    Browse the repository at this point in the history
  17. Update src/librustc_mir/monomorphize/collector.rs

    typo fix
    
    Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
    JOE1994 and jonas-schievink authored Jun 21, 2020
    Configuration menu
    Copy the full SHA
    893077c View commit details
    Browse the repository at this point in the history
  18. Prefer accessible paths in 'use' suggestions

    This fixes an issue with the following sample:
    
        mod foo {
    	mod inaccessible {
    	    pub struct X;
    	}
    	pub mod avail {
    	    pub struct X;
    	}
        }
    
        fn main() { X; }
    
    Instead of suggesting both `use crate::foo::inaccessible::X;` and `use
    crate::foo::avail::X;`, it should only suggest the latter.
    
    It is done by trimming the list of suggestions from inaccessible paths
    if accessible paths are present.
    
    Visibility is checked with `is_accessible_from` now instead of being
    hard-coded.
    
    -
    
    Some tests fixes are trivial, and others require a bit more explaining,
    here are my comments:
    
    src/test/ui/issues/issue-35675.stderr: Only needs to make the enum
    public to have the suggestion make sense.
    
    src/test/ui/issues/issue-42944.stderr: Importing the tuple struct won't
    help because its constructor is not visible, so the attempted
    constructor does not work. In that case, it's better not to suggest it.
    The case where the constructor is public is covered in `issue-26545.rs`.
    da-x committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    fea5ab1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3bfd0c9 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    6297228 View commit details
    Browse the repository at this point in the history
  21. Auto merge of #72936 - jackh726:chalk-more, r=nikomatsakis

    Upgrade Chalk
    
    Things done in this PR:
    - Upgrade Chalk to `0.11.0`
    - Added compare-mode=chalk
    - Bump rustc-hash in `librustc_data_structures` to `1.1.0` to match Chalk
    - Removed `RustDefId` since the builtin type support is there
    - Add a few more `FIXME(chalk)`s for problem spots I hit when running all tests with chalk
    - Added some more implementation code for some newer builtin Chalk types (e.g. `FnDef`, `Array`)
    - Lower `RegionOutlives` and `ObjectSafe` predicates
    - Lower `Dyn` without the region
    - Handle `Int`/`Float` `CanonicalVarKind`s
    - Uncomment some Chalk tests that actually work now
    - Remove the revisions in `src/test/ui/coherence/coherence-subtyping.rs` since they aren't doing anything different
    
    r? @nikomatsakis
    bors committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    a8cf399 View commit details
    Browse the repository at this point in the history
  22. fmt

    RalfJung committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    7447bf2 View commit details
    Browse the repository at this point in the history
  23. Do not send a notification for P-high stable regressions

    Add comment to clarify the pattern
    LeSeulArtichaut committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    ae71e96 View commit details
    Browse the repository at this point in the history
  24. Auto merge of #73180 - matthewjasper:predicate-cache, r=nikomatsakis

    Cache flags and escaping vars for predicates
    
    With predicates becoming interned (rust-lang/compiler-team#285) this is now possible and could be a perf win. It would become an even larger win once we have recursive predicates.
    
    cc @lcnr @nikomatsakis
    
    r? @ghost
    bors committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    1a4e2b6 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    f60513e View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    1d3f49f View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    bd4f6f0 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2020

  1. Fix spurious 'value moved here in previous iteration of loop' messages

    Fixes #46099
    
    Previously, we would check the 'move' and 'use' spans to see if we
    should emit this message. However, this can give false positives when
    macros are involved, since two distinct expressions may end up with the
    same span.
    
    Instead, we check the actual MIR `Location`, which eliminates false
    positives.
    Aaron1011 committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    953104e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    933fe80 View commit details
    Browse the repository at this point in the history
  3. bootstrap: no config.toml exists regression

    This commit fixes a regression introduced in #73317 where an oversight
    meant that `config.toml` was assumed to exist.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    b60ec47 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c474317 View commit details
    Browse the repository at this point in the history
  5. fix intrinsics::needs_drop docs

    lcnr authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    932237b View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #71660 - sollyucko:master, r=dtolnay

    impl PartialEq<Vec<B>> for &[A], &mut [A]
    
    rust-lang/rfcs#2917
    Dylan-DPC authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    8da1dd0 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #72623 - da-x:use-suggest-public-path, r=petrochenkov

    Prefer accessible paths in 'use' suggestions
    
    This PR addresses issue #26454, where `use` suggestions are made for paths that don't work. For example:
    
    ```rust
    mod foo {
        mod bar {
            struct X;
        }
    }
    
    fn main() { X; } // suggests `use foo::bar::X;`
    ```
    Dylan-DPC authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    fdd241f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d22b80d View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #73580 - RalfJung:deprecate-wrapping-offset-from, r=A…

    …manieu
    
    deprecate wrapping_offset_from
    
    As per #41079 (comment) which seems like a consensus.
    
    r? @Amanieu
    Dylan-DPC authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    35ecb26 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #73582 - RalfJung:miri-span-bug, r=oli-obk

    Miri: replace many bug! by span_bug!
    
    r? @oli-obk
    Dylan-DPC authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    cb85f4b View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #73585 - LeSeulArtichaut:patch-3, r=Mark-Simulacrum

    Do not send a notification for P-high stable regressions
    
    This is kind of a hack to only match nightly and beta regressions, but not stable regressions. See my tests [on the playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6ff8a809162118aa2951f2ff12400067).
    
    r? @spastorino cc @Mark-Simulacrum
    Dylan-DPC authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    c5e6f48 View commit details
    Browse the repository at this point in the history
  12. Auto merge of #73617 - Dylan-DPC:rollup-zugh80o, r=Dylan-DPC

    Rollup of 6 pull requests
    
    Successful merges:
    
     - #71660 (impl PartialEq<Vec<B>> for &[A], &mut [A])
     - #72623 (Prefer accessible paths in 'use' suggestions)
     - #73502 (Add E0765)
     - #73580 (deprecate wrapping_offset_from)
     - #73582 (Miri: replace many bug! by span_bug!)
     - #73585 (Do not send a notification for P-high stable regressions)
    
    Failed merges:
    
     - #73581 (Create 0766 error code)
    
    r? @ghost
    bors committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    62878c2 View commit details
    Browse the repository at this point in the history
  13. modify leak-check to track only outgoing edges from placeholders

    Also, update the affected tests. This seems strictly better but it is
    actually more permissive than I initially intended. In particular it
    accepts this
    
    ```
    forall<'a, 'b> {
      exists<'intersection> {
        'a: 'intersection,
        'b: 'intersection,
      }
    }
    ```
    
    and I'm not sure I want to accept that. It implies that we have a
    `'empty` in the new universe intoduced by the `forall`.
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    bcc0a9c View commit details
    Browse the repository at this point in the history
  14. Revert "modify leak-check to track only outgoing edges from placehold…

    …ers"
    
    This reverts commit 2e01db4b396a1e161f7a73933fff34bc9421dba0.
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    4199b3a View commit details
    Browse the repository at this point in the history
  15. rewrite leak check to be based on universes

    In the new leak check, instead of getting a list of placeholders to
    track, we look for any placeholder that is part of a universe which
    was created during the snapshot.
    
    We are looking for the following error patterns:
    
    * P1: P2, where P1 != P2
    * P1: R, where R is in some universe that cannot name P1
    
    This new leak check is more precise than before, in that it accepts
    this patterns:
    
    * R: P1, even if R cannot name P1, because R = 'static is a valid
    sol'n
    * R: P1, R: P2, as above
    
    Note that this leak check, when running during subtyping, is less
    efficient than before in some sense because it is going to check and
    re-check all the universes created since the snapshot. We're going to
    move when the leak check runs to try and correct that.
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    f2cf994 View commit details
    Browse the repository at this point in the history
  16. move leak-check to during coherence, candidate eval

    In particular, it no longer occurs during the subtyping check. This is
    important for enabling lazy normalization, because the subtyping check
    will be producing sub-obligations that could affect its results.
    
    Consider an example like
    
        for<'a> fn(<&'a as Mirror>::Item) =
          fn(&'b u8)
    
    where `<T as Mirror>::Item = T` for all `T`. We will wish to produce a
    new subobligation like
    
        <'!1 as Mirror>::Item = &'b u8
    
    This will, after being solved, ultimately yield a constraint that `'!1
    = 'b` which will fail. But with the leak-check being performed on
    subtyping, there is no opportunity to normalize `<'!1 as
    Mirror>::Item` (unless we invoke that normalization directly from
    within subtyping, and I would prefer that subtyping and unification
    are distinct operations rather than part of the trait solving stack).
    
    The reason to keep the leak check during coherence and trait
    evaluation is partly for backwards compatibility. The coherence change
    permits impls for `fn(T)` and `fn(&T)` to co-exist, and the trait
    evaluation change means that we can distinguish those two cases
    without ambiguity errors. It also avoids recreating #57639, where we
    were incorrectly choosing a where clause that would have failed the
    leak check over the impl which succeeds.
    
    The other reason to keep the leak check in those places is that I
    think it is actually close to the model we want. To the point, I think
    the trait solver ought to have the job of "breaking down"
    higher-ranked region obligation like ``!1: '2` into into region
    obligations that operate on things in the root universe, at which
    point they should be handed off to polonius. The leak check isn't
    *really* doing that -- these obligations are still handed to the
    region solver to process -- but if/when we do adopt that model, the
    decision to pass/fail would be happening in roughly this part of the
    code.
    
    This change had somewhat more side-effects than I anticipated. It
    seems like there are cases where the leak-check was not being enforced
    during method proving and trait selection. I haven't quite tracked
    this down but I think it ought to be documented, so that we know what
    precisely we are committing to.
    
    One surprising test was `issue-30786.rs`. The behavior there seems a
    bit "fishy" to me, but the problem is not related to the leak check
    change as far as I can tell, but more to do with the closure signature
    inference code and perhaps the associated type projection, which
    together seem to be conspiring to produce an unexpected
    signature. Nonetheless, it is an example of where changing the
    leak-check can have some unexpected consequences: we're now failing to
    resolve a method earlier than we were, which suggests we might change
    some method resolutions that would have been ambiguous to be
    successful.
    
    TODO:
    
    * figure out remainig test failures
    * add new coherence tests for the patterns we ARE disallowing
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    5a7a850 View commit details
    Browse the repository at this point in the history
  17. upcasting traits requires only that things become more general

    Revert the code that states that upcasting traits requires full
    equality and change to require that the source type is a subtype of
    the target type, as one would expect. As the comment states, this was
    an old bug that we didn't want to fix yet as it interacted poorly with
    the old leak-check. This fixes the old-lub-glb-object test, which was
    previously reporting too many errors (i.e., in the previous commit).
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    1e00e1b View commit details
    Browse the repository at this point in the history
  18. Auto merge of #73415 - ehuss:update-cargo, r=ehuss

    Update cargo
    
    3 commits in 79c769c3d7b4c2cf6a93781575b7f592ef974255..089cbb80b73ba242efdcf5430e89f63fa3b5328d
    2020-06-11 22:13:37 +0000 to 2020-06-15 14:38:34 +0000
    - Support linker with -Zdoctest-xcompile. (rust-lang/cargo#8359)
    - Fix doctests not running with --target=HOST. (rust-lang/cargo#8358)
    - Allow passing a registry index url directly to `cargo install` (rust-lang/cargo#8344)
    bors committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    6bb3dbf View commit details
    Browse the repository at this point in the history
  19. Revert "Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, …

    …r=nikomatsakis"
    
    This reverts commit 372cb9b, reversing
    changes made to 5c61a8d.
    Aaron1011 committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    ad9972a View commit details
    Browse the repository at this point in the history
  20. Re-enable Clippy tests

    Aaron1011 committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    d3feb8b View commit details
    Browse the repository at this point in the history
  21. Stop using old version of syn in rustc-workspace-hack

    None of the tools seem to need syn 0.15.35, so we can just build syn
    1.0.
    
    This was causing an issue with clippy's `compile-test` program: since
    multiple versions of `syn` would exist in the build directory, we would
    non-deterministically pick one based on filesystem iteration order. If
    the pre-1.0 version of `syn` was picked, a strange build error would
    occur (see
    #73594 (comment))
    
    To prevent this kind of issue from happening again, we now panic if we
    find multiple versions of a crate in the build directly, instead of
    silently picking the first version we find.
    Aaron1011 committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    e2ab98d View commit details
    Browse the repository at this point in the history
  22. Point at the call spawn when overflow occurs during monomorphization

    This improves the output for issue #72577, but there's still more work
    to be done.
    
    Currently, an overflow error during monomorphization results in an error
    that points at the function we were unable to monomorphize. However, we
    don't point at the call that caused the monomorphization to happen. In
    the overflow occurs in a large recursive function, it may be difficult
    to determine where the issue is.
    
    This commit tracks and `Span` information during collection of
    `MonoItem`s, which is used when emitting an overflow error. `MonoItem`
    itself is unchanged, so this only affects
    `src/librustc_mir/monomorphize/collector.rs`
    Aaron1011 committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    3ed96a6 View commit details
    Browse the repository at this point in the history
  23. remove snapshot calls from "match" operations during select

    Motivation:
    
    - we want to use leak-check sparingly, first off
    - these calls were essentially the same as doing the check during subtyping
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    70cf33f View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    6873a76 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    3a68d56 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    be0d10f View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    93e2982 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    c88a76e View commit details
    Browse the repository at this point in the history
  29. fix subtle bug in NLL type checker

    The bug was revealed by the behavior of the old-lub-glb-hr-noteq1.rs
    test. The old-lub-glb-hr-noteq2 test shows the current 'order dependent'
    behavior of coercions around higher-ranked functions, at least when
    running with `-Zborrowck=mir`.
    
    Also, run compare-mode=nll.
    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    6929013 View commit details
    Browse the repository at this point in the history
  30. cite issue 73154

    nikomatsakis committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    d57689f View commit details
    Browse the repository at this point in the history
  31. Auto merge of #73594 - Aaron1011:revert/move-fn-self-msg, r=Manishearth

    Revert PR #72389 - "Explain move errors that occur due to method calls involving `self"
    
    r? @petrochenkov
    bors committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    cbf356a View commit details
    Browse the repository at this point in the history
  32. implemented query for coverage data

    This commit adds a query that allows the CoverageData to be pulled from
    a call on tcx, avoiding the need to change the
    `codegen_intrinsic_call()` signature (no need to pass in the FunctionCx
    or any additional arguments.
    
    The commit does not change where/when the CoverageData is computed. It's
    still done in the `pass`, and saved in the MIR `Body`.
    
    See discussion (in progress) here:
    #73488 (comment)
    richkadel committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    f4a7938 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    f84b7e1 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    994d9d0 View commit details
    Browse the repository at this point in the history
  35. review comments

    estebank committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    3eb8eb9 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. Auto merge of #73007 - yoshuawuyts:socketaddr-from-string-u16, r=sfac…

    …kler
    
    impl ToSocketAddrs for (String, u16)
    
    This adds a convenience impl of `ToSocketAddrs for (String, u16)`. When authoring HTTP services it's common to take command line options for `host` and `port` and parse them into `String` and `u16` respectively. Consider the following program:
    ```rust
    #[derive(Debug, StructOpt)]
    struct Config {
        host: String,
        port: u16,
    }
    
    async fn main() -> io::Result<()> {
        let config = Config::from_args();
        let stream = TcpStream::connect((&*config.host, config.port))?; // &* is not ideal
        // ...
    }
    ```
    
    Networking is a pretty common starting point for people new to Rust, and seeing `&*` in basic examples can be confusing. Even as someone that has experience with networking in Rust I tend to forget that `String` can't be passed directly there. Instead with this patch we can omit the `&*` conversion and pass `host` directly:
    ```rust
    #[derive(Debug, StructOpt)]
    struct Config {
        host: String,
        port: u16,
    }
    
    async fn main() -> io::Result<()> {
        let config = Config::from_args();
        let stream = TcpStream::connect((config.host, config.port))?; // no more conversions!
        // ...
    }
    ```
    
    I think should be an easy and small ergonomics improvement for networking. Thanks!
    bors committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    dcd470f View commit details
    Browse the repository at this point in the history
  2. Rollup merge of #71756 - carstenandrich:master, r=dtolnay

    add Windows system error codes that should map to io::ErrorKind::TimedOut
    
    closes #71646
    
    **Disclaimer:** The author of this pull request has a negligible amount of experience (i.e., kinda zero) with the Windows API. This PR should _definitely_ be reviewed by someone familiar with the API and its error handling.
    
    While porting POSIX software using serial ports to Windows, I found that for many Windows system error codes, an `io::Error` created via `io::Error::from_raw_os_error()` or `io::Error::last_os_error()` is not `io::ErrorKind::TimedOut`. For example, when a (non-overlapped) write to a COM port via [`WriteFile()`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile) times out, [`GetLastError()`](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror) returns `ERROR_SEM_TIMEOUT` ([121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)). However, an `io::Error` created from this error code will have `io::ErrorKind::Other`.
    
    Currently, only the error codes `ERROR_OPERATION_ABORTED` and `WSAETIMEDOUT` will instantiate `io::Error`s with kind `io::ErrorKind::TimedOut`.
    This makes `io::Error::last_os_error()` unsuitable for error handling of syscalls that could time out, because timeouts can not be caught by matching the error's kind against `io::ErrorKind::TimedOut`.
    
    Downloading the [list of Windows system error codes](https://gist.github.com/carstenandrich/c331d557520b8a0e7f44689ca257f805) and grepping anything that sounds like a timeout (`egrep -i "timed?.?(out|limit)"`), I've identified the following error codes that should also have `io::ErrorKind::TimedOut`, because they could be I/O-related:
    
    Name | Code | Description
    --- | --- | ---
    `ERROR_SEM_TIMEOUT` | [121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-) | The semaphore timeout period has expired.
    `WAIT_TIMEOUT` | [258](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-) | The wait operation timed out.
    `ERROR_DRIVER_CANCEL_TIMEOUT` | [594](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--500-999-) | The driver %hs failed to complete a cancelled I/O request in the allotted time.
    `ERROR_COUNTER_TIMEOUT` | [1121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-) | A serial I/O operation completed because the timeout period expired. The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)
    `ERROR_TIMEOUT` | [1460](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1300-1699-) | This operation returned because the timeout period expired.
    `ERROR_CTX_MODEM_RESPONSE_TIMEOUT` | [7012](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on.
    `ERROR_CTX_CLIENT_QUERY_TIMEOUT` | [7040](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The client failed to respond to the server connect message.
    `ERROR_DS_TIMELIMIT_EXCEEDED` | [8226](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--8200-8999-) | The time limit for this request was exceeded.
    `DNS_ERROR_RECORD_TIMED_OUT` | [9705](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--9000-11999-) | DNS record timed out.
    `ERROR_IPSEC_IKE_TIMED_OUT` | [13805](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | Negotiation timed out.
    
    The following errors are also timeouts, but they don't seem to be directly related to I/O or network operations:
    
    Name | Code | Description
    --- | --- | ---
    `ERROR_SERVICE_REQUEST_TIMEOUT` | [1053](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-) | The service did not respond to the start or control request in a timely fashion.
    `ERROR_RESOURCE_CALL_TIMED_OUT` | [5910](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--4000-5999-) | The call to the cluster resource DLL timed out.
    `FRS_ERR_SYSVOL_POPULATE_TIMEOUT` | [8014](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The file replication service cannot populate the system volume because of an internal timeout. The event log may have more information.
    `ERROR_RUNLEVEL_SWITCH_TIMEOUT` | [15402](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | The requested run level switch cannot be completed successfully since one or more services will not stop or restart within the specified timeout.
    `ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT` | [15403](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | A run level switch agent did not respond within the specified timeout.
    
    Please note that `ERROR_SEM_TIMEOUT` is the only timeout error I have [seen in action](https://gist.github.com/carstenandrich/10b3962fa1abc9e50816b6460010900b). The remainder of the error codes listed above is based purely on reading documentation.
    
    This pull request adds all of the errors listed in both tables, but I'm not sure whether adding all of them makes sense. Someone with actual Windows API experience should decide that.
    
    I expect these changes to be fairly backwards compatible, because only the error's [`.kind()`](https://doc.rust-lang.org/std/io/struct.Error.html#method.kind) will change, but matching the error's code via [`.raw_os_error()`](https://doc.rust-lang.org/std/io/struct.Error.html#method.raw_os_error) will not be affected.
    However, code expecting these errors to be `io::ErrorKind::Other` would break. Even though I personally do not think such an implementation would make sense, after all the docs say that `io::ErrorKind` is _intended to grow over time_, a residual risk remains, of course. I took the liberty to ammend the docstring of `io::ErrorKind::Other` with a remark that discourages matching against it.
    
    As per the contributing guidelines I'm adding @steveklabnik due to the changed documentation. Also @retep998 might have some valuable insights on the error codes.
    
    r? @steveklabnik
    cc @retep998
    cc @Mark-Simulacrum
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    6276c13 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of #73495 - Lucretiel:wasi-io-impls, r=sfackler

    Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits
    
    Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`.
    
    Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused #72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms.
    
    This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    5426586 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of #73575 - dario23:typo-errorcodes-doc, r=matthewjasper

    Fix typo in error_codes doc
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    4dfae77 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink

    Make is_freeze and is_copy_modulo_regions take TyCtxtAt
    
    Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    963a480 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #73586 - RalfJung:switch-ty, r=oli-obk

    switch_ty is redundant
    
    This field is redundant, but we cannot remove it currently as pretty-printing relies on it (and it does not have access to `mir::Body` to compute the type itself).
    
    Cc @oli-obk @matthewjasper @jonas-schievink
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    490d820 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #73600 - Aaron1011:fix/move-in-macro, r=ecstatic-morse

    Fix spurious 'value moved here in previous iteration of loop' messages
    
    Fixes #46099
    
    Previously, we would check the 'move' and 'use' spans to see if we
    should emit this message. However, this can give false positives when
    macros are involved, since two distinct expressions may end up with the
    same span.
    
    Instead, we check the actual MIR `Location`, which eliminates false
    positives.
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    b3d99cb View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #73610 - GuillaumeGomez:cleanup-e0699, r=Dylan-DPC

    Clean up E0699 explanation
    
    r? @Dylan-DPC
    Dylan-DPC authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    e979392 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    08ec4cb View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3d0192e View commit details
    Browse the repository at this point in the history
  11. using "mir_body" (vs "body") in InstrumentCoverage

    The mod uses both MIR bodies and HIR bodies, so I'm trying to maintain
    consistency with these names.
    richkadel committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    a045140 View commit details
    Browse the repository at this point in the history
  12. Auto merge of #73635 - Dylan-DPC:rollup-b4wbp42, r=Dylan-DPC

    Rollup of 7 pull requests
    
    Successful merges:
    
     - #71756 (add Windows system error codes that should map to io::ErrorKind::TimedOut)
     - #73495 (Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits)
     - #73575 (Fix typo in error_codes doc)
     - #73578 (Make is_freeze and is_copy_modulo_regions take TyCtxtAt)
     - #73586 (switch_ty is redundant)
     - #73600 (Fix spurious 'value moved here in previous iteration of loop' messages)
     - #73610 (Clean up E0699 explanation)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    3b1c08c View commit details
    Browse the repository at this point in the history
  13. Updated query for num_counters to compute from max index

    Also added FIXME comments to note the possible need to accommodate
    counter increment calls in source-based functions that differ from the
    function context of the caller instance (e.g., inline functions).
    richkadel committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    977ce57 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #72271 - rakshith-ravi:master, r=varkor

    Improve compiler error message for wrong generic parameter order
    
    - Added optional "help" parameter that shows a help message on the compiler error if required.
    - Added a simple ordered parameter as a sample help.
    
    @varkor will make more changes as required. Let me know if I'm heading in the right direction.
    
    Fixes #68437
    
    r? @varkor
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    59e87c0 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #72493 - nikomatsakis:move-leak-check, r=matthewjasper

     move leak-check to during coherence, candidate eval
    
    Implementation of MCP rust-lang/compiler-team#295.
    
    I'd like to do a crater run on this.
    
    Note to @rust-lang/lang: This PR is a breaking change (bugfix). It causes tests like the following to go from a future-compatibility warning #56105 to a hard error:
    
    ```rust
    trait Trait {}
    impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {}
    impl Trait for for<'c> fn(&'c u32, &'c u32) {} // now rejected, used to warn
    ```
    
    I am not aware of any instances of this code in the wild, but that is why we are doing a crater run. The reason for this change is that those two types are, in fact, the same type, and hence the two impls are overlapping.
    
    There will still be impls that trigger #56105 after this lands, however -- I hope that we will eventually just accept those impls without warning, for the most part. One example of such an impl is this pattern, which is used by wasm-bindgen and other crates as well:
    
    ```rust
    trait Trait {}
    impl<T> Trait for fn(&T) { }
    impl<T> Trait for fn(T) { } // still accepted, but warns
    ```
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    903823c View commit details
    Browse the repository at this point in the history
  16. Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung…

    …,nagisa
    
    A way forward for pointer equality in const eval
    
    r? @varkor on the first commit and @RalfJung on the second commit
    
    cc #53020
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    ae38698 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of #73472 - GuillaumeGomez:cleanup-e0689, r=Dylan-DPC

    Clean up E0689 explanation
    
    r? @Dylan-DPC
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    98aa34c View commit details
    Browse the repository at this point in the history
  18. Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikom…

    …atsakis
    
    Account for multiple impl/dyn Trait in return type when suggesting `'_`
    
    Make `impl` and `dyn` Trait lifetime suggestions a bit more resilient.
    
    Follow up to #72804.
    
    r? @nikomatsakis
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    cd18ac1 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obk

    Add second message for LiveDrop errors
    
    This is an attempt to fix #72907 by adding a second message to the `LiveDrop` diagnostics. Changing from this
    ```
    error[E0493]: destructors cannot be evaluated at compile-time
     --> src/lib.rs:7:9
      |
    7 |     let mut always_returned = None;
      |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
    
    error: aborting due to previous error
    ```
    to this
    ```
    error[E0493]: destructors cannot be evaluated at compile-time
      --> foo.rs:6:9
       |
    6  |     let mut always_returned = None;
       |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
    ...
    10 |         always_returned = never_returned;
       |         --------------- value is dropped here
    
    error: aborting due to previous error
    ```
    r? @RalfJung @ecstatic-morse
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    0f9a6ed View commit details
    Browse the repository at this point in the history
  20. Rollup merge of #73567 - adetaylor:extern-doc-fix, r=dtolnay

    Clarify --extern documentation.
    
    Fixes #64731, #73531.
    
    See also #64402 (comment)
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    0560151 View commit details
    Browse the repository at this point in the history
  21. Rollup merge of #73572 - JOE1994:patch-4, r=jonas-schievink

    Fix typos in doc comments
    
    Hello 🦀 ,
    
    This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'
    
    Thank you for reviewing this PR 👍
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    84bd1e7 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of #73590 - davidtwco:bootstrap-fix-config-env-var, r=Ma…

    …rk-Simulacrum
    
    bootstrap: no `config.toml` exists regression
    
    Fixes #73574.
    
    This PR fixes a regression introduced in #73317 where an oversight meant that `config.toml` was assumed to exist.
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    44900f8 View commit details
    Browse the repository at this point in the history
  23. Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearth

    Rollup of 9 pull requests
    
    Successful merges:
    
     - #72271 (Improve compiler error message for wrong generic parameter order)
     - #72493 ( move leak-check to during coherence, candidate eval)
     - #73398 (A way forward for pointer equality in const eval)
     - #73472 (Clean up E0689 explanation)
     - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`)
     - #73515 (Add second message for LiveDrop errors)
     - #73567 (Clarify --extern documentation.)
     - #73572 (Fix typos in doc comments)
     - #73590 (bootstrap: no `config.toml` exists regression)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    1557fb0 View commit details
    Browse the repository at this point in the history
  24. The const propagator cannot trace references.

    Thus we avoid propagation of a local the moment we encounter references to it.
    oli-obk committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    5fa8b08 View commit details
    Browse the repository at this point in the history
  25. rustdoc: Fix doc aliases with crate filtering

    Fix a crash when searching for an alias contained in the currently selected filter crate.
    
    Also remove alias search results for crates that should be filtered out.
    
    The test suite needed to be fixed to actually take into account the crate filtering and check that there are no results when none are expected.
    ollie27 committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    478750c View commit details
    Browse the repository at this point in the history
  26. rustc: Modernize wasm checks for atomics

    This commit modernizes how rustc checks for whether the `atomics`
    feature is enabled for the wasm target. The `sess.target_features` set
    is consulted instead of fiddling around with dealing with various
    aspects of LLVM and that syntax.
    alexcrichton committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    0c2b025 View commit details
    Browse the repository at this point in the history
  27. Auto merge of #73644 - ollie27:rustdoc_alias_filter, r=GuillaumeGomez

    rustdoc: Fix doc aliases with crate filtering
    
    Fix a crash when searching for an alias contained in the currently selected filter crate.
    
    Also remove alias search results for crates that should be filtered out.
    
    The test suite needed to be fixed to actually take into account the crate filtering and check that there are no results when none are expected.
    
    Needs to be backported to beta to fix the `std` docs.
    
    Fixes #73620
    
    r? @GuillaumeGomez
    bors committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    ff5b446 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    6e8aa1f View commit details
    Browse the repository at this point in the history
  29. Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ol…

    …lie27
    
    Enforce doc alias check
    
    Part of #50146.
    
    r? @ollie27
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    7d2fba1 View commit details
    Browse the repository at this point in the history
  30. Rollup merge of #72876 - TrolledWoods:patch-2, r=Dylan-DPC

    Mention that BTreeMap::new() doesn't allocate
    
    I think it would be nice to mention this, so you don't have to dig through the src to look at the definition of new().
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    317a151 View commit details
    Browse the repository at this point in the history
  31. Rollup merge of #73244 - ecstatic-morse:validate-generator-mir, r=tma…

    …ndry
    
    Check for assignments between non-conflicting generator saved locals
    
    This is to prevent future changes to the generator transform from reintroducing the problem that caused #73137. Namely, a store between two generator saved locals whose storage does not conflict.
    
    My ultimate goal is to introduce a modified version of #71956 that handles this case properly.
    
    r? @tmandry
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    781b589 View commit details
    Browse the repository at this point in the history
  32. Rollup merge of #73488 - richkadel:llvm-coverage-map-gen, r=tmandry

    code coverage foundation for hash and num_counters
    
    This PR is the next iteration after PR #73011 (which is still waiting on bors to merge).
    
    @wesleywiser - PTAL
    r? @tmandry
    
    (FYI, I'm also working on injecting the coverage maps, in another branch, while waiting for these to merge.)
    
    Thanks!
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    f5e46fe View commit details
    Browse the repository at this point in the history
  33. Rollup merge of #73523 - jyn514:everybody_loops, r=ecstatic-morse

    Fix -Z unpretty=everybody_loops
    
    It turns out that this has not been working for who knows how long.
    Previously:
    
    ```
    pub fn h() { 1 + 2; }
    ```
    
    After this change:
    
    ```
    pub fn h() { loop { } }
    ```
    
    This only affected the pass when run with the command line
    pretty-printing option, so rustdoc was still replacing bodies with
    `loop {}`.
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    505cf52 View commit details
    Browse the repository at this point in the history
  34. Rollup merge of #73587 - marmeladema:hir-id-ification-final, r=petroc…

    …henkov
    
    Move remaining `NodeId` APIs from `Definitions` to `Resolver`
    
    Implements #73291 (comment)
    
    TL;DR: it moves all fields that are only needed during name resolution passes into the `Resolver` and keep the rest in `Definitions`. This effectively enforces that all references to `NodeId`s are gone once HIR lowering is completed.
    
    After this, the only remaining work for #50928 should be to adjust the dev guide.
    
    r? @petrochenkov
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    045761c View commit details
    Browse the repository at this point in the history
  35. Rollup merge of #73601 - Aaron1011:fix/better-mono-overflow-err, r=ec…

    …static-morse
    
    Point at the call span when overflow occurs during monomorphization
    
    This improves the output for issue #72577, but there's still more work
    to be done.
    
    Currently, an overflow error during monomorphization results in an error
    that points at the function we were unable to monomorphize. However, we
    don't point at the call that caused the monomorphization to happen. In
    the overflow occurs in a large recursive function, it may be difficult
    to determine where the issue is.
    
    This commit tracks and `Span` information during collection of
    `MonoItem`s, which is used when emitting an overflow error. `MonoItem`
    itself is unchanged, so this only affects
    `src/librustc_mir/monomorphize/collector.rs`
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    30fba22 View commit details
    Browse the repository at this point in the history
  36. Rollup merge of #73613 - oli-obk:const_prop_miscompile, r=wesleywiser

    The const propagator cannot trace references.
    
    Thus we avoid propagation of a local the moment we encounter references to it.
    
    fixes #73609
    
    cc @RalfJung
    
    r? @wesleywiser
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    d8b4604 View commit details
    Browse the repository at this point in the history
  37. Rollup merge of #73614 - lcnr:patch-4, r=Dylan-DPC

    fix `intrinsics::needs_drop` docs
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    f7d5687 View commit details
    Browse the repository at this point in the history
  38. Rollup merge of #73630 - estebank:fn-item-e0308, r=davidtwco

    Provide context on E0308 involving fn items
    
    Fix #73487.
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    4f2e540 View commit details
    Browse the repository at this point in the history
  39. Rollup merge of #73665 - alexcrichton:update-wasm-atomics-feature, r=…

    …davidtwco
    
    rustc: Modernize wasm checks for atomics
    
    This commit modernizes how rustc checks for whether the `atomics`
    feature is enabled for the wasm target. The `sess.target_features` set
    is consulted instead of fiddling around with dealing with various
    aspects of LLVM and that syntax.
    Manishearth authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    6ed6a84 View commit details
    Browse the repository at this point in the history
  40. Auto merge of #73669 - Manishearth:rollup-0n4u7vq, r=Manishearth

    Rollup of 11 pull requests
    
    Successful merges:
    
     - #72780 (Enforce doc alias check)
     - #72876 (Mention that BTreeMap::new() doesn't allocate)
     - #73244 (Check for assignments between non-conflicting generator saved locals)
     - #73488 (code coverage foundation for hash and num_counters)
     - #73523 (Fix -Z unpretty=everybody_loops)
     - #73587 (Move remaining `NodeId` APIs from `Definitions` to `Resolver`)
     - #73601 (Point at the call span when overflow occurs during monomorphization)
     - #73613 (The const propagator cannot trace references.)
     - #73614 (fix `intrinsics::needs_drop` docs)
     - #73630 (Provide context on E0308 involving fn items)
     - #73665 (rustc: Modernize wasm checks for atomics)
    
    Failed merges:
    
    r? @ghost
    bors committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    0c04344 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2020

  1. Auto merge of #73293 - Aaron1011:feature/macro-rules-arg-capture, r=p…

    …etrochenkov
    
    Always capture tokens for `macro_rules!` arguments
    
    When we invoke a proc-macro, the `TokenStream` we pass to it may contain 'interpolated' AST fragments, represented by `rustc_ast::token::Nonterminal`. In order to correctly, pass a `Nonterminal` to a proc-macro, we need to have 'captured' its `TokenStream` at the time the AST was parsed.
    
    Currently, we perform this capturing when attributes are present on items and expressions, since we will end up using a `Nonterminal` to pass the item/expr to any proc-macro attributes it is annotated with. However, `Nonterminal`s are also introduced by the expansion of metavariables in `macro_rules!` macros. Since these metavariables may be passed to proc-macros, we need to have tokens available to avoid the need to pretty-print and reparse (see #43081).
    
    This PR unconditionally performs token capturing for AST items and expressions that are passed to a `macro_rules!` invocation. We cannot know in advance if captured item/expr will be passed to proc-macro, so this is needed to ensure that tokens will always be available when they are needed.
    
    This ensures that proc-macros will receive tokens with proper `Spans` (both location and hygiene) in more cases. Like all work on #43081, this will cause regressions in proc-macros that were relying on receiving tokens with dummy spans.
    
    In this case, Crater revealed only one regression: the [Pear](https://github.com/SergioBenitez/Pear) crate (a helper for [rocket](https://github.com/SergioBenitez/Rocket)), which was previously [fixed](SergioBenitez/Pear#25) as part of #73084.
    
    This regression manifests itself as the following error:
    
    ```
    [INFO] [stdout] error: proc macro panicked
    [INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/github.com-1ecc6299db9ec823/rocket_http-0.4.5/src/parse/uri/parser.rs:119:34
    [INFO] [stdout]     |
    [INFO] [stdout] 119 |             let path_and_query = pear_try!(path_and_query(is_pchar));
    [INFO] [stdout]     |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [INFO] [stdout]     |
    [INFO] [stdout]     = help: message: called `Option::unwrap()` on a `None` value
    [INFO] [stdout]     = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
    ```
    
    It can be fixed by running `cargo update -p pear`, which updates your `Cargo.lock` to use the latest version of Pear (which includes a bugfix for the regression).
    
    Split out from #73084
    bors committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    3c90ae8 View commit details
    Browse the repository at this point in the history