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 rustc #8

Merged
merged 3,288 commits into from
Jun 5, 2018
Merged

Update rustc #8

merged 3,288 commits into from
Jun 5, 2018
This pull request is big! We’re only showing the most recent 250 commits.

Commits on May 25, 2018

  1. Auto merge of rust-lang#51033 - coryshrmn:master, r=dtolnay

    stabilize RangeBounds collections_range rust-lang#30877
    
    The FCP for rust-lang#30877 closed last month, with the decision to:
    1. move from `collections::range::RangeArgument` to `ops::RangeBounds`, and
    2. rename `start()` and `end()` to `start_bounds()` and `end_bounds()`.
    
    Simon Sapin already moved it to `ops::RangeBounds` in rust-lang#49163.
    
    I renamed the functions, and removed the old `collections::range::RangeArgument` alias.
    
    This is my first Rust PR, please let me know if I can improve anything. This passes all tests for me, except the `clippy` tool (which uses `RangeArgument::start()`).
    
    I considered deprecating `start()` and `end()` instead of removing them, but the contribution guidelines indicate we can break `clippy` temporarily. I thought it was best to remove the functions, since we're worried about name collisions with `Range::start` and `end`.
    
    Closes rust-lang#30877.
    bors committed May 25, 2018
    Configuration menu
    Copy the full SHA
    07c415c View commit details
    Browse the repository at this point in the history

Commits on May 26, 2018

  1. Auto merge of rust-lang#50070 - toidiu:ak-2093-outlives, r=nikomatsakis

    2093 infer outlives requirements
    
    Tracking issue:  rust-lang#44493
    RFC: rust-lang/rfcs#2093
    
    - [x] add `rustc_attrs` flag
    - [x] use `RequirePredicates` type
    - [x]  handle explicit predicates on `dyn` Trait
    - [x] handle explicit predicates on projections
    - [x] more tests
    - [x]  remove `unused`, `dead_code` and etc..
    - [x]  documentation
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    49a97ef View commit details
    Browse the repository at this point in the history
  2. Fail typecheck if we encounter a bogus break

    Lone breaks outside of loops create errors in the
    loop check pass but as they are not fatal,
    compilation continues.
    
    MIR building code assumes all HIR break statements
    to point to valid locations and fires ICEs if this
    assumption is violated. In normal compilation,
    this causes no issues, as code apparently prevents
    MIR from being built if errors are present.
    
    However, before that, typecheck runs and with it
    MIR const eval. Here we operate differently
    from normal compilation: it doesn't check for any
    errors except for type checker ones and then
    directly builds the MIR.
    
    This constellation causes an ICE-on-error if
    bogus break statements are being put into array
    length expressions.
    
    This commit fixes this ICE by letting typecheck
    fail if bogus break statements are encountered.
    This way, MIR const eval fails cleanly with a
    type check error.
    
    Fixes rust-lang#50576
    Fixes rust-lang#50581
    est31 committed May 26, 2018
    Configuration menu
    Copy the full SHA
    5724dad View commit details
    Browse the repository at this point in the history
  3. Rename TokenStream::empty to TokenStream::new

    There is no precedent for the `empty` name -- we do not have
    `Vec::empty` or `HashMap::empty` etc.
    dtolnay committed May 26, 2018
    Configuration menu
    Copy the full SHA
    a49bc9c View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#51035 - oli-obk:unsupported_crate_type, r=eddyb

    Don't ICE if crate has no valid crate types left
    
    fixes rust-lang#50993
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    67d99d9 View commit details
    Browse the repository at this point in the history
  5. in which we check for confusable Unicodepoints in float literal exponent

    The `FatalError.raise()` might seem unmotivated (in most places in
    the compiler, `err.emit()` suffices), but it's actually used to
    maintain behavior (viz., stop lexing, don't emit potentially spurious
    errors looking for the next token after the bad Unicodepoint in the
    exponent): the previous revision's `self.err_span_` ultimately calls
    `Handler::emit`, which aborts if the `Handler`'s continue_after_error
    flag is set, which seems to typically be true during lexing (see
    `phase_1_parse_input` and and how `CompileController::basic` has
    `continue_parse_after_error: false` in librustc_driver).
    
    Also, let's avoid apostrophes in error messages (the present author
    would argue that users expect a reassuringly detached, formal,
    above-it-all tone from a Serious tool like a compiler), and use an
    RLS-friendly structured suggestion.
    
    Resolves rust-lang#49746.
    zackmdavis authored and estebank committed May 26, 2018
    Configuration menu
    Copy the full SHA
    6437295 View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#50364 - LukasKalbertodt:improve-duration-debu…

    …g-impl, r=KodrAus
    
    Improve `Debug` impl of `time::Duration`
    
    Hi there!
    
    For a long time now, I was getting annoyed by the derived `Debug` impl of `Duration`. Usually, I use `Duration` to either do quick'n'dirty benchmarking or measuring the time of some operation in general. The output of the derived Debug impl is hard to parse for humans: is { secs: 0, nanos: 968360102 } or { secs: 0, nanos 98507324 } longer?
    
    So after running into the annoyance several times (sometimes building my own function to print the Duration properly), I decided to tackle this. Now the output looks like this:
    
    ```
    Duration::new(1, 0)                 => 1s
    Duration::new(1, 1)                 => 1.000000001s
    Duration::new(1, 300)               => 1.0000003s
    Duration::new(1, 4000)              => 1.000004s
    Duration::new(1, 600000)            => 1.0006s
    Duration::new(1, 7000000)           => 1.007s
    Duration::new(0, 0)                 => 0ns
    Duration::new(0, 1)                 => 1ns
    Duration::new(0, 300)               => 300ns
    Duration::new(0, 4001)              => 4.001µs
    Duration::new(0, 600300)            => 600.3µs
    Duration::new(0, 7000000)           => 7ms
    ```
    
    Note that I implemented the formatting manually and didn't use floats. No information is "lost" when printing. So `Duration::new(123_456_789_000, 900_000_001)` prints as `123456789000.900000001s`.
    
    ~~This is not yet finished~~, but I wanted to open the PR now already in order to get some feedback (maybe everyone likes the derived impl).
    
    ### Still ToDo:
    
    - [x] Respect precision ~~and width~~ parameter of the formatter (see [this comment](rust-lang#50364 (comment)))
    
    ### Alternatives/Decisions
    
    - Should large durations displayed in minutes, hours, days, ...? For now, I decided not to because the current formatting is close the how a `Duration` is stored. From this new `Debug` output, you can still easily see what the values of `secs` and `nanos` are. A formatting like `3h 27m 12s 9ms` might be more appropriate for a `Display` impl?
    - Should this rather be a `Display` impl and should `Debug` be derived? Maybe this formatting is too fancy for `Debug`? In my opinion it's not and, as already mentioned, from the current format one can still very easily determine the values for `secs` and `nanos`.
    - Whitespace between the number and the unit?
    
    ### Notes for reviewers
    
    - ~~The combined diff sucks. Rather review both commits individually.~~
    - ~~In the unit test, I am building my own type implementing `fmt::Write` to test the output. Maybe there is already something like that which I can use?~~
    - My `Debug` impl block is marked as `#[stable(...)]`... but that's fine since the derived Debug impl was stable already, right?
    
    ---
    
    ~~Apart from the main change, I moved all `time` unit tests into the `tests` directory. All other `libcore` tests are there, so I guess it was simply an oversight. Prior to this change, the `time` tests weren't run, so I guess this is kind of a bug fix. If my `Debug` impl is rejected, I can of course just send the fix as PR.~~ (this was already merged in rust-lang#50466)
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    444a9c3 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#51041 - alexcrichton:better-unwind, r=nikomat…

    …sakis
    
    std: Ensure OOM is classified as `nounwind`
    
    OOM can't unwind today, and historically it's been optimized as if it can't
    unwind. This accidentally regressed with recent changes to the OOM handler, so
    this commit adds in a codegen test to assert that everything gets optimized away
    after the OOM function is approrpiately classified as nounwind
    
    Closes rust-lang#50925
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    b4247d4 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#50987 - estebank:underline-multiple-suggest…

    …ions, r=petrochencov
    
    Underline multiple suggested replacements in the same line
    
    <img width="685" alt="screen shot 2018-05-22 at 21 06 48" src="https://user-images.githubusercontent.com/1606434/40403051-174f3180-5e04-11e8-86b6-261630c5ff80.png">
    
    Follow up to rust-lang#50943.
    
    Fix rust-lang#50977.
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    103abdb View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#51014 - GuillaumeGomez:env_docs, r=QuietMis…

    …dreavus
    
    Add documentation about env! second argument
    
    Fixes rust-lang#48044.
    
    r? @QuietMisdreavus
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    ee18e92 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#51034 - oli-obk:lowering, r=pnkfelix

    Remove unused lowering field and method
    
    r? @nikomatsakis
    
    So while trying to understand lowering better, I found out that there's something related to creating definitions. Analyzing that further, I realized that it is entirely dead code.
    
    The `parent_def` field was only ever used for setting and resetting the field itself. The field was never read anywhere else and thus its value was entirely unused.
    
    Maybe the `unused_field` lint should detect when the only use of a field is the field being read without using the read value other than writing back to the field?
    
    The diff is best viewed without whitespace changes getting in the way: https://github.com/rust-lang/rust/pull/51034/files?w=1
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    e66ba0f View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#51047 - spastorino:use_polonius_engine_fact…

    …s, r=nikomatsakis
    
    Use AllFacts from polonius-engine
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    e667e7b View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#51048 - GuillaumeGomez:formatter-examples, …

    …r=QuietMisdreavus
    
    Add more missing examples for Formatter
    
    r? @QuietMisdreavus
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    08b4170 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#51056 - tbu-:pr_once_new, r=dtolnay

    Mention and use `Once::new` instead of `ONCE_INIT`
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    e0e598b View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#51059 - oberien:patch-1, r=nikomatsakis

    What does an expression look like, that consists only of special characters?
    
    I had a lot of fun creating this together with @CryZe
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    5d95492 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#51065 - mbrubeck:docs, r=rkruppe

    Update nomicon link in transmute docs
    
    The list of "invalid primitive values" has moved to a different URL within the Rustonomicon.
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    18028eb View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#51067 - mcarton:patch-1, r=steveklabnik

    Add inner links in documentation
    
    From [this SO question](https://stackoverflow.com/q/50518757/2733851) it looks like this page isn't really clear.
    I personally do think this page is quite clear, the only think I could think of was adding some references.
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    239e3d2 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#51070 - est31:fix_break_const_ice, r=estebank

    Fail typecheck if we encounter a bogus break
    
    Lone breaks outside of loops create errors in the
    loop check pass but as they are not fatal,
    compilation continues.
    
    MIR building code assumes all HIR break statements
    to point to valid locations and fires ICEs if this
    assumption is violated. In normal compilation,
    this causes no issues, as code apparently prevents
    MIR from being built if errors are present.
    
    However, before that, typecheck runs and with it
    MIR const eval. Here we operate differently
    from normal compilation: it doesn't check for any
    errors except for type checker ones and then
    directly builds the MIR.
    
    This constellation causes an ICE-on-error if
    bogus break statements are being put into array
    length expressions.
    
    This commit fixes this ICE by letting typecheck
    fail if bogus break statements are encountered.
    This way, MIR const eval fails cleanly with a
    type check error.
    
    Fixes rust-lang#50576
    Fixes rust-lang#50581
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    5089ebc View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#51073 - dtolnay:empty, r=alexcrichton

    Rename TokenStream::empty to TokenStream::new
    
    There is no precedent for the `empty` name -- we do not have `Vec::empty` or `HashMap::empty` etc.
    
    I would propose landing this but reflecting it in a non-breaking release of proc-macro2 that provides both `new` and a deprecated `empty` constructor.
    
    Tracking issue: rust-lang#38356
    
    r? @alexcrichton
    kennytm committed May 26, 2018
    Configuration menu
    Copy the full SHA
    84b2e14 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    189c0a1 View commit details
    Browse the repository at this point in the history
  20. Auto merge of rust-lang#51082 - kennytm:rollup, r=kennytm

    Rollup of 11 pull requests
    
    Successful merges:
    
     - rust-lang#50987 (Underline multiple suggested replacements in the same line)
     - rust-lang#51014 (Add documentation about env! second argument)
     - rust-lang#51034 (Remove unused lowering field and method)
     - rust-lang#51047 (Use AllFacts from polonius-engine)
     - rust-lang#51048 (Add more missing examples for Formatter)
     - rust-lang#51056 (Mention and use `Once::new` instead of `ONCE_INIT`)
     - rust-lang#51059 (What does an expression look like, that consists only of special characters?)
     - rust-lang#51065 (Update nomicon link in transmute docs)
     - rust-lang#51067 (Add inner links in documentation)
     - rust-lang#51070 (Fail typecheck if we encounter a bogus break)
     - rust-lang#51073 (Rename TokenStream::empty to TokenStream::new)
    
    Failed merges:
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    7a0e6a8 View commit details
    Browse the repository at this point in the history
  21. Add Ident::as_str helper

    petrochenkov committed May 26, 2018
    Configuration menu
    Copy the full SHA
    1e4269c View commit details
    Browse the repository at this point in the history
  22. Auto merge of rust-lang#51052 - nikomatsakis:obsolete-arrow, r=petroc…

    …henkov
    
    restore emplacement syntax (obsolete)
    
    Fix rust-lang#50832
    
    r? @petrochenkov
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    1594c6c View commit details
    Browse the repository at this point in the history
  23. Auto merge of rust-lang#51072 - petrochenkov:ifield, r=eddyb

    Use `Ident`s for fields in HIR
    
    Continuation of rust-lang#49718, part of rust-lang#49300
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    1e504d3 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    ae80941 View commit details
    Browse the repository at this point in the history
  25. Rollup merge of rust-lang#51049 - varkor:break-while-condition, r=nik…

    …omatsakis
    
    Fix behaviour of divergence in while loop conditions
    
    This fixes `'a: while break 'a {};` being treated as diverging, by tracking break expressions in the same way as in `loop` expressions.
    
    Fixes rust-lang#50856.
    
    r? @nikomatsakis
    Mark-Simulacrum committed May 26, 2018
    Configuration menu
    Copy the full SHA
    90b7bf6 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#51057 - pnkfelix:issue-51025-make-ui-tests-…

    …robust-wrt-nll, r=nikomatsakis
    
    make ui tests robust with respect to NLL
    
    This PR revises the `ui` tests that I could quickly identify that:
     1. previously had successful compilations under non-lexical lifetimes (NLL) because they assumed lexical lifetimes, but
     2. such assumption of lexical lifetimes was actually not necessarily part of the spirit of the original issue/bug we want to witness.
    
    In many cases, this is simply a matter of adding a use of a borrow so that it gets extended long enough to observe a conflict.
    
    (In some cases the revision was more subtle, such as adding a destructor, or revising the order of declaration of some variables.)
    
    ----
    
    With these test revisions in place, I subsequently updated the expected stderr output under the NLL compiletest mode. So now we should get even more testing of NLL than we were before.
    
    Fix rust-lang#51025
    Mark-Simulacrum committed May 26, 2018
    Configuration menu
    Copy the full SHA
    b1de351 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#51092 - Mark-Simulacrum:release-notes-maste…

    …r, r=Mark-Simulacrum
    
    [master] Release notes for 1.26.1
    
    None
    Mark-Simulacrum committed May 26, 2018
    Configuration menu
    Copy the full SHA
    472b04d View commit details
    Browse the repository at this point in the history
  28. Point to the current box syntax tracking issue

    The issue was used for both box syntax as well as placement new.
    It got closed due to placement new being unapproved.
    So a new one got created for box syntax, yet neither
    the unstable book nor feature_gate.rs got updated.
    We are doing this now.
    est31 committed May 26, 2018
    Configuration menu
    Copy the full SHA
    20ab884 View commit details
    Browse the repository at this point in the history
  29. Fix test

    estebank committed May 26, 2018
    Configuration menu
    Copy the full SHA
    7dec8a4 View commit details
    Browse the repository at this point in the history
  30. Auto merge of rust-lang#51094 - Mark-Simulacrum:rollup, r=Mark-Simula…

    …crum
    
    Rollup of 3 pull requests
    
    Successful merges:
    
     - rust-lang#51049 (Fix behaviour of divergence in while loop conditions)
     - rust-lang#51057 (make ui tests robust with respect to NLL)
     - rust-lang#51092 ([master] Release notes for 1.26.1)
    
    Failed merges:
    bors committed May 26, 2018
    Configuration menu
    Copy the full SHA
    5015fa3 View commit details
    Browse the repository at this point in the history
  31. Update cargo

    mati865 committed May 26, 2018
    Configuration menu
    Copy the full SHA
    05f15d4 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    023137d View commit details
    Browse the repository at this point in the history

Commits on May 27, 2018

  1. innacurate -> inaccurate

    11Takanori committed May 27, 2018
    Configuration menu
    Copy the full SHA
    f386cda View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#51066 - est31:master, r=sfackler

    Point to the current box syntax tracking issue
    
    The issue was used for both box syntax as well as placement new.
    It got closed due to placement new being unapproved.
    So a new one got created for box syntax, yet neither
    the unstable book nor feature_gate.rs got updated.
    We are doing this now.
    
    r? @aidanhs
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    f0805a4 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#51075 - estebank:and_the_case_of_the_confusab…

    …le_float_exponent, r=eddyb
    
    Check for confusable Unicode chars in float literal exponent
    
    Fixing tests for rust-lang#49989. Resolves rust-lang#49746.
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    1a6bda6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    509f414 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#51090 - kennytm:tidy-check-missing-tracking-i…

    …ssue, r=alexcrichton
    
    Ensure every unstable language feature has a tracking issue.
    
    Filled in the missing numbers:
    
    * `abi_ptx` → rust-lang#38788
    * `generators` → rust-lang#43122
    * `global_allocator` → rust-lang#27389
    
    Reused existing tracking issues because they were decomposed from a larger feature
    
    * `*_target_feature` → rust-lang#44839 (reusing the old `target_feature` number)
    * `proc_macros_*` → rust-lang#38356 (reusing the to-be-stabilized `proc_macros` number)
    
    Filed new issues
    
    * `exhaustive_patterns` → rust-lang#51085
    * `pattern_parentheses` → rust-lang#51087
    * `wasm_custom_section` and `wasm_import_module` → rust-lang#51088
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    3fd82a5 View commit details
    Browse the repository at this point in the history
  6. lib.rs don't beautiful

    uuttff8 committed May 27, 2018
    Configuration menu
    Copy the full SHA
    bbd790c View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#51084 - simartin:issue_51022, r=estebank

    Issue rust-lang#51022: Improve E0131 message when lifetimes are involved.
    
    Fixes rust-lang#51022
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    7d218fc View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bbcace5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0eeebe1 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#51101 - 11Takanori:fix-typo, r=frewsxcv

    Fix typo in macro_parser.rs
    
    innacurate -> inaccurate
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    a52b01b View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    fb447f1 View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#51105 - uuttff8:master, r=GuillaumeGomez

    lib.rs don't beautiful
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    63b1070 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    9bb939d View commit details
    Browse the repository at this point in the history
  14. Make &Slice a thin pointer

    Zoxc committed May 27, 2018
    Configuration menu
    Copy the full SHA
    6c2d875 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    0b6586b View commit details
    Browse the repository at this point in the history
  16. Add fields to Slice

    Zoxc committed May 27, 2018
    Configuration menu
    Copy the full SHA
    fb4e3b6 View commit details
    Browse the repository at this point in the history
  17. Auto merge of rust-lang#51078 - GuillaumeGomez:stabilize-formatter, r…

    …=SimonSapin
    
    Stabilize Formatter alignment
    
    Fixes rust-lang#27726.
    
    cc @SimonSapin
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    dcb4056 View commit details
    Browse the repository at this point in the history
  18. Auto merge of rust-lang#51108 - simartin:issue_51022_follow-up, r=est…

    …ebank
    
    Address comments in pull request rust-lang#51084.
    
    This is a follow-up to rust-lang#51084, that's already been integrated into mainline.
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    f9f66c1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0e53b78 View commit details
    Browse the repository at this point in the history
  20. Auto merge of rust-lang#51062 - mati865:cargo_update, r=alexcrichton

    Update cargo
    
    There are few nice fixes waiting already.
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    ad2591c View commit details
    Browse the repository at this point in the history
  21. Use suggestion for assoc fn called like method

    When encountering an unexisting method for a given trait where an
    associated function has the same name, suggest using the appropriate
    syntax, instead of using `help` text.
    
    When only one candidate is found, do not call it "candidate #1", just
    call it "the candidate".
    estebank committed May 27, 2018
    Configuration menu
    Copy the full SHA
    447d894 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    24ee506 View commit details
    Browse the repository at this point in the history
  23. Auto merge of rust-lang#48309 - mark-i-m:anon_param_lint, r=nikomatsakis

    Make anon params lint warn-by-default
    
    This is intended as a followup on anonymous parameters deprecation.
    
    Cross-posting from rust-lang#41686:
    
    > After having read a bit more of the discussion that I can find, I propose a more aggressive deprecation strategy:
    > - We make the lint warn-by-default as soon as possible
    > - We make anon parameters a hard error at the epoch boundary
    
    cc @matklad @est31 @aturon
    bors committed May 27, 2018
    Configuration menu
    Copy the full SHA
    5f308ee View commit details
    Browse the repository at this point in the history

Commits on May 28, 2018

  1. Auto merge of rust-lang#50892 - davidtwco:issue-50004, r=alexcrichton

    Added rustdoc documentation to compiler docs.
    
    Fixes rust-lang#50004.
    
    r? @alexcrichton
    (since you reviewed the last PR about compiler docs)
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    d0456c6 View commit details
    Browse the repository at this point in the history
  2. Update RLS, Rustfmt, and Cargo

    nrc committed May 28, 2018
    Configuration menu
    Copy the full SHA
    0e6fff8 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#50612 - Zoxc:thin-slice, r=michaelwoerister

    Make &Slice a thin pointer
    
    Split out from rust-lang#50395
    
    r? @michaelwoerister
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    68e0e58 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    287ad54 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#50724 - zackmdavis:applicability_rush, r=Mani…

    …shearth
    
    add suggestion applicabilities to librustc and libsyntax
    
    A down payment on rust-lang#50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means).
    
    r? @Manishearth
    cc @killercup @estebank
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    16cd84e View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#51118 - nrc:update, r=oli-obk

    Update RLS, Rustfmt, and Cargo
    
    r? @Mark-Simulacrum
    
    Should fix broken rustfmt and RLS builds - Cargo update is needed for compatibility with RLS
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    2b1d69d View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#51121 - Manishearth:rust-syntax, r=killercup

    Mark .fixed files as Rust syntax for GitHub
    
    r? @killercup
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    a2c4d4e View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3b271eb View commit details
    Browse the repository at this point in the history
  9. operate on HirId in hir::Pat::each_binding, and consequences of that

    Changing the `each_binding` utility method to take the `HirId` of a
    binding pattern rather than its `NodeId` seems like a modest first step
    in support of the `HirId`ification initiative rust-lang#50928. (The inspiration
    for choosing this in particular came from the present author's previous
    work on diagnostics issued during liveness analysis, which is the most
    greatly affected module in this change.)
    zackmdavis committed May 28, 2018
    Configuration menu
    Copy the full SHA
    1329605 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    078486b View commit details
    Browse the repository at this point in the history
  11. scrap find_node_for_hir_id in favor of hir_to_node_id

    Michael Woerister pointed out that `hir_to_node_id` (introduced in
    August 2017's 28ddd7a) supersedes the functionality of
    `find_node_for_hir_id` (just a hash lookup compared to that linear
    search).
    zackmdavis committed May 28, 2018
    Configuration menu
    Copy the full SHA
    1b7488d View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    3ee9d89 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#50521 - gnzlbg:simd_float, r=alexcrichton

    Add simd math intrinsics and gather/scatter
    
    This PR adds simd math intrinsics for floating-point vectors (sqrt, sin, cos, pow, exp, log, fma, abs, etc.) and the generic simd gather/scatter intrinsics.
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    2612bbc View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    6c7a5ba View commit details
    Browse the repository at this point in the history
  15. Add primary span label

    estebank committed May 28, 2018
    Configuration menu
    Copy the full SHA
    b169cf1 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    43d863b View commit details
    Browse the repository at this point in the history
  17. Fix tidy

    estebank committed May 28, 2018
    Configuration menu
    Copy the full SHA
    2b2eff1 View commit details
    Browse the repository at this point in the history
  18. introduce shifted_in, shifted_out and friends

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    69ab6f2 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    7ebd4d6 View commit details
    Browse the repository at this point in the history
  20. Auto merge of rust-lang#50929 - zackmdavis:hiridification_initiative,…

    … r=michaelwoerister
    
    operate on `HirId` instead of `NodeId` in `hir::Pat::each_binding`, and consequences of that
    
    See rust-lang#50928 for motivation.
    
    Questions—
    
     * Is rust-lang#50928 actually a good idea as a plan of record, or is there some reason to keep `NodeId`s?
     * Are the uses of `find_node_for_hir_id` in this initial submission OK (see the FIXME comments)?
     * Can we bikeshed a better method names `struct_span_lint_hir` _&c._? (Coined in analogy to the `struct_span_lint_node` and `NodeId`, but it feels kind of semantically clunky.)
    
    r? @michaelwoerister
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    5bf68db View commit details
    Browse the repository at this point in the history
  21. get rid of str::from_raw_parts_mut

    str::from_raw_parts has been removed long ago because it can be obtained via
    str::from_utf8_unchecked and slice::from_raw_parts.  The same goes for
    str::from_raw_parts_mut.
    RalfJung committed May 28, 2018
    Configuration menu
    Copy the full SHA
    b30aaf2 View commit details
    Browse the repository at this point in the history
  22. Auto merge of rust-lang#50465 - clarcharr:wrapping, r=KodrAus

    Add missing Wrapping methods, use doc_comment!
    
    Re-opened version of rust-lang#49393 . Finishing touches for rust-lang#32463.
    
    Note that this adds `Shl` and `Shr` implementations for `Wrapping<i128>` and `Wrapping<u128>`, which were previously missed. This is technically insta-stable, but I don't know why this would be a problem.
    bors committed May 28, 2018
    Configuration menu
    Copy the full SHA
    e9a489b View commit details
    Browse the repository at this point in the history
  23. port fold_regions and friends to use debruijn indices directly

    They no longer talk about plain integers.
    
    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    9c5a450 View commit details
    Browse the repository at this point in the history
  24. make shifted_in and shifted_out const fns

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    b5018de View commit details
    Browse the repository at this point in the history
  25. stop invoking DebruijnIndex::new directly

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    8bd4bff View commit details
    Browse the repository at this point in the history
  26. port nice_region_error code to not track depth but rather index

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    e2f7f4a View commit details
    Browse the repository at this point in the history
  27. rewrite the hasher to not access depth field

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    f965b79 View commit details
    Browse the repository at this point in the history
  28. refactor resolve_lifetime to track outer-index, not depth

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    34c9ae7 View commit details
    Browse the repository at this point in the history
  29. replace use of DebruijnIndex in for_each_free_region

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    4aeb6ef View commit details
    Browse the repository at this point in the history
  30. convert LateBoundRegionsCollector to track a debruijn index

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    06b2a3f View commit details
    Browse the repository at this point in the history
  31. replace binder_depth in LateBoundRegionsDetector

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    8f15d1e View commit details
    Browse the repository at this point in the history
  32. remove use of depth from TyS and replace with a debruijn index

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    7e15e0b View commit details
    Browse the repository at this point in the history
  33. make depth private

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    22a25d9 View commit details
    Browse the repository at this point in the history
  34. change to 0-based indices

    Co-authored-by: csmoe <35686186+csmoe@users.noreply.github.com>
    nikomatsakis and csmoe committed May 28, 2018
    Configuration menu
    Copy the full SHA
    783fe4f View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    18cf47b View commit details
    Browse the repository at this point in the history

Commits on May 29, 2018

  1. Configuration menu
    Copy the full SHA
    855ec8b View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#50475 - csmoe:debr, r=nikomatsakis

    Refactor DebruijnIndex to be 0-based
    
    Fixes rust-lang#49813
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    5ae5361 View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#51144 - tmccombs:unix-epoch-stable, r=Mark-Si…

    …mulacrum
    
    Stabilize SystemTime::UNIX_EPOCH
    
    Fixes rust-lang#49502
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    fe5c45b View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#51142 - nickbabcock:doc-inspect, r=frewsxcv

    Document additional use case for iter::inspect
    
    Adds docs for `iter::inspect` showing the non-debug use case
    
    Closes rust-lang#49564
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    4f6d9bf View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#51019 - Zoxc:hash-bytes, r=michaelwoerister

    Hash up to 8 bytes at once with FxHasher
    
    r? @michaelwoerister
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    61f35e5 View commit details
    Browse the repository at this point in the history
  6. Revert "Set opt-level to 3"

    This reverts commit aad9840.
    
    Level 3 (possibly indirectly, the underlying bug might be in XCode’s linker)
    causes unit tests to sefault when compiled with some versions of XCode:
    rust-lang#50867
    
    It also appears to cause some segfaults on Windows:
    rust-lang#50329 (comment)
    
    … and regressions in some rustc performance benchmarks:
    rust-lang#50329 (comment)
    SimonSapin committed May 29, 2018
    Configuration menu
    Copy the full SHA
    01e8616 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#51134 - RalfJung:from_raw_parts, r=SimonSapin

    extend from_raw_parts docs for slices and strs to mention alignment requirement
    
    The documentation for `str::from_raw_parts_mut` seems to not be visible because that method is private, bit I figured it could still be fixed. I also removed the reference to the no-longer-existing `str::from_raw_parts` while I was at it.
    
    Alternatively, should I remove `str::from_raw_parts_mut` completely? it is only used in `str::split_at_mut`, where it might as well be inlined.
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    889d8dc View commit details
    Browse the repository at this point in the history
  8. bump polonius engine

    qmx authored and spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    422fe7c View commit details
    Browse the repository at this point in the history
  9. expose -Zpolonius flag

    qmx authored and spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    4f88283 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    b45aebf View commit details
    Browse the repository at this point in the history
  11. store polonius output in MirBorrowCtx

    qmx authored and spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    2cd09f2 View commit details
    Browse the repository at this point in the history
  12. store output in FlowState

    qmx authored and spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    db39ec8 View commit details
    Browse the repository at this point in the history
  13. Use polonius_output

    spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    9de4e34 View commit details
    Browse the repository at this point in the history
  14. Run rustfmt

    spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    a8b36c9 View commit details
    Browse the repository at this point in the history
  15. Whitelist datafrog on tidy

    spastorino committed May 29, 2018
    Configuration menu
    Copy the full SHA
    4c10a65 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c3d6889 View commit details
    Browse the repository at this point in the history
  17. Auto merge of rust-lang#51133 - spastorino:make_borrowck_use_output, …

    …r=nikomatsakis
    
    Make borrowck use polonius output
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    59c0f59 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5067d2f View commit details
    Browse the repository at this point in the history
  19. Auto merge of rust-lang#51165 - SimonSapin:opt2, r=alexcrichton

    Revert "Set opt-level to 3"
    
    This reverts commit aad9840.
    
    Level 3 (possibly indirectly, the underlying bug might be in XCode’s linker) causes unit tests to sefault when compiled with some versions of XCode: rust-lang#50867
    
    It also appears to cause some segfaults on Windows: rust-lang#50329 (comment), and regressions in some rustc performance benchmarks: rust-lang#50329 (comment)
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    524ad9b View commit details
    Browse the repository at this point in the history
  20. Refactored DFS to be much cleaner. Added continue after noting that b…

    …orrow is out of scope at location.
    davidtwco committed May 29, 2018
    Configuration menu
    Copy the full SHA
    4500fe0 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    9c63714 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    62b1e65 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    948f77c View commit details
    Browse the repository at this point in the history
  24. fix off by one error

    nikomatsakis committed May 29, 2018
    Configuration menu
    Copy the full SHA
    3a9134d View commit details
    Browse the repository at this point in the history
  25. Pass a Layout to oom

    As discussed in
    rust-lang#49668 (comment)
    and subsequent, there are use-cases where the OOM handler needs to know
    the size of the allocation that failed. The alignment might also be a
    cause for allocation failure, so providing it as well can be useful.
    glandium committed May 29, 2018
    Configuration menu
    Copy the full SHA
    0f4ef00 View commit details
    Browse the repository at this point in the history
  26. Debug flag to bypass restriction of mutation in match guards.

    Now, if you pass `-Z disable-ast-check-for-mutation-in-guard`, then we
    will just allow you to mutably-borrow and assign in guards of `match`
    arms.
    
    This is wildly unsound with AST-borrowck. It is also unsound with
    MIR-borrowck without further adjustments, which come in later in the
    commit series on this Pull Request.
    
    See also rust-lang#24535 and rust-lang/rfcs#1006.
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    47bb3fd View commit details
    Browse the repository at this point in the history
  27. rust-lang#27282: Add StatementKind::ReadForMatch to MIR.

    (This is just the data structure changes and some boilerplate match
    code that followed from it; the actual emission of these statements
    comes in a follow-up commit.)
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    24abe6f View commit details
    Browse the repository at this point in the history
  28. rust-lang#27282: emit ReadForMatch on each match arm.

    Also, turn on ReadForMatch emission by default (when using NLL).
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    173315e View commit details
    Browse the repository at this point in the history
  29. rust-lang#41962 has a new error with my new code. Incorporate that in…

    …to my code.
    
    In particular, I am adding an implicit injected borrow on the pattern
    matches, and when we go around the loop, the compiler is reporting
    that this injected borrow is conflicting with the move of the original
    value when the match succeeds.
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    5c30dc8 View commit details
    Browse the repository at this point in the history
  30. Fallout from allowing some mutation in guards.

    For some reason, allowing restricted mutation in match arms exposed an
    obvious case where a unique borrow can indeed fail, namely something
    like:
    
    ```rust
    match b {
        ...
        ref mut r if { (|| { let bar = &mut *r; **bar = false; })(); false } => { &mut *r }
        //                             ~~~~~~~
        //                                |
        // This ends up holding a `&unique` borrow of `r`, but there ends up being an
        // implicit shared borrow in the guard thanks to rust-lang#49870
        ...
    }
    ```
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    638acd3 View commit details
    Browse the repository at this point in the history
  31. Expand two-phase-borrows so that a case like this still compiles:

    ```rust
    fn main() {
        fn reuse<X>(_: &mut X) {}
        let mut t = 2f64;
        match t {
            ref mut _b if { false } => { reuse(_b); }
            _ => {}
        }
    }
    ```
    
    Note: The way this is currently written is confusing; when `autoref`
    is off, then the arm body bindings (introduced by
    `bind_matched_candidate_for_arm_body`) are *also* used for the guard.
    (Any attempt to fix this needs to still ensure that the bindings used
    by the guard are introduced before the guard is evaluated.)
    
    (Once we turn NLL on by default, we can presumably simplify all of
    that.)
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    3bc5073 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    5eebd36 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    98d5e13 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    2b5aa90 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    a4a5fa2 View commit details
    Browse the repository at this point in the history
  36. Review feedback: Remove a fixme/tbd note and just add a note for the …

    …post-NLL future.
    
    Driveby: just inline the two-line `fn inject_borrow` into its one call
    site and remove its definition.
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    7f0c8f6 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    2f7f7ac View commit details
    Browse the repository at this point in the history
  38. Review feedback: Fix typo.

    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    324ced8 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    9d5cdc9 View commit details
    Browse the repository at this point in the history
  40. Fix additional nits:

      - compute bytes_to_copy more elegantly
      - add assert that written is 0 in fallback case
    nicokoch committed May 29, 2018
    Configuration menu
    Copy the full SHA
    c7d6a01 View commit details
    Browse the repository at this point in the history
  41. Fix typo

    estebank committed May 29, 2018
    Configuration menu
    Copy the full SHA
    59b03b1 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    c7312fb View commit details
    Browse the repository at this point in the history
  43. Auto merge of rust-lang#50772 - nicokoch:fastcopy, r=alexcrichton

    fs: copy: use copy_file_range on Linux
    
    Linux 4.5 introduced a new system call [copy_file_range](http://man7.org/linux/man-pages/man2/copy_file_range.2.html) to copy data from one file to another.
    
    This PR uses the new system call (if available). This has several advantages:
    
    1. No need to constantly copy data from userspace to kernel space, if the buffer is small or the file is large
    2. On some filesystems, like BTRFS, the kernel can leverage internal fs mechanisms for huge performance gains
    3. Filesystems on the network dont need to copy data between the host and the client machine (they have to in the current read/write implementation)
    
    I have created a small library that also implements the new system call for some huge performance gains here: https://github.com/nicokoch/fastcopy
    Benchmark results are in the README
    bors committed May 29, 2018
    Configuration menu
    Copy the full SHA
    ec99b22 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2018

  1. Configuration menu
    Copy the full SHA
    a4d899b View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#50783 - pnkfelix:issue-27282-match-borrows-it…

    …s-input-take-three, r=nikomatsakis
    
    every match arm reads the match's borrowed input
    
    This PR changes the `match` codegen under NLL (and just NLL, at least for now) to make the following adjustments:
     * It adds a `-Z disable-ast-check-for-mutation-in-guard` which, as described, turns off the naive (conservative but also not 100% sound) check for mutation in guards of match arms.
     * We now borrow the match input at the outset and emit a special `ReadForMatch` statement (that, according to the *static* semantics, reads that borrowed match input) at the start of each match arm. The intent here is to catch cases where the match guard mutates the match input, either via an independent borrow or via `ref mut` borrows in that arm's pattern.
     * In order to ensure that `ref mut` borrows do not actually conflict with the emitted `ReadForMatch` statements, I expanded the two-phase-borrow system slightly, and also changed the MIR code gen so that under NLL, when there is a guard on a match arm, then each pattern variable ends up having *three* temporaries associated with it:
       1. The first temporary will hold the substructure being matched; this is what we will move the (substructural) value into *if* the guard succeeds.
       2. The second temporary also corresponds to the same value as the first, but we are just constructing this temporarily for use during the scope of the guard; it is unaliased and its sole referrer is the third temporary.
       3. The third temporary is a reference to the second temporary.
       * (This sounds complicated, I know, but its actually *simpler* than what I was doing before and had checked into the repo, which was to sometimes construct the final value and then take a reference to it before evaluating the guard. See also PR rust-lang#49870.)
    
    Fix rust-lang#27282
    
    This also provides a path towards resolving rust-lang#24535 aka rust-lang/rfcs#1006, at least once the `-Z disable-ast-check-for-mutation-in-guard` is just turned on by default (under NLL, that is. It is not sound under AST-borrowck).
     * But I did not want to make `#![feature(nll)]` imply that as part of this PR; that seemed like too drastic a change to me.
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    8372e7b View commit details
    Browse the repository at this point in the history
  3. fs: copy: Use File::set_permissions instead of fs::set_permissions

    We already got the open file descriptor at this point.
    Don't make the kernel resolve the path again.
    nicokoch committed May 30, 2018
    Configuration menu
    Copy the full SHA
    9b6940d View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#51017 - estebank:crate-name-in-path, r=michae…

    …lwoerister
    
    Use crate name for reexported `extern crate` paths
    
    Fix rust-lang#43189.
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    2408095 View commit details
    Browse the repository at this point in the history
  5. Auto merge of rust-lang#51106 - davidtwco:issue-50934, r=nikomatsakis

    Optimize the way that loans are killed in borrowck dataflow
    
    Fixes rust-lang#50934.
    r? @nikomatsakis
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    20af72b View commit details
    Browse the repository at this point in the history
  6. Remobve unused import

    nicokoch committed May 30, 2018
    Configuration menu
    Copy the full SHA
    c5ee3b6 View commit details
    Browse the repository at this point in the history
  7. Auto merge of rust-lang#50880 - glandium:oom, r=SimonSapin

    OOM handling changes
    
    As discussed in rust-lang#49668 (comment) and subsequent.
    
    This does have codegen implications. Even without the hooks, and with a handler that ignores the arguments, the compiler doesn't eliminate calling `rust_oom` with the `Layout`. Even if it managed to eliminate that, with the hooks, I don't know if the compiler would be able to figure out it can skip it if the hook is never set.
    
    A couple implementation notes:
    - I went with explicit enums rather than bools because it makes it clearer in callers what is being requested.
    - I didn't know what `feature` to put the hook setting functions behind. (and surprisingly, the compile went through without any annotation on the functions)
    - There's probably some bikeshedding to do on the naming.
    
    Cc: @SimonSapin, @sfackler
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    4f99f37 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1402a10 View commit details
    Browse the repository at this point in the history
  9. Replace libbacktrace with a submodule

    While we're at it update the `backtrace` crate from crates.io. It turns out that
    the submodule's configure script has gotten a lot more finnicky as of late so
    also switch over to using the `cc` crate manually which allows to avoid some
    hacks around the configure script as well
    alexcrichton committed May 30, 2018
    Configuration menu
    Copy the full SHA
    7c14a54 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#50955 - steveklabnik:update-libbacktrace, r=a…

    …lexcrichton
    
    Update libbacktrace
    
    We haven't updated libbacktrace in two years. This is just blindly updating to the latest HEAD; I'd like to see what travis says. It at least builds on my machine, running some tests...
    
    This perpetuates the patches from rust-lang#30908
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    74d0939 View commit details
    Browse the repository at this point in the history
  11. Suggest using as_ref on some borrow errors [hack]

    When encountering the following code:
    
    ```rust
    struct Foo;
    fn takes_ref(_: &Foo) {}
    let ref opt = Some(Foo);
    
    opt.map(|arg| takes_ref(arg));
    ```
    
    Suggest using `opt.as_ref().map(|arg| takes_ref(arg));` instead.
    
    This is a stop gap solution until we expand typeck to deal with these
    cases in a more graceful way.
    estebank committed May 30, 2018
    Configuration menu
    Copy the full SHA
    a19a03a View commit details
    Browse the repository at this point in the history
  12. Auto merge of rust-lang#51100 - estebank:as-ref, r=oli-obk

    Suggest using `as_ref` on some borrow errors [hack]
    
    When encountering the following code:
    
    ```rust
    struct Foo;
    fn takes_ref(_: &Foo) {}
    let ref opt = Some(Foo);
    
    opt.map(|arg| takes_ref(arg));
    ```
    
    Suggest using `opt.as_ref().map(|arg| takes_ref(arg));` instead.
    
    This is a stop gap solution until we expand typeck to deal with these
    cases in a more graceful way.
    
    rust-lang#43861
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    fddb46e View commit details
    Browse the repository at this point in the history
  13. Add polonius compare mode

    spastorino committed May 30, 2018
    Configuration menu
    Copy the full SHA
    9df0a41 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a1433f2 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    5c76b64 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    85d44c4 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    ca1ac6b View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    b10c157 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0895590 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    3da186b View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    6c53972 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    06d88cd View commit details
    Browse the repository at this point in the history
  23. Add compare-mode to x.py

    spastorino committed May 30, 2018
    Configuration menu
    Copy the full SHA
    b970fee View commit details
    Browse the repository at this point in the history
  24. Run rustfmt

    spastorino committed May 30, 2018
    Configuration menu
    Copy the full SHA
    b39a1d6 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    cb2a0d6 View commit details
    Browse the repository at this point in the history
  26. reset the "anonymous lifetime mode" for parenthesized where clauses

    Background:
    
    The anonymous lifetime mode is used to prohibit elided lifetimes where
    they didn't used to be permitted, and instead require that `'_` be
    used. For example:
    
    ```rust
    impl Trait for Ref<T> { .. }
    //             ^^^^^^ ERROR: should be `Ref<'_, T>`
    ```
    
    When we are parsing the parts of the impl header, we enter into an
    alternate mode called `CreateParameter`. In this mode, we give an
    error for things like `Ref<T>`, but for elided lifetimes in a
    reference type like `&T` we make the elided lifetime into an in-band
    lifetime:
    
    https://github.com/rust-lang/rust/blob/4f99f37b7e213d69a489884f651adfc6d217cef5/src/librustc/hir/lowering.rs#L4017-L4035
    
    This was not intended to change behavior because we only enter into
    that mode in contexts where elision was not historically
    permitted. However, the problem is that we fail to reset the mode when
    we enter into bounds like `Fn(&u32)`, where elision *was* allowed --
    the same occurs for fn types like `fn(&u32`). This PR restores the
    original mode in those contexts.
    nikomatsakis committed May 30, 2018
    Configuration menu
    Copy the full SHA
    9acb351 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    da69bbc View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    345e7c3 View commit details
    Browse the repository at this point in the history
  29. mod.rs isn't beautiful

    uuttff8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    d6b8c67 View commit details
    Browse the repository at this point in the history
  30. Auto merge of rust-lang#51215 - eddyb:visit-for-a-lifetime, r=nikomat…

    …sakis
    
     rustc: don't visit lifetime parameters through visit_lifetime.
    
    Ideally we'd also not use the `Lifetime` struct for parameters, but I'll leave that to @varkor (rust-lang#48149).
    Fixes rust-lang#51185 (discovered while auditing all the `visit_lifetime` implementations).
    r? @nikomatsakis
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    5d0631a View commit details
    Browse the repository at this point in the history
  31. Auto merge of rust-lang#51138 - spastorino:add-polonius-compare-mode,…

    … r=pnkfelix
    
    Add polonius compare mode
    
    **This is now ready to review/merge**
    bors committed May 30, 2018
    Configuration menu
    Copy the full SHA
    e1eed38 View commit details
    Browse the repository at this point in the history
  32. Remove ObligationForest::cache_list.

    It's never used in a meaningful way.
    nnethercote committed May 30, 2018
    Configuration menu
    Copy the full SHA
    f46d021 View commit details
    Browse the repository at this point in the history
  33. Inline NodeIndex methods.

    Because they are small and hot.
    nnethercote committed May 30, 2018
    Configuration menu
    Copy the full SHA
    a5ffcf6 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2018

  1. Auto merge of rust-lang#51220 - nikomatsakis:issue-51008-false-positi…

    …ve-lifetime-must-be-declared, r=cramertj
    
    reset anonymous-lifetime-mode as we enter `()` scopes
    
    Background:
    
    The anonymous lifetime mode is used to prohibit elided lifetimes where
    they didn't used to be permitted, and instead require that `'_` be
    used. For example:
    
    ```rust
    impl Trait for Ref<T> { .. }
    //             ^^^^^^ ERROR: should be `Ref<'_, T>`
    ```
    
    When we are parsing the parts of the impl header, we enter into an alternate mode called `CreateParameter`. In this mode, we give an error for things like `Ref<T>`, but for elided lifetimes in a reference type like `&T` we make the elided lifetime into an in-band lifetime:
    
    https://github.com/rust-lang/rust/blob/4f99f37b7e213d69a489884f651adfc6d217cef5/src/librustc/hir/lowering.rs#L4017-L4035
    
    This was not intended to change behavior because we only enter into that mode in contexts where elision was not historically permitted. However, the problem is that we fail to reset the mode when we enter into bounds like `Fn(&u32)`, where elision *was* allowed -- the same occurs for fn types like `fn(&u32`). This PR restores the original mode in those contexts.
    
    Fixes rust-lang#51008
    
    r? @cramertj
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    c1287c0 View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#51145 - petrochenkov:npbot, r=alexcrichton

    resolve: Make sure indeterminate and inconsistent macro resolutions always generate errors
    
    Addresses the issue described in rust-lang#50911 (comment)
    
    I haven't come up with a minimized reproduction yet, but confirmed that `npbot` now generates the correct error with `![feature(use_extern_macros)]`.
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    e38554c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1c883d6 View commit details
    Browse the repository at this point in the history
  4. Tweak identifer lexing.

    By calling `bump()` after getting the first char, to avoid a redundant
    `ident_continue()` test on it.
    nnethercote committed May 31, 2018
    Configuration menu
    Copy the full SHA
    3af6291 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5adba8e View commit details
    Browse the repository at this point in the history
  6. Auto merge of rust-lang#51127 - frewsxcv:frewsxcv-discriminant, r=Gui…

    …llaumeGomez
    
    Add doc link from discriminant struct to function.
    
    None
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    a47b2d0 View commit details
    Browse the repository at this point in the history
  7. Update the miri submodule

    oli-obk committed May 31, 2018
    Configuration menu
    Copy the full SHA
    e9b6355 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    665866d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1236d57 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8230133 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0347494 View commit details
    Browse the repository at this point in the history
  12. Update miri submodule

    oli-obk committed May 31, 2018
    Configuration menu
    Copy the full SHA
    0639451 View commit details
    Browse the repository at this point in the history
  13. Auto merge of rust-lang#51182 - eddyb:not-just-visibility, r=nikomats…

    …akis
    
    [MIR] Change "scopes" from "visibility scopes" to "source scopes".
    
    These scopes are already used for source-oriented diagnostics, lint levels and unsafety checks.
    This PR generalizes the naming around scopes, making the type `SourceScope`, and flips (across several commits) the relationship/priority between `LocalDecl`'s "visibility" and "syntactic" scopes.
    
    r? @nikomatsakis
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    30cae58 View commit details
    Browse the repository at this point in the history
  14. Auto merge of rust-lang#51203 - nnethercote:obligations-2, r=michaelw…

    …oerister
    
    Two minor `obligation_forest` tweaks.
    
    Pretty minimal improvements, but improvements nonetheless.
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    ae2f299 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    72ab4b4 View commit details
    Browse the repository at this point in the history
  16. change PointerKind::Implicit to a note

    `PointerKind` is included in `LoanPath` and hence forms part of the
    equality check; this led to having two unequal paths that both
    represent `*x`, depending on whether the `*` was inserted
    automatically or explicitly. Bad mojo. The `note` field, in contrast,
    is intended more-or-less primarily for this purpose of adding extra
    data.
    nikomatsakis committed May 31, 2018
    Configuration menu
    Copy the full SHA
    8a624b7 View commit details
    Browse the repository at this point in the history
  17. typeck: Do not pass the field check on field error

    If a struct pattern has a field error return an error.
    dlrobertson committed May 31, 2018
    Configuration menu
    Copy the full SHA
    8f64415 View commit details
    Browse the repository at this point in the history
  18. Auto merge of rust-lang#51235 - nikomatsakis:issue-51117-borrowck-imp…

    …licit-deref, r=eddyb
    
    remove notion of Implicit derefs from mem-cat
    
    `PointerKind` is included in `LoanPath` and hence forms part of the equality check; this led to having two unequal paths that both represent `*x`, depending on whether the `*` was inserted automatically or explicitly. Bad mojo.
    
    Fixes rust-lang#51117
    
    r? @eddyb
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    6de4ec6 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    376b640 View commit details
    Browse the repository at this point in the history
  20. Add test for intrinsics::bswap

    faern committed May 31, 2018
    Configuration menu
    Copy the full SHA
    12c330c View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    0d7d5e9 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    8dec03b View commit details
    Browse the repository at this point in the history
  23. Rename bytes -> bits

    faern committed May 31, 2018
    Configuration menu
    Copy the full SHA
    8939fe6 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    97a0d46 View commit details
    Browse the repository at this point in the history
  25. Auto merge of rust-lang#51050 - symphorien:fstatat, r=kennytm

    std::fs::DirEntry.metadata(): use fstatat instead of lstat when possible
    
    When reading a directory with `read_dir`, querying metadata for a resulting `DirEntry` is done by building the whole path and then `lstat`ing it, which requires the kernel to resolve the whole path. Instead, one
    can use the file descriptor to the enumerated directory and use `fstatat`. This make the resolving step
    unnecessary.
    This PR implements using `fstatat` on linux, android and emscripten.
    
    ## Compatibility across targets
    `fstatat` is POSIX.
    * Linux >= 2.6.19 according to https://linux.die.net/man/2/fstatat
    * android according to https://android.googlesource.com/platform/bionic/+/master/libc/libc.map.txt#392
    * emscripten according to https://github.com/kripken/emscripten/blob/7f89560101843198787530731f40a65288f6f15f/system/include/libc/sys/stat.h#L76
    
    The man page says "A similar system call exists on Solaris." but I haven't found it.
    
    ## Compatibility with old platforms
    This was introduced with glibc 2.4 according to the man page. The only information I could find about the minimal version of glibc rust must support is this discussion https://internals.rust-lang.org/t/bumping-glibc-requirements-for-the-rust-toolchain/5111/10
    The conclusion, if I understand correctly, is that currently rust supports glibc >= 2.3.4 but the "real" requirement is Centos 5 with glibc 2.5. This PR would make the minimal version 2.4, so this should be fine.
    
    ## Benefit
    I did the following silly benchmark:
    ```rust
    use std::io;
    use std::fs;
    use std::os::linux::fs::MetadataExt;
    use std::time::Instant;
    
    fn main() -> Result<(), io::Error> {
        let mut n = 0;
        let mut size = 0;
        let start = Instant::now();
        for entry in fs::read_dir("/nix/store/.links")? {
            let entry = entry?;
            let stat = entry.metadata()?;
            size += stat.st_size();
            n+=1;
        }
        println!("{} files, size {}, time {:?}", n, size, Instant::now().duration_since(start));
        Ok(())
    }
    ```
    On warm cache, with current rust nightly:
    ```
    1014099 files, size 76895290022, time Duration { secs: 2, nanos: 65832118 }
    ```
    (between 2.1 and 2.9 seconds usually)
    With this PR:
    ```
    1014099 files, size 76895290022, time Duration { secs: 1, nanos: 581662953 }
    ```
    (1.5 to 1.6 seconds usually).
    
    approximately 40% faster :)
    
    On cold cache there is not much to gain because path lookup (which we spare) would have been a cache hit:
    Before
    ```
    1014099 files, size 76895290022, time Duration { secs: 391, nanos: 739874992 }
    ```
    After
    ```
    1014099 files, size 76895290022, time Duration { secs: 388, nanos: 431567396 }
    ```
    ## Testing
    The tests were run on linux `x86_64`
    ```
    python x.py test src/tools/tidy
    ./x.py test src/libstd
    ```
    and the above benchmark.
    I did not test any other target.
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    5342d40 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    177337d View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    426b63f View commit details
    Browse the repository at this point in the history
  28. Update build instructions

    akoserwal committed May 31, 2018
    Configuration menu
    Copy the full SHA
    bad9fef View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    b83daea View commit details
    Browse the repository at this point in the history
  30. Rollup merge of rust-lang#49546 - GuillaumeGomez:stabilize-short-erro…

    …r-format, r=oli-obk
    
    Stabilize short error format
    
    r? @oli-obk
    
    Added in rust-lang#44636
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    0345dac View commit details
    Browse the repository at this point in the history
  31. Rollup merge of rust-lang#51123 - akoserwal:master, r=Mark-Simulacrum

    Update build instructions
    
    It get stuck at the cloning step.
    `./x.py build `
    Updating only changed submodules
    Updating submodule src/llvm
    Submodule 'src/llvm' (https://github.com/rust-lang/llvm.git) registered for path 'src/llvm'
    Cloning into '/home/username/rust/src/llvm'...
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    2f0e3d3 View commit details
    Browse the repository at this point in the history
  32. Rollup merge of rust-lang#51146 - dlrobertson:fix_51102, r=estebank

    typeck: Do not pass the field check on field error
    
    If a struct pattern has a field error return an error.
    
    Fixes: rust-lang#51102
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    a729d97 View commit details
    Browse the repository at this point in the history
  33. Rollup merge of rust-lang#51193 - GuillaumeGomez:fixes-style-issues, …

    …r=QuietMisdreavus
    
    Fixes some style issues in rustdoc "implementations on Foreign types"
    
    Fixes rust-lang#51113.
    
    r? @QuietMisdreavus
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    8efecc1 View commit details
    Browse the repository at this point in the history
  34. Rollup merge of rust-lang#51213 - nicokoch:copy_permissions, r=cramertj

    fs: copy: Use File::set_permissions instead of fs::set_permissions
    
    We already got the open file descriptor at this point.
    Don't make the kernel resolve the path again.
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    af4acbe View commit details
    Browse the repository at this point in the history
  35. Rollup merge of rust-lang#51227 - uuttff8:master, r=dtolnay

    mod.rs isn't beautiful
    
    I hate this spaces.
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    33ad846 View commit details
    Browse the repository at this point in the history
  36. Rollup merge of rust-lang#51240 - nnethercote:parse-2, r=nikomatsakis

    Two minor parsing tweaks
    GuillaumeGomez committed May 31, 2018
    Configuration menu
    Copy the full SHA
    7552c2e View commit details
    Browse the repository at this point in the history
  37. Add implementations for Any + Send + Sync

    Implement `is`, `downcast_ref`, `downcast_mut` and `Debug` for
    `Any + Send + Sync`.
    jsgf committed May 31, 2018
    Configuration menu
    Copy the full SHA
    72433e1 View commit details
    Browse the repository at this point in the history
  38. Implement downcast for Arc<Any + Send + Sync>

    We only need to implement it for `Any + Send + Sync` because in practice
    that's the only useful combination for `Arc` and `Any`.
    
    Implementation for rust-lang#44608 under the `rc_downcast` feature.
    jsgf committed May 31, 2018
    Configuration menu
    Copy the full SHA
    37f5cf5 View commit details
    Browse the repository at this point in the history
  39. Update Arc and Rc to use NonNull::cast to cast the inner pointers

    This avoids an `unsafe` block in each case.
    jsgf committed May 31, 2018
    Configuration menu
    Copy the full SHA
    0c7bf56 View commit details
    Browse the repository at this point in the history
  40. Fix up Any doc examples

    Make the Any+Send+Sync examples use the right trait bounds, and fix a small whitespace issue.
    jsgf committed May 31, 2018
    Configuration menu
    Copy the full SHA
    87c3d7b View commit details
    Browse the repository at this point in the history
  41. Auto merge of rust-lang#51257 - GuillaumeGomez:rollup, r=GuillaumeGomez

    Rollup of 7 pull requests
    
    Successful merges:
    
     - rust-lang#49546 (Stabilize short error format)
     - rust-lang#51123 (Update build instructions)
     - rust-lang#51146 (typeck: Do not pass the field check on field error)
     - rust-lang#51193 (Fixes some style issues in rustdoc "implementations on Foreign types")
     - rust-lang#51213 (fs: copy: Use File::set_permissions instead of fs::set_permissions)
     - rust-lang#51227 (mod.rs isn't beautiful)
     - rust-lang#51240 (Two minor parsing tweaks)
    
    Failed merges:
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    1ffb321 View commit details
    Browse the repository at this point in the history
  42. Auto merge of rust-lang#51096 - matthewjasper:reverse-normalization-b…

    …ounds, r=nikomatsakis
    
    Register outlives predicates from queries the right way around.
    
    Closes rust-lang#49354
    The region constraints from queries need to be reversed from sub to outlives.
    
    Note: wf checking reports these errors before NLL, so I'm not sure if there's any case when these predicates need to be created at all.
    
    cc @nikomatsakis
    bors committed May 31, 2018
    Configuration menu
    Copy the full SHA
    efc508b View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    32dcaab View commit details
    Browse the repository at this point in the history
  44. Make the OOM hook return () rather than !

    Per discussion in rust-lang#51245 (comment)
    
    This allows more flexibility in what can be done with the API. This also
    splits `rtabort!` into `dumb_print` happening in the default hook and
    `abort_internal`, happening in the actual oom handler after calling the
    hook. Registering an empty function thus makes the oom handler not print
    anything but still abort.
    
    Cc: @alexcrichton
    glandium committed May 31, 2018
    Configuration menu
    Copy the full SHA
    b945be7 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2018

  1. Auto merge of rust-lang#50836 - jsgf:arc-downcast, r=SimonSapin

    Arc downcast
    
    Implement `downcast` for `Arc<Any + Send + Sync>` as part of rust-lang#44608, and gated by the same `rc_downcast` feature.
    
    This PR is mostly lightly-edited cut'n'paste.
    
    This has two additional changes:
    - The `downcast` implementation needs `Any + Send + Sync` implementations for `is` and `Debug`, and I added `downcast_ref` and `downcast_mut` for completeness/consistency. (Can these be insta-stabilized?)
    - At @SimonSapin's suggestion, I converted `Arc` and `Rc` to use `NonNull::cast` to avoid an `unsafe` block in each which tidied things up nicely.
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    b7a9d4e View commit details
    Browse the repository at this point in the history
  2. Replace if with if and only if in the definition dox of Sync

    The old text was: "The precise definition is: a type T is Sync if &T is Send."
    
    Since we've also got
    ```
    impl<'a, T> Send for &'a T 
    where
        T: Sync + ?Sized,
    ```
    I purpose we can change the `if` to `if and only if` to make it more precise.
    crlf0710 committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    8e90a2d View commit details
    Browse the repository at this point in the history
  3. Auto merge of rust-lang#51171 - faern:const-bswap-ctpop-cttz-ctlz, r=…

    …oli-obk
    
    Make some std::intrinsics `const fn`s
    
    Making some rustc intrinsics (`ctpop`, `cttz`, `ctlz` and `bswap`) `const fn`s.
    
    This is a pre-step to being able to make `swap_bytes`, `to_be` and `from_be` constant functions. That in itself could be ergonomic and useful. But even better is that it would allow `Ipv4Addr::new` etc becoming `const fn`s as well. Which might be really useful since I find it quite common to want to define them as constants.
    
    r? @oli-obk
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    63cd4a3 View commit details
    Browse the repository at this point in the history
  4. Auto merge of rust-lang#51225 - oli-obk:miri_oob_ptr, r=eddyb

    Fix the miri submodule
    
    cc @bjorn3
    
    r? @eddyb
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    1dcda69 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2c3eff9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f9f90ed View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    24dfcbe View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    22f6163 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    12e8359 View commit details
    Browse the repository at this point in the history
  10. Auto merge of rust-lang#51060 - michaelwoerister:thread-safe-consts, …

    …r=Zoxc
    
    Make const decoding thread-safe.
    
    This is an alternative to rust-lang#50957. It's a proof of concept (e.g. it doesn't adapt metadata decoding, just the incr. comp. cache) but I think it turned out nice. It's rather simple and does not require passing around a bunch of weird closures, like we currently do.
    
    If you (@Zoxc & @oli-obk) think this approach is good then I'm happy to finish and clean this up.
    
    Note: The current version just spins when it encounters an in-progress decoding. I don't have a strong preference for this approach. Decoding concurrently is equally fine by me (or maybe even better because it doesn't require poisoning).
    
    r? @Zoxc
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    4412902 View commit details
    Browse the repository at this point in the history
  11. Auto merge of rust-lang#51181 - mbrubeck:prelude, r=petrochenkov

    Add std/core to prelude if extern_prelude enabled
    
    Fixes rust-lang#50605
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    577a5b2 View commit details
    Browse the repository at this point in the history
  12. Remove feature flag from fs::read_to_string example

    This is stable, and so no longer needed
    steveklabnik committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    48bd07e View commit details
    Browse the repository at this point in the history
  13. Fix OneThread

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    d6c63ec View commit details
    Browse the repository at this point in the history
  14. Fix optimization_fuel

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    9eb4f73 View commit details
    Browse the repository at this point in the history
  15. Ensure ImplicitCtxt is Sync

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    85acb1d View commit details
    Browse the repository at this point in the history
  16. Update recursion limits

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    b7aabaa View commit details
    Browse the repository at this point in the history
  17. Add a WorkerLocal abstraction

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    969296b View commit details
    Browse the repository at this point in the history
  18. Have worker-local GlobalArenas

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    d402d2d View commit details
    Browse the repository at this point in the history
  19. Assert that GlobalCtxt is Sync

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    c6dbb14 View commit details
    Browse the repository at this point in the history
  20. Update Cargo.lock

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    461fa84 View commit details
    Browse the repository at this point in the history
  21. Add Sync impl for Slice

    Zoxc committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    2119d04 View commit details
    Browse the repository at this point in the history
  22. Auto merge of rust-lang#51264 - glandium:oom, r=alexcrichton

    Make the OOM hook return `()` rather than `!`
    
    Per discussion in rust-lang#51245 (comment)
    
    This allows more flexibility in what can be done with the API. This also
    splits `rtabort!` into `dumb_print` happening in the default hook and
    `abort_internal`, happening in the actual oom handler after calling the
    hook. Registering an empty function thus makes the oom handler not print
    anything but still abort.
    
    Cc: @alexcrichton
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    f913231 View commit details
    Browse the repository at this point in the history
  23. optimize joining and concatenation for slices

    for both Vec<T> and String
    - eliminates the boolean first flag in fn join()
    
    for String only
    - eliminates repeated bounds checks in join(), concat()
    - adds fast paths for small string separators up to a len of 4 bytes
    Emerentius committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    d866082 View commit details
    Browse the repository at this point in the history
  24. add more join tests

    old tests cover the new fast path of str joining already
    this adds tests for joining into Strings with long separators (>4 byte) and
    for joining into Vec<T>, T: Clone + !Copy. Vec<T: Copy> will be
    specialised when specialisation type inference bugs are fixed.
    Emerentius committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    b2fd7da View commit details
    Browse the repository at this point in the history
  25. compacts join code

    Emerentius committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    d0d0885 View commit details
    Browse the repository at this point in the history
  26. incorporate changes from code review

    further reduce unsafe fn calls
    reduce right drift
    assert! sufficient capacity
    Emerentius committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    12bd288 View commit details
    Browse the repository at this point in the history
  27. Auto merge of rust-lang#50340 - Emerentius:master, r=alexcrichton

    optimize joining for slices
    
    This improves the speed of string joining up to 3x.
    It removes the boolean flag check every iteration, eliminates repeated bounds checks and adds a fast paths for small separators up to a len of 4 bytes
    These optimizations gave me ~10%, ~50% and ~80% improvements respectively over the previous speed. Those are multiplicative.
    
    3x improvement happens for the optimal case of joining many small strings together in my microbenchmarks. Improvements flatten out for larger strings of course as more time is spent copying bits around. I've run a few benchmarks [with this code](https://github.com/Emerentius/join_bench). They are pretty noise despite high iteration counts, but in total one can see the trends.
    
    ```
    len_separator  len_string   n_strings     speedup
               4          10          10        2.38
               4          10         100        3.41
               4          10        1000        3.43
               4          10       10000        3.25
               4         100          10        2.23
               4         100         100        2.73
               4         100        1000        1.33
               4         100       10000        1.14
               4        1000          10        1.33
               4        1000         100        1.15
               4        1000        1000        1.08
               4        1000       10000        1.04
              10          10          10        1.61
              10          10         100        1.74
              10          10        1000        1.77
              10          10       10000        1.75
              10         100          10        1.58
              10         100         100        1.65
              10         100        1000        1.24
              10         100       10000        1.12
              10        1000          10        1.23
              10        1000         100        1.11
              10        1000        1000        1.05
              10        1000       10000       0.997
             100          10          10        1.66
             100          10         100        1.78
             100          10        1000        1.28
             100          10       10000        1.16
             100         100          10        1.37
             100         100         100        1.26
             100         100        1000        1.09
             100         100       10000         1.0
             100        1000          10        1.19
             100        1000         100        1.12
             100        1000        1000        1.05
             100        1000       10000        1.12
    ```
    
    The string joining with small or empty separators is now ~50% faster than the old concatenation (small strings). The same approach can also improve the performance of joining into vectors.
    
    If this approach is acceptable, I can apply it for concatenation and for vectors as well. Alternatively, concat could just call `.join("")`.
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    747e655 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    c6bebf4 View commit details
    Browse the repository at this point in the history
  29. Auto merge of rust-lang#51163 - Amanieu:hashmap_layout, r=SimonSapin

    Simplify HashMap layout calculation by using Layout
    
    `RawTable` uses a single allocation to hold both the array of hashes and the array of key/value pairs. This PR changes `RawTable` to use `Layout` when calculating the amount of memory to allocate instead of performing the calculation manually.
    
    r? @SimonSapin
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    aa094a4 View commit details
    Browse the repository at this point in the history
  30. Auto merge of rust-lang#50108 - Zoxc:sync-gcx, r=mw

    Make GlobalCtxt thread-safe
    
    r? @michaelwoerister
    bors committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    bfa41f2 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    21423ec View commit details
    Browse the repository at this point in the history
  32. Rollup merge of rust-lang#51135 - estebank:sugg-7575, r=oli-obk

    Tweak output on E0599 for assoc fn used as method
    
     - Use suggestion instead of `help` when possible
     - Add primary span label
     - Remove incorrect `help` suggestion using incorrect syntax
     - Do not refer to only one possible candidate as `candidate #1`, refer to it as `the candidate`
    Mark-Simulacrum committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    361a82c View commit details
    Browse the repository at this point in the history
  33. Rollup merge of rust-lang#51152 - crlf0710:patch-1, r=kennytm

    Replace `if` with `if and only if` in the definition dox of `Sync`
    
    The old text was: "The precise definition is: a type `T` is `Sync` if `&T` is Send."
    
    Since we've also got
    ```
    impl<'a, T> Send for &'a T
    where
        T: Sync + ?Sized,
    ```
    I purpose we can change the `if` to `if and only if` to make it more precise.
    Mark-Simulacrum committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    b6013b2 View commit details
    Browse the repository at this point in the history
  34. Rollup merge of rust-lang#51262 - GuillaumeGomez:add-missing-whitespa…

    …ce, r=QuietMisdreavus
    
    Add missing whitespace in num example
    
    r? @QuietMisdreavus
    Mark-Simulacrum committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    4959cb1 View commit details
    Browse the repository at this point in the history
  35. Rollup merge of rust-lang#51272 - steveklabnik:remove_feature_flag, r…

    …=QuietMisdreavus
    
    Remove feature flag from fs::read_to_string example
    
    This is stable, and so no longer needed
    Mark-Simulacrum committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    29a4cd0 View commit details
    Browse the repository at this point in the history
  36. Rollup merge of rust-lang#51286 - Mark-Simulacrum:1.26.2-release-note…

    …s, r=Mark-Simulacrum
    
    Pull 1.26.2 release notes into master
    
    None
    Mark-Simulacrum committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    c8f9b7c View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2018

  1. Auto merge of rust-lang#51287 - Mark-Simulacrum:rollup, r=Mark-Simula…

    …crum
    
    Rollup of 5 pull requests
    
    Successful merges:
    
     - rust-lang#51135 (Tweak output on E0599 for assoc fn used as method)
     - rust-lang#51152 (Replace `if` with `if and only if` in the definition dox of `Sync`)
     - rust-lang#51262 (Add missing whitespace in num example)
     - rust-lang#51272 (Remove feature flag from fs::read_to_string example)
     - rust-lang#51286 (Pull 1.26.2 release notes into master)
    
    Failed merges:
    bors committed Jun 2, 2018
    Configuration menu
    Copy the full SHA
    5f7c9da View commit details
    Browse the repository at this point in the history
  2. Auto merge of rust-lang#51270 - nicokoch:issue-51266, r=TimNN

    fs: copy: Add EPERM to fallback error conditions
    
    Fixes rust-lang#51266
    bors committed Jun 2, 2018
    Configuration menu
    Copy the full SHA
    edae1cc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b9bf4f1 View commit details
    Browse the repository at this point in the history