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 13 pull requests #82481

Closed
wants to merge 37 commits into from

Commits on Feb 19, 2021

  1. Configuration menu
    Copy the full SHA
    3ed189e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dd3772e View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2021

  1. Replace normalize.css 3.0.0 with unminified version.

    This is in preparation to upgrade to 8.0.1, so the next commit
    can contain more meaningful diffs.
    jsha committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    7ad4b7a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9bbd482 View commit details
    Browse the repository at this point in the history
  3. Re-minify normalize.css.

    This bypasses tidy's complaints about tab indent. Also, this lets us
    remove comments while keeping the MIT license comment.
    jsha committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    7acb105 View commit details
    Browse the repository at this point in the history
  4. Remove some P-s

    bugadani committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    10f2342 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2021

  1. Configuration menu
    Copy the full SHA
    fece59b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    17176cc View commit details
    Browse the repository at this point in the history
  3. Apply tidy check

    0yoyoyo committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    ce1a521 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b9449a3 View commit details
    Browse the repository at this point in the history
  5. Use optional values for inlining thresholds

    Turn inlining threshold into optional values to make it possible to
    configure different defaults depending on the current mir-opt-level.
    tmiasko committed Feb 21, 2021
    Configuration menu
    Copy the full SHA
    5c546be View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2021

  1. ⬆️ rust-analyzer

    lnicola committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    5f7d663 View commit details
    Browse the repository at this point in the history
  2. Update test cases

    0yoyoyo committed Feb 22, 2021
    Configuration menu
    Copy the full SHA
    75d1e30 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2021

  1. Improve error msgs when found type is deref of expected

    This improves help messages in two cases:
    
    - When expected type is `T` and found type is `&T`, we now look through blocks
      and suggest dereferencing the expression of the block, rather than the whole
      block.
    
    - In the above case, if the expression is an `&`, we not suggest removing the
      `&` instead of adding `*`.
    
    Both of these are demonstrated in the regression test. Before this patch the
    first error in the test would be:
    
        error[E0308]: `if` and `else` have incompatible types
         --> test.rs:8:9
          |
        5 | /     if true {
        6 | |         a
          | |         - expected because of this
        7 | |     } else {
        8 | |         b
          | |         ^ expected `usize`, found `&usize`
        9 | |     };
          | |_____- `if` and `else` have incompatible types
          |
        help: consider dereferencing the borrow
          |
        7 |     } else *{
        8 |         b
        9 |     };
          |
    
    Now:
    
        error[E0308]: `if` and `else` have incompatible types
         --> test.rs:8:9
          |
        5 | /     if true {
        6 | |         a
          | |         - expected because of this
        7 | |     } else {
        8 | |         b
          | |         ^
          | |         |
          | |         expected `usize`, found `&usize`
          | |         help: consider dereferencing the borrow: `*b`
        9 | |     };
          | |_____- `if` and `else` have incompatible types
    
    The second error:
    
        error[E0308]: `if` and `else` have incompatible types
          --> test.rs:14:9
           |
        11 | /     if true {
        12 | |         1
           | |         - expected because of this
        13 | |     } else {
        14 | |         &1
           | |         ^^ expected integer, found `&{integer}`
        15 | |     };
           | |_____- `if` and `else` have incompatible types
           |
        help: consider dereferencing the borrow
           |
        13 |     } else *{
        14 |         &1
        15 |     };
           |
    
    now:
    
        error[E0308]: `if` and `else` have incompatible types
          --> test.rs:14:9
           |
        11 | /     if true {
        12 | |         1
           | |         - expected because of this
        13 | |     } else {
        14 | |         &1
           | |         ^-
           | |         ||
           | |         |help: consider removing the `&`: `1`
           | |         expected integer, found `&{integer}`
        15 | |     };
           | |_____- `if` and `else` have incompatible types
    
    Fixes rust-lang#82361
    osa1 committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    fa74d48 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a6eb836 View commit details
    Browse the repository at this point in the history
  3. Make char methods const

    `escape_unicode`, `escape_default`, `len_utf8`, `len_utf16`, to_ascii_lowercase`, `eq_ignore_ascii_case`
    
    `u8` methods `to_ascii_lowercase`, `to_ascii_uppercase` also must be made const
    
    u8 methods made const
    
    Update methods.rs
    
    Update mod.rs
    
    Update methods.rs
    
    Fix `since` in rustc_const_stable to next stable
    
    Fix `since` in rustc_const_stable to next stable
    
    Update methods.rs
    
    Update mod.rs
    YenForYang authored and lopopolo committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    bcb1f06 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6a72491 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7b41ad1 View commit details
    Browse the repository at this point in the history
  6. Make ascii_change_case_unchecked const

    Rebases and makes changes required by the recent merge of rust-lang#81837.
    lopopolo committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    1ed9dd4 View commit details
    Browse the repository at this point in the history
  7. Constify ptr::write and the write[_unaligned] methods on *mut T

    Constify intrinsics::forget
    usbalbin committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    89c7610 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    de6f1b8 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2021

  1. rustdoc: Name fields of ResolutionFailure::WrongNamespace

    It makes it clearer that the `Namespace` is the one requested by the
    disambiguator, rather than the actual namespace of the item. It said
    that in the docs before, but now you can tell in the code so it reduces
    the potential for confusion.
    camelid committed Feb 24, 2021
    Configuration menu
    Copy the full SHA
    a03950b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f24eac5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cc0d531 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#80534 - LeSeulArtichaut:doc-include, r=jyn514

    Use #[doc = include_str!()] in std
    
    cc rust-lang#78835 (comment)
    r? ````@jyn514````
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    b3bcf48 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#81167 - usbalbin:const_write, r=oli-obk

    Make ptr::write const
    
    ~~The code in this PR as of right now is not much more than an experiment.~~
    
    ~~This should, if I am not mistaken, in theory compile and pass the tests once the bootstraping compiler is updated. Thus the PR is blocked on that which should happen some time after the February the 9th. Also we might want to wait for rust-lang#79989 to avoid regressing performance due to using `mem::forget` over `intrinsics::forget`~~.
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    9bece81 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#81575 - camelid:rustdoc-wrongnamespace-clea…

    …nup, r=jyn514
    
    rustdoc: Name fields of `ResolutionFailure::WrongNamespace`
    
    It makes it clearer that the `Namespace` is the one requested by the
    disambiguator, rather than the actual namespace of the item. It said
    that in the docs before, but now you can tell in the code so it reduces
    the potential for confusion.
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    09456c2 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#82078 - lopopolo:char-u8-const-fn, r=m-ou-se

    Make char and u8 methods const
    
    char methods `len_utf8`, `len_utf16`, `to_ascii_lowercase`, `eq_ignore_ascii_case` can be made const.
    
    `u8` methods `to_ascii_lowercase`, `to_ascii_uppercase` are required to be const as well.
    
    `u8::eq_ignore_ascii_case` was additionally made const.
    
    Rebase of rust-lang#79549 originally authored by `@YenForYang.` Changes from that PR:
    
    - Squashed all commits from rust-lang#79549.
    - rebased to latest upstream master.
    - Removed const attributes for `char::escape_unicode` and `char::escape_default`.
    - Updated `since` attributes for `const` stabilization to 1.52.0.
    
    cc `@m-ou-se.`
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    2137104 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#82090 - notriddle:consider-using-a-semicolo…

    …n-here, r=estebank
    
    Do not consider using a semicolon inside of a different-crate macro
    
    Fixes rust-lang#81943
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    4c054e1 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#82265 - GuillaumeGomez:cleanup-attrs-twice,…

    … r=jyn514
    
    Prevent to compute Item attributes twice
    
    I came across this case when working on another part of rustdoc. Not a game changer but a nice little improvement.
    
    cc `@camelid`
    
    r? `@jyn514`
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    a0dac6c View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#82269 - LeSeulArtichaut:cleanup-ppmode, r=s…

    …pastorino
    
    Cleanup `PpMode` and friends
    
    This PR:
     - Separates `PpSourceMode` and `PpHirMode` to remove invalid states
     - Renames the variant to remove the redundant `Ppm` prefix
     - Adds basic documentation for the different pretty-print modes
     - Cleanups some code to make it more idiomatic
    
    Not sure if this is actually useful, but it looks cleaner to me.
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    fc77949 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#82313 - jsha:update-normalize-css, r=Guilla…

    …umeGomez
    
    Update normalize.css to 8.0.1
    
    From From https://github.com/necolas/normalize.css/releases/tag/8.0.1.
    
    The old version was 3.0.0, from 2014. The new version is from 2018.
    
    I noticed when looking at frontend performance for rustdoc that this file was out of date. The URL in the 3.0.0 license header now resolves to an incorrect destination. And generally it seems good to be up-to-date.
    
    Before-and-after images, plus diff, under details. TL;DR: Nothing changes except a slight adjustment to line height.
    
    <details>
    
    ![with-normalize-8 0 1](https://user-images.githubusercontent.com/220205/108581849-bd5c8800-72e4-11eb-9150-78c8d67ca37a.png)
    
    ![with-normalize-3 0 0](https://user-images.githubusercontent.com/220205/108581848-bcc3f180-72e4-11eb-8b45-0cd1415a51e5.png)
    
    ![diff](https://user-images.githubusercontent.com/220205/108581890-dfeea100-72e4-11eb-93c5-6284492f54a9.png)
    
    </details>
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    817c263 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#82321 - bugadani:ast3, r=varkor

    AST: Remove some unnecessary boxes
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    461c64f View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#82364 - osa1:issue82361, r=estebank

    Improve error msgs when found type is deref of expected
    
    This improves help messages in two cases:
    
    - When expected type is `T` and found type is `&T`, we now look through blocks
      and suggest dereferencing the expression of the block, rather than the whole
      block.
    
    - In the above case, if the expression is an `&`, we not suggest removing the
      `&` instead of adding `*`.
    
    Both of these are demonstrated in the regression test. Before this patch the
    first error in the test would be:
    
        error[E0308]: `if` and `else` have incompatible types
         --> test.rs:8:9
          |
        5 | /     if true {
        6 | |         a
          | |         - expected because of this
        7 | |     } else {
        8 | |         b
          | |         ^ expected `usize`, found `&usize`
        9 | |     };
          | |_____- `if` and `else` have incompatible types
          |
        help: consider dereferencing the borrow
          |
        7 |     } else *{
        8 |         b
        9 |     };
          |
    
    Now:
    
        error[E0308]: `if` and `else` have incompatible types
         --> test.rs:8:9
          |
        5 | /     if true {
        6 | |         a
          | |         - expected because of this
        7 | |     } else {
        8 | |         b
          | |         ^
          | |         |
          | |         expected `usize`, found `&usize`
          | |         help: consider dereferencing the borrow: `*b`
        9 | |     };
          | |_____- `if` and `else` have incompatible types
    
    The second error:
    
        error[E0308]: `if` and `else` have incompatible types
          --> test.rs:14:9
           |
        11 | /     if true {
        12 | |         1
           | |         - expected because of this
        13 | |     } else {
        14 | |         &1
           | |         ^^ expected integer, found `&{integer}`
        15 | |     };
           | |_____- `if` and `else` have incompatible types
           |
        help: consider dereferencing the borrow
           |
        13 |     } else *{
        14 |         &1
        15 |     };
           |
    
    now:
    
        error[E0308]: `if` and `else` have incompatible types
          --> test.rs:14:9
           |
        11 | /     if true {
        12 | |         1
           | |         - expected because of this
        13 | |     } else {
        14 | |         &1
           | |         ^-
           | |         ||
           | |         |help: consider removing the `&`: `1`
           | |         expected integer, found `&{integer}`
        15 | |     };
           | |_____- `if` and `else` have incompatible types
    
    Fixes rust-lang#82361
    
    ---
    
    r? ```@estebank```
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    3feed61 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#82370 - 0yoyoyo:update-issue-81650-point-an…

    …onymous-lifetime, r=estebank
    
    Improve anonymous lifetime note to indicate the target span
    
    Improvement for  rust-lang#81650
    Cc rust-lang#81995
    
    Message after this improvement:
    (Improve note in the middle)
    
    ```
    error[E0311]: the parameter type `T` may not live long enough
      --> src/main.rs:25:11
       |
    24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
       |              -- help: consider adding an explicit lifetime bound...: `T: 'a +`
    25 |     scope.spawn(move |_| {
       |           ^^^^^
       |
    note: the parameter type `T` must be valid for the anonymous lifetime defined on the function body at 24:40...
      --> src/main.rs:24:40
       |
    24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
       |                                        ^^^^^
    note: ...so that the type `[closure@src/main.rs:25:17: 27:6]` will meet its required lifetime bounds
      --> src/main.rs:25:11
       |
    25 |     scope.spawn(move |_| {
       |           ^^^^^
    ```
    
    r? ```@estebank```
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    754be63 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#82376 - tmiasko:inline-options, r=oli-obk

    Add option to enable MIR inlining independently of mir-opt-level
    
    Add `-Zinline-mir` option that enables MIR inlining independently of the
    current MIR opt level. The primary use-case is enabling MIR inlining on the
    default MIR opt level.
    
    Turn inlining thresholds into optional values to make it possible to configure
    different defaults depending on the current mir-opt-level (although thresholds
    are yet to be used in such a manner).
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    4dd4d0b View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#82394 - lnicola:rust-analyzer-2021-02-22, r…

    …=jonas-schievink
    
    ⬆️ rust-analyzer
    Dylan-DPC authored Feb 24, 2021
    Configuration menu
    Copy the full SHA
    f47bc15 View commit details
    Browse the repository at this point in the history