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 10 pull requests #82330

Closed
wants to merge 35 commits into from

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. Configuration menu
    Copy the full SHA
    cadcf5e 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 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
    33d8b04 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2021

  1. Add internal collect_into_array[_unchecked] to remove duplicate code

    This does not suggest adding such a function to the public API. This is
    just for the purpose of avoiding duplicate code. Many array methods
    already contained the same kind of code and there are still many array
    related methods to come (e.g. `Iterator::{chunks, map_windows, next_n,
    ...}`) which all basically need this functionality. Writing custom
    `unsafe` code for each of those seems not like a good idea.
    LukasKalbertodt committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    c675af8 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. Configuration menu
    Copy the full SHA
    5ec4b06 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b08bc78 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2021

  1. Fix panic in 'remove semicolon' when types are not local

    It's not possible to check if removing a semicolon fixes the type error
    when checking match arms and one or both of the last arm's and the
    current arm's return types are imported "opaque" types. In these cases
    we don't generate a "consider removing semicolon" suggestions.
    
    Fixes rust-lang#81839
    osa1 committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    5fd1ebe View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ad47fb1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    15fdccc View commit details
    Browse the repository at this point in the history
  4. Add regression test

    osa1 committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    9ef67e0 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2021

  1. Consider auto derefs before warning about write only fields

    Changes from 81473 extended the dead code lint with an ability to detect
    fields that are written to but never read from. The implementation skips
    over fields on the left hand side of an assignment, without marking them
    as live.
    
    A field access might involve an automatic dereference and de-facto read
    the field. Conservatively mark expressions with deref adjustments as
    live to avoid generating false positive warnings.
    tmiasko committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    343b673 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    48b5c09 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    597118b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    62ee3ec View commit details
    Browse the repository at this point in the history
  5. 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
  6. Support pub on macro_rules

    petrochenkov authored and spastorino committed Feb 19, 2021
    Configuration menu
    Copy the full SHA
    0fddc2f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b3000ec View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2021

  1. impl PartialEq<Punct> for char; symmetry for rust-lang#78636

    Also fixes the "since" version of the original.
    pthariensflame committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    1839748 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e906745 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a9c6188 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#80595 - pthariensflame:patch-1, r=m-ou-se

    `impl PartialEq<Punct> for char`; symmetry for rust-lang#78636
    
    Also fixes the "since" version of the original.
    
    Pinging `@dtolnay` and `@petrochenkov.`
    Dylan-DPC authored Feb 20, 2021
    Configuration menu
    Copy the full SHA
    e37adf5 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 20, 2021
    Configuration menu
    Copy the full SHA
    6468333 View commit details
    Browse the repository at this point in the history
  6. 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 20, 2021
    Configuration menu
    Copy the full SHA
    b7b2d58 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#81991 - osa1:issue81839, r=estebank

    Fix panic in 'remove semicolon' when types are not local
    
    It's not possible to check if removing a semicolon fixes the type error
    when checking match arms and one or both of the last arm's and the
    current arm's return types are imported "opaque" types. In these cases
    we don't generate a "consider removing semicolon" suggestions.
    
    Fixes rust-lang#81839
    
    ---
    
    I'm not sure how to add a test for this. I think the test would need at least two crates. Do we have any existing tests that do this so that I can take a look?
    Dylan-DPC authored Feb 20, 2021
    Configuration menu
    Copy the full SHA
    71ee3c8 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 20, 2021
    Configuration menu
    Copy the full SHA
    06e04fd View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#82098 - LukasKalbertodt:add-collect-into-ar…

    …ray, r=dtolnay
    
    Add internal `collect_into_array[_unchecked]` to remove duplicate code
    
    Unlike the similar PRs  rust-lang#69985, rust-lang#75644 and rust-lang#79659, this PR only adds private functions and does not propose any new public API. The change is just for the purpose of avoiding duplicate code.
    
    Many array methods already contained the same kind of code and there are still many array related methods to come (e.g. `Iterator::{chunks, map_windows, next_n, ...}`, `[T; N]::{cloned, copied, ...}`, ...) which all basically need this functionality. Writing custom `unsafe` code for each of those doesn't seem like a good idea. I added two functions in this PR (and not just the `unsafe` version) because I already know that I need the `Option`-returning version for `Iterator::map_windows`.
    
    This is closely related to rust-lang#81615. I think that all options listed in that issue can be implemented using the function added in this PR. The only instance where `collect_array_into` might not be general enough is when the caller want to handle incomplete arrays manually. Currently, if `iter` yields fewer than `N` items, `None` is returned and the already yielded items are dropped. But as this is just a private function, it can be made more general in future PRs.
    
    And while this was not the goal, this seems to lead to better assembly for `array::map`: https://rust.godbolt.org/z/75qKTa (CC `@JulianKnodt)`
    
    Let me know what you think :)
    
    CC `@matklad` `@bstrie`
    Dylan-DPC authored Feb 20, 2021
    Configuration menu
    Copy the full SHA
    bb89479 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 20, 2021
    Configuration menu
    Copy the full SHA
    886e995 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#82176 - RalfJung:mir-fn-ptr-pretty, r=oli-obk

    fix MIR fn-ptr pretty-printing
    
    An uninitialized function pointer would get printed as `{{uninit  fn()}` (notice the unbalanced parentheses), and a dangling fn ptr would ICE. This fixes both of that.
    
    However, I have no idea how to add tests for this.
    
    Also, I don't understand this MIR pretty-printing code. Somehow the print function `pretty_print_const_scalar` actually *returns* a transformed form of the const (but there is no doc comment explaining what is being returned); some match arms do `p!` while others do `self =`, and there's a wild mixture of `p!` and `write!`... all very mysterious and confusing.^^
    
    r? `@oli-obk`
    Dylan-DPC authored Feb 20, 2021
    Configuration menu
    Copy the full SHA
    7109440 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#82296 - spastorino:pubrules, r=nikomatsakis

    Support `pub` on `macro_rules`
    
    This rebases and updates `since` version of rust-lang#78166 from `@petrochenkov`
    
    r? `@nikomatsakis`
    Dylan-DPC authored Feb 20, 2021
    Configuration menu
    Copy the full SHA
    50272eb View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#82297 - tmiasko:write-only, r=oli-obk

    Consider auto derefs before warning about write only fields
    
    Changes from rust-lang#81473 extended the dead code lint with an ability to detect
    fields that are written to but never read from. The implementation skips
    over fields on the left hand side of an assignment, without marking them
    as live.
    
    A field access might involve an automatic dereference and de-facto read
    the field. Conservatively mark expressions with deref adjustments as
    live to avoid generating false positive warnings.
    
    Closes rust-lang#81626.
    Dylan-DPC authored Feb 20, 2021
    Configuration menu
    Copy the full SHA
    3b80aef View commit details
    Browse the repository at this point in the history