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 7 pull requests #100318

Merged
merged 27 commits into from
Aug 9, 2022
Merged

Rollup of 7 pull requests #100318

merged 27 commits into from
Aug 9, 2022

Commits on Jul 26, 2022

  1. Implement #[rustc_default_body_unstable]

    This attribute allows to mark default body of a trait function as
    unstable. This means that implementing the trait without implementing
    the function will require enabling unstable feature.
    
    This is useful in conjunction with `#[rustc_must_implement_one_of]`,
    we may want to relax requirements for a trait, for example allowing
    implementing either of `PartialEq::{eq, ne}`, but do so in a safe way
    -- making implementation of only `PartialEq::ne` unstable.
    WaffleLapkin committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    177af47 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9015a51 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d65fa27 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1984437 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1e1d6fe View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2022

  1. check_missing_items.py: Don't overwrite ty in loop

    Because python doesn't have lexical scope, loop variables
    persist after the loop is exited, set to the value of the last
    itteration
    
    ```
    >>> i = 0
    >>> for i in range(10): pass
    ...
    >>> i
    9
    ```
    
    This causes the `ty` variable to be changed, causing unexpected crashes on
    ```
    pub type RefFn<'a> = &'a dyn for<'b> Fn(&'a i32) -> i32;
    ```
    aDotInTheVoid committed Jul 30, 2022
    Configuration menu
    Copy the full SHA
    95729dc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2143e48 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2022

  1. Configuration menu
    Copy the full SHA
    e11b4b8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    963e402 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2022

  1. Configuration menu
    Copy the full SHA
    a856e57 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    625c4d7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6290f92 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2022

  1. Configuration menu
    Copy the full SHA
    95bf0fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d5e9e94 View commit details
    Browse the repository at this point in the history
  3. propagate --bless to Miri

    RalfJung committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    54b122e View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2022

  1. Don't ICE while suggesting updating item path.

    When an item isn't found, we may suggest an appropriate import to
    `use`. Along with that, we also suggest updating the path to work
    with the `use`. Unfortunately, if the code in question originates
    from a macro, the span used to indicate which part of the path
    needs updating may not be suitable and cause an ICE. Since, such
    code is not adjustable directly by the user without modifying the
    macro, just skip the suggestion in such cases.
    luqmana committed Aug 7, 2022
    Configuration menu
    Copy the full SHA
    fc83a0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15b1daa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b3b23aa View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2022

  1. Configuration menu
    Copy the full SHA
    abbd34d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    56ec5be View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#96478 - WaffleLapkin:rustc_default_body_uns…

    …table, r=Aaron1011
    
    Implement `#[rustc_default_body_unstable]`
    
    This PR implements a new stability attribute — `#[rustc_default_body_unstable]`.
    
    `#[rustc_default_body_unstable]` controls the stability of default bodies in traits.
    For example:
    ```rust
    pub trait Trait {
        #[rustc_default_body_unstable(feature = "feat", isssue = "none")]
        fn item() {}
    }
    ```
    In order to implement `Trait` user needs to either
    - implement `item` (even though it has a default implementation)
    - enable `#![feature(feat)]`
    
    This is useful in conjunction with [`#[rustc_must_implement_one_of]`](rust-lang#92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable.
    
    r? `@Aaron1011`
    cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`)
    P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    1dc4858 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#99787 - aDotInTheVoid:rdj-dyn, r=camelid,no…

    …triddle,GuillaumeGomez
    
    Rustdoc-Json: Document HRTB's on DynTrait
    
    Closes rust-lang#99118
    
    Probably best reviewed commit by commit.
    
    `@rustbot` modify labels: +A-rustdoc-json
    
    cc `@Enselic`
    
    r? `@CraftSpider`
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    e41be25 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#100181 - RalfJung:alloc-ref-mutability, r=j…

    …ackh726
    
    add method to get the mutability of an AllocId
    
    Miri needs this for rust-lang/miri#2463.
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    7efe24c View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#100221 - compiler-errors:impossible-trait-i…

    …tems, r=lcnr,notriddle,camelid
    
    Don't document impossible to call default trait items on impls
    
    Closes rust-lang#100176
    
    This only skips documenting _default_ trait items on impls, not ones that are written inside the impl block. This is a conservative approach, since I think we should document all items written in an impl block (I guess unless hidden or whatever), but the existence of this new query I added makes this easy to extend to other rustdoc cases.
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    d910e53 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#100228 - luqmana:suggestion-ice, r=estebank

    Don't ICE while suggesting updating item path.
    
    When an item isn't found, we may suggest an appropriate import to `use`. Along with that, we also suggest updating the path to work with the `use`. Unfortunately, if the code in question originates from a macro, the span used to indicate which part of the path needs updating may not be suitable and cause an ICE (*). Since, such code is not adjustable directly by the user without modifying the macro, just skip the suggestion in such cases.
    
    (*) The ICE happens because the emitter want to indicate to the user what code to delete by referencing a certain span. But in this case, said span has `lo == hi == 0` which means it thinks it's a dummy span. Adding a space before the proc macro attribute is enough to stop it from ICE'ing but even then the suggestion doesn't really make any sense:
    ```
    help: if you import `DataStore`, refer to it directly
      |
    1 -  #[dbstruct::dbstruct]
    1 +  #[dbstruct::dbstruct]
    ```
    
    Since suggestions are best-effort, I just gated this one on `can_be_used_for_suggestions` which catches cases like this.
    
    Fixes rust-lang#100199
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    fac84e8 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#100301 - TaKO8Ki:avoid-&str-to-String-conve…

    …rsions, r=compiler-errors
    
    Avoid `&str` to `String` conversions
    
    This patch removes the recently added unnecessary `&str` to `String` conversions.
    
    follow-up to rust-lang#99718
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    d7f414d View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#100305 - TaKO8Ki:suggest-adding-appropriate…

    …-missing-pattern-excluding-comments, r=compiler-errors
    
    Suggest adding an appropriate missing pattern excluding comments
    
    fixes rust-lang#100272
    Dylan-DPC committed Aug 9, 2022
    Configuration menu
    Copy the full SHA
    467e7aa View commit details
    Browse the repository at this point in the history