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 12 pull requests #82430

Merged
merged 50 commits into from
Feb 23, 2021
Merged

Rollup of 12 pull requests #82430

merged 50 commits into from
Feb 23, 2021

Commits on Jan 21, 2021

  1. Improve suggestion for tuple struct pattern matching errors.

    Currently, when a user uses a struct pattern to pattern match on
    a tuple struct, the errors we emit generally suggest adding fields
    using their field names, which are numbers. However, numbers are
    not valid identifiers, so the suggestions, which use the shorthand
    notation, are not valid syntax. This commit changes those errors
    to suggest using the actual tuple struct pattern syntax instead,
    which is a more actionable suggestion.
    reese committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    8a83c8f View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2021

  1. Configuration menu
    Copy the full SHA
    f165f49 View commit details
    Browse the repository at this point in the history
  2. Pulling out constant.

    gilescope committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    f30c51a View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2021

  1. Enable smart punctuation

    camelid committed Feb 8, 2021
    Configuration menu
    Copy the full SHA
    a0f9d4b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f1581ed View commit details
    Browse the repository at this point in the history
  3. Document smart punctuation

    camelid committed Feb 8, 2021
    Configuration menu
    Copy the full SHA
    e4b83fc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cadcf5e View commit details
    Browse the repository at this point in the history
  5. Fix @has checks "no closing quotation" error

    Apparently `"foo\""` has different behavior from `'foo\''` in Python
    shlex. See the [discussion on Zulip][z] for more.
    
    [z]: https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.40has.20checks.20.22no.20closing.20quotation.22
    camelid committed Feb 8, 2021
    Configuration menu
    Copy the full SHA
    0a34521 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2021

  1. Update Markdown unit tests

    camelid committed Feb 9, 2021
    Configuration menu
    Copy the full SHA
    1b29b29 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2021

  1. Make WASI's hard_link behavior match other platforms.

    Following rust-lang#78026, `std::fs::hard_link` on most platforms does not follow
    symlinks. Change the WASI implementation to also not follow symlinks.
    sunfishcode committed Feb 11, 2021
    Configuration menu
    Copy the full SHA
    0060c91 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2021

  1. Slightly more explicit

    gilescope committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    daa55ac View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2021

  1. Improve design of assert_len

    dylni committed Feb 13, 2021
    Configuration menu
    Copy the full SHA
    9d29793 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb647f3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f6111a2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5d519ea View commit details
    Browse the repository at this point in the history
  5. Update new usage of assert_len

    dylni committed Feb 13, 2021
    Configuration menu
    Copy the full SHA
    fe4fe19 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2021

  1. Configuration menu
    Copy the full SHA
    eace240 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7879099 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    33d8b04 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2021

  1. add diagnostic items

    Add diagnostic items to the following types:
      OsString (os_string_type)
      PathBuf (path_buf_type)
      Owned (to_owned_trait)
    
    As well as the to_vec method on slice/[T]
    anall committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    5ef2025 View commit details
    Browse the repository at this point in the history
  2. requested/proposed changes

    anall committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    c6bb628 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2021

  1. update formating

    henryboisdequin committed Feb 16, 2021
    Configuration menu
    Copy the full SHA
    30c5125 View commit details
    Browse the repository at this point in the history
  2. a few more diagnostic items

    anall committed Feb 16, 2021
    Configuration menu
    Copy the full SHA
    67fcaaa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ec4b06 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2021

  1. Configuration menu
    Copy the full SHA
    eeb5552 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2021

  1. Configuration menu
    Copy the full SHA
    8ddd846 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2021

  1. Configuration menu
    Copy the full SHA
    48b5c09 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    597118b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    62ee3ec View commit details
    Browse the repository at this point in the history
  4. x.py fmt

    sunfishcode committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    1abcdfe View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2021

  1. Configuration menu
    Copy the full SHA
    a9c6188 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d8540ae View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2021

  1. Suggest returning tail expressions that match return type

    Some newcomers are confused by the behavior of tail expressions,
    interpreting that "leaving out the `;` makes it the return value".
    To help them go in the right direction, suggest using `return` instead
    when applicable.
    estebank committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    796ce9f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    020edd9 View commit details
    Browse the repository at this point in the history
  3. Do not suggest ; if expression is side effect free

    When a tail expression isn't unit, we previously always suggested adding
    a trailing `;` to turn it into a statement. This suggestion isn't
    appropriate for any expression that doesn't have side-effects, as the
    user will have likely wanted to call something else or do something with
    the resulting value, instead of just discarding it.
    estebank committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    d669882 View commit details
    Browse the repository at this point in the history
  4. tidy

    estebank committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    86b3f3f View commit details
    Browse the repository at this point in the history
  5. fix rebase

    estebank committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    fc6c19e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7bc5016 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2021

  1. Rollup merge of rust-lang#79423 - camelid:smart-punct, r=jyn514

    Enable smart punctuation
    
    Closes rust-lang#76690.
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    1c2a949 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#81154 - dylni:improve-design-of-assert-len,…

    … r=KodrAus
    
    Improve design of `assert_len`
    
    It was discussed in the [tracking issue](rust-lang#76393 (comment)) that `assert_len`'s name and usage are confusing. This PR improves them based on a suggestion by ``@scottmcm`` in that issue.
    
    I also improved the documentation to make it clearer when you might want to use this method.
    
    Old example:
    
    ```rust
    let range = range.assert_len(slice.len());
    ```
    
    New example:
    
    ```rust
    let range = range.ensure_subset_of(..slice.len());
    ```
    
    Fixes rust-lang#81157
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    72e6d51 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#81235 - reese:rw-tuple-diagnostics, r=estebank

    Improve suggestion for tuple struct pattern matching errors.
    
    Closes rust-lang#80174
    
    This change allows numbers to be parsed as field names when pattern matching on structs, which allows us to provide better error messages when tuple structs are matched using a struct pattern.
    
    r? ``@estebank``
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    8e51bd4 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#81769 - estebank:tail-expr-as-potential-ret…

    …urn, r=lcnr
    
    Suggest `return`ing tail expressions that match return type
    
    Some newcomers are confused by the behavior of tail expressions,
    interpreting that "leaving out the `;` makes it the return value".
    To help them go in the right direction, suggest using `return` instead
    when applicable.
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    5d90e89 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#81837 - gilescope:to_ascii_speedups, r=dtolnay

    Slight perf improvement on char::to_ascii_lowercase
    
    `char::to_ascii_lowercase()` was checking if it was ascii and then if it was in the right range. Instead propose to check once (I think removing a compare and a shift in the process: [godbolt](https://godbolt.org/z/e5Tora) ).
    
    before:
    ```
            test char::methods::bench_to_ascii_lowercase                    ... bench:      11,196 ns/iter (+/- 632)
            test char::methods::bench_to_ascii_uppercase                    ... bench:      11,656 ns/iter (+/- 671)
    ```
    after:
    ```
             test char::methods::bench_to_ascii_lowercase                    ... bench:       9,612 ns/iter (+/- 979)
             test char::methods::bench_to_ascii_uppercase                    ... bench:       8,241 ns/iter (+/- 701)
    ```
    
    (calling u8::to_ascii_lowercase and letting that flip the 5th bit is also an option, but it's more instructions. I'm thinking for things around ascii and char we want to be as efficient as possible.)
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    4af965e View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#81969 - jonas-schievink:no-cfg-if, r=Mark-S…

    …imulacrum
    
    Avoid `cfg_if` in `std::os`
    
    rust-analyzer cannot currently load the `cfg_if` crate, which means that rust-analyzer is unable to see `std::os::{unix, windows, linux}` here. This works around that by avoiding `cfg_if`; the `#[cfg]` expressions are simple enough to reasonably write by hand.
    
    Fixes rust-lang/rust-analyzer#6038
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    c3de8ab View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#81984 - sunfishcode:wasi-link, r=alexcrichton

    Make WASI's `hard_link` behavior match other platforms.
    
    Following rust-lang#78026, `std::fs::hard_link` on most platforms does not follow
    symlinks. Change the WASI implementation to also not follow symlinks.
    
    r? ```@alexcrichton```
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    7b9ef2f View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#82091 - henryboisdequin:use-place-ref-more,…

    … r=RalfJung
    
    use PlaceRef abstractions more consistently
    
    Addresses this [comment](https://github.com/rust-lang/rust/pull/80865/files#r558978715)
    Associated issue: rust-lang#80647
    
    r? ```@RalfJung```
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    cc07061 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#82128 - anall:feature/add_diagnostic_items,…

    … r=davidtwco
    
    add diagnostic items for OsString/PathBuf/Owned as well as to_vec on slice
    
    This is adding diagnostic items to be used by rust-lang/rust-clippy#6730, but my understanding is the clippy-side change does need to be done over there since I am adding a new clippy feature.
    
    Add diagnostic items to the following types:
      OsString (os_string_type)
      PathBuf (path_buf_type)
      Owned (to_owned_trait)
    
    As well as the to_vec method on slice/[T]
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    b8d4354 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#82166 - kaniini:s390x-musl-target, r=nagisa

    add s390x-unknown-linux-musl target
    
    This is the first step in bringup for Rust on s390x.
    
    The libc and std crates need modifications as well, but getting this upstream makes that work easier.
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    8979fd4 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#82234 - GuillaumeGomez:remove-query-param-o…

    …n-esc, r=Nemo157
    
    Remove query parameters when skipping search results
    
    Fixes rust-lang#81330.
    
    This PR changes the following: when pressing ESC and that no other "action" was performed (understand: no closing the search result, or hiding a menu or something along the line), then we discard the URL query parameters (the `?whatever=dsjfs`). What do you think about this change ```@rust-lang/rustdoc``` ?
    
    EDIT: finally we're simply removing the query parameter when we're skipping the search results.
    
    r? ```@Nemo157```
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    8541435 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#82255 - nhwn:nonzero-err-as-bug, r=davidtwco

    Make `treat_err_as_bug` Option<NonZeroUsize>
    
    `rustc -Z treat-err-as-bug=N` already requires `N` to be nonzero when the argument is parsed, so changing the type from `Option<usize>` to `Option<NonZeroUsize>` is a low-hanging fruit in terms of layout optimization.
    Dylan-DPC authored Feb 23, 2021
    Configuration menu
    Copy the full SHA
    0e5bca5 View commit details
    Browse the repository at this point in the history