Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #82235

Merged
merged 28 commits into from
Feb 17, 2021
Merged

Commits on Dec 12, 2020

  1. Add 'consider using' message to overflowing_literals

    Ironically, the overflowing_literals handler for binary or hex already
    had this message! You would think it would be the other way around :)
    camelid committed Dec 12, 2020
    Configuration menu
    Copy the full SHA
    d00ca11 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2021

  1. Configuration menu
    Copy the full SHA
    a9b16c6 View commit details
    Browse the repository at this point in the history
  2. Don't fail to remove files if they are missing

    In the backend we may want to remove certain temporary files, but in
    certain other situations these files might not be produced in the first
    place. We don't exactly care about that, and the intent is really that
    these files are gone after a certain point in the backend.
    
    Here we unify the backend file removing calls to use `ensure_removed`
    which will attempt to delete a file, but will not fail if it does not
    exist (anymore).
    
    The tradeoff to this approach is, of course, that we may miss instances
    were we are attempting to remove files at wrong paths due to some bug –
    compilation would silently succeed but the temporary files would remain
    there somewhere.
    nagisa committed Feb 14, 2021
    Configuration menu
    Copy the full SHA
    fa3621b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    845c14d View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2021

  1. Configuration menu
    Copy the full SHA
    a491f51 View commit details
    Browse the repository at this point in the history
  2. Fix test issue reference

    edward-shen committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    f856224 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a4b2faf View commit details
    Browse the repository at this point in the history
  4. Use wrapping sub

    Co-authored-by: Mara <m-ou.se@m-ou.se>
    gilescope and m-ou-se committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    17e238d View commit details
    Browse the repository at this point in the history
  5. Update methods.rs

    Remove unused const
    gilescope committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    d2ba68b View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2021

  1. Document that assert! format arguments are evaluated lazily

    It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example:
    
    ```rust
    assert!(
        some_condition,
        "The state is invalid. Details: {}",
        expensive_call_to_get_debugging_info(),
    );
    ```
    
    It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests.
    not-an-aardvark committed Feb 16, 2021
    Configuration menu
    Copy the full SHA
    cb653b1 View commit details
    Browse the repository at this point in the history
  2. Replace File::create and write_all with fs::write

    Also don't convert to u8 buffers and back
    when we are only creating strings.
    est31 committed Feb 16, 2021
    Configuration menu
    Copy the full SHA
    e527def View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a98b22c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    61bb183 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2021

  1. Configuration menu
    Copy the full SHA
    15197cb View commit details
    Browse the repository at this point in the history
  2. Update books

    ehuss committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    5715f79 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ee0e841 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c80b737 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#79981 - camelid:overflowing_literals-infere…

    …nce-error, r=lcnr
    
    Add 'consider using' message to overflowing_literals
    
    Fixes rust-lang#79744.
    
    Ironically, the `overflowing_literals` handler for binary or hex already
    had this message! You would think it would be the other way around :)
    
    cc ```@scottmcm```
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    ec00784 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#82094 - gilescope:to_digit_speedup2, r=m-ou-se

    To digit simplification
    
    I found out the other day that all the ascii digits have the first four bits as one would hope them to. (Eg. char `2` ends `0b0010`). There are two bits to indicate it's in the digit range ( `0b0011_0000`). If it is a true digit then all the higher bits aside from these two will be 0 (as ascii is the lowest part of the unicode u32 spectrum). So XORing with `0b11_0000` should mean we either get the number 0-9 or alternativly we get a larger number in the u32 space. If we get something that's not 0-9 then it will be discarded as it will be greater than the radix.
    
    The code seems so fast though that there's quite a lot of noise in the benchmarks so it's not that easy to prove conclusively that it's faster as well as less instructions.
    
    The non-fast path I was toying with as well wondering if we could do this as then we'd only have one return and less instructions still:
    ```
               match self {
                    'a'..='z' => self as u32 - 'a' as u32 + 10,
                    'A'..='Z' => self as u32 - 'A' as u32 + 10,
                    _ => { radix = 10; self as u32 ^ ASCII_DIGIT_MASK},
                }
    ```
    
    Here's the [godbolt](https://godbolt.org/z/883c9n).
    
    ( H/T to ``@byteshadow`` for pointing out xor was what I needed)
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    253631d View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#82105 - nagisa:nagisa/ensure-removed, r=pet…

    …rochenkov
    
    Don't fail to remove files if they are missing
    
    In the backend we may want to remove certain temporary files, but in
    certain other situations these files might not be produced in the first
    place. We don't exactly care about that, and the intent is really that
    these files are gone after a certain point in the backend.
    
    Here we unify the backend file removing calls to use `ensure_removed`
    which will attempt to delete a file, but will not fail if it does not
    exist (anymore).
    
    The tradeoff to this approach is, of course, that we may miss instances
    were we are attempting to remove files at wrong paths due to some bug –
    compilation would silently succeed but the temporary files would remain
    there somewhere.
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    7292d5f View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#82136 - edward-shen:mismatched-subst-and-hi…

    …r, r=lcnr
    
    Fix ICE: Use delay_span_bug for mismatched subst/hir arg
    
    Fixes rust-lang#82126.
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    13730e9 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#82169 - not-an-aardvark:assert-lazy-format-…

    …expressions, r=sfackler
    
    Document that `assert!` format arguments are evaluated lazily
    
    It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example:
    
    ```rust
    assert!(
        some_condition,
        "The state is invalid. Details: {}",
        expensive_call_to_get_debugging_info(),
    );
    ```
    
    It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests.
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    16481a2 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#82174 - est31:master, r=oli-obk

    Replace File::create and write_all with fs::write
    
    Also don't convert to u8 buffers and back
    when we are only creating strings.
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    d382771 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#82196 - Manishearth:display-caveat, r=m-ou-se

    Add caveat to Path::display() about lossiness
    
    It's worth calling out that this API may do a lossy display.
    
    r? ```@m-ou-se```
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    8e6bc14 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#82198 - SkiFire13:optimize-iter-is-sorted, …

    …r=sfackler
    
    Use internal iteration in Iterator::is_sorted_by
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    f46bd72 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#82204 - ehuss:update-books, r=ehuss

    Update books
    
    ## nomicon
    
    1 commits in bbf06ad39d1f45654047e9596b750cc6e6d1b693..adca786547d08fe676b2fc7a6f08c2ed5280ca38
    2021-01-22 07:07:31 -0800 to 2021-02-16 16:34:20 +0900
    - Merge pull request rust-lang/nomicon#254 from mdaverde/ml/adds-compiler-err-lifetimes
    
    ## reference
    
    9 commits in f02b09eb6e8af340ad1256a54adb7aae2ff3163e..361367c126290ac17cb4089f8d38fd8b2ac43f98
    2021-01-22 01:53:02 -0800 to 2021-02-15 09:58:13 -0800
    - Define turbofish in the glossary (rust-lang/reference#964)
    - Remove enum variant expr (rust-lang/reference#963)
    - One sentence is one line src/expressions/* (rust-lang/reference#962)
    - Referencify bool type (rust-lang/reference#940)
    - Fix typo in type cast expression table (rust-lang/reference#959)
    - Define rust (rust-lang/reference#953)
    - Remove "Memory Ownership" chapter (rust-lang/reference#952)
    - Added setting nightly as a requirement for running tests (rust-lang/reference#955)
    - Refactored build steps for better readability (rust-lang/reference#936)
    
    ## book
    
    13 commits in e724bd826580ff95df48a8533af7dec1080693d4..db5e8a5105aa22979490dce30e33b68d8645761d
    2021-01-20 08:19:49 -0600 to 2021-02-12 16:58:20 -0500
    - Update to Rust 1.50
    - Fix issue rust-lang/book#2574 - Improve the explanation about the behaviour of `read_line`. (rust-lang/book#2575)
    - closures: replace "is called" with "is defined" (rust-lang/book#2556)
    - Minor clarification: types -&gt; values in ch16-04 (rust-lang/book#2587)
    - fixed hidden code listing (rust-lang/book#2610)
    - Merge remote-tracking branch 'origin/pr/2604'
    -  (rust-lang/book#2601)
    - Merge remote-tracking branch 'origin/pr/2589'
    - Fix text wrapping
    - Some small rewordings I noticed while rereading just now
    -  (rust-lang/book#2592)
    - Removed 'of' between type alias in Ch 19-04. (rust-lang/book#2581)
    - Merge remote-tracking branch 'origin/pr/2554'
    
    ## rust-by-example
    
    2 commits in f633769acef68574427a6fae6c06f13bc2199573..551cc4bc8394feccea6acd21f86d9a4e1d2271a0
    2021-01-13 20:58:25 -0300 to 2021-02-03 17:12:37 -0300
    - remove // (rust-lang/rust-by-example#1409)
    - Update arc.md (rust-lang/rust-by-example#1406)
    
    ## edition-guide
    
    3 commits in b91a9a881ee007c12e74e844460ec407cf07a50f..1da3c411f17adb1ba5de1683bb6acee83362b54a
    2020-11-02 11:02:03 -0600 to 2021-02-16 16:46:40 -0800
    - Update link for no_std. (rust-lang/edition-guide#231)
    - Add git link to the source. (rust-lang/edition-guide#228)
    - Update musl libc link (rust-lang/edition-guide#230)
    
    ## embedded-book
    
    1 commits in ceec19e873be87c6ee5666b030c6bb612f889a96..4cf7981696a85c3e633076c6401611bd3f6346c4
    2021-01-03 13:13:10 +0000 to 2021-02-11 10:55:22 +0000
    - Fix installing dateutil since it is now a dependency of the GHP import script  (rust-embedded/book#282)
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    086342c View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#82207 - ehuss:rustdoc-2021, r=jyn514

    rustdoc: treat edition 2021 as unstable
    
    This ensures that `--edition=2021` requires `-Z unstable-options` in rustdoc.
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    f97e112 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#82231 - jesusprubio:add-long-explanation-e0…

    …543, r=GuillaumeGomez
    
    Add long explanation for E0543
    
    Helps with rust-lang#61137
    GuillaumeGomez committed Feb 17, 2021
    Configuration menu
    Copy the full SHA
    03477e9 View commit details
    Browse the repository at this point in the history