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 #95662

Merged
merged 23 commits into from
Apr 5, 2022
Merged

Rollup of 7 pull requests #95662

merged 23 commits into from
Apr 5, 2022

Commits on Apr 2, 2022

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

Commits on Apr 3, 2022

  1. Configuration menu
    Copy the full SHA
    f0ec783 View commit details
    Browse the repository at this point in the history
  2. tweak some function names

    RalfJung committed Apr 3, 2022
    Configuration menu
    Copy the full SHA
    84a343d View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2022

  1. Configuration menu
    Copy the full SHA
    e0919de View commit details
    Browse the repository at this point in the history
  2. format cond

    TaKO8Ki committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    a56f214 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    637592d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    58dfe26 View commit details
    Browse the repository at this point in the history
  5. Mention implementers of unsatisfied trait

    When encountering an unsatisfied trait bound, if there are no other
    suggestions, mention all the types that *do* implement that trait:
    
    ```
    error[E0277]: the trait bound `f32: Foo` is not satisfied
      --> $DIR/impl_wf.rs:22:6
       |
    LL | impl Baz<f32> for f32 { }
       |      ^^^^^^^^ the trait `Foo` is not implemented for `f32`
       |
       = help: the following other types implement trait `Foo`:
                 Option<T>
                 i32
                 str
    note: required by a bound in `Baz`
      --> $DIR/impl_wf.rs:18:31
       |
    LL | trait Baz<U: ?Sized> where U: Foo { }
       |                               ^^^ required by this bound in `Baz`
    ```
    
    Mention implementers of traits in `ImplObligation`s.
    
    Do not mention other `impl`s for closures, ranges and `?`.
    estebank committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    3aac307 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ac8cbbd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    883b93c View commit details
    Browse the repository at this point in the history
  8. Fix list length

    estebank committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    e2bba07 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ef91519 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3109c93 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a6301ca View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e1ef833 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0252fc9 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#91873 - estebank:mention-impls-for-unsatisf…

    …ied-trait, r=davidtwco
    
    Mention implementers of unsatisfied trait
    
    When encountering an unsatisfied trait bound, if there are no other
    suggestions, mention all the types that *do* implement that trait:
    
    ```
    error[E0277]: the trait bound `f32: Foo` is not satisfied
      --> $DIR/impl_wf.rs:22:6
       |
    LL | impl Baz<f32> for f32 { }
       |      ^^^^^^^^ the trait `Foo` is not implemented for `f32`
       |
       = help: the trait `Foo` is implemented for `i32`
    note: required by a bound in `Baz`
      --> $DIR/impl_wf.rs:18:31
       |
    LL | trait Baz<U: ?Sized> where U: Foo { }
       |                               ^^^ required by this bound in `Baz`
    ```
    ```
    error[E0277]: the trait bound `u32: Foo` is not satisfied
      --> $DIR/associated-types-path-2.rs:29:5
       |
    LL |     f1(2u32, 4u32);
       |     ^^ the trait `Foo` is not implemented for `u32`
       |
       = help: the trait `Foo` is implemented for `i32`
    note: required by a bound in `f1`
      --> $DIR/associated-types-path-2.rs:13:14
       |
    LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
       |              ^^^ required by this bound in `f1`
    ```
    
    Suggest dereferencing in more cases.
    
    Fix rust-lang#87437, fix rust-lang#90970.
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    a5c8169 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#95588 - RalfJung:strict-provenance, r=scottmcm

    explicitly distinguish pointer::addr and pointer::expose_addr
    
    ``@bgeron`` pointed out that the current docs promise that `ptr.addr()` and `ptr as usize` are equivalent. I don't think that is a promise we want to make. (Conceptually, `ptr as usize` might 'escape' the provenance to enable future `usize as ptr` casts, but `ptr.addr()` dertainly does not do that.)
    
    So I propose we word the docs a bit more carefully here. ``@Gankra`` what do you think?
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    3bf33b9 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#95603 - compiler-errors:dyn-return, r=oli-obk

    Fix late-bound ICE in `dyn` return type suggestion
    
    This fixes the root-cause of the attached issues -- the root problem is that we're using the return type from a signature with late-bound instead of early-bound regions. The change on line 1087 (`let Some(liberated_sig) = typeck_results.liberated_fn_sigs().get(fn_hir_id) else { return false; };`) makes sure we're grabbing the _right_ return type for this suggestion to check the `dyn` predicates with.
    
    Fixes rust-lang#91801
    Fixes rust-lang#91803
    
    This fix also includes some drive-by changes, specifically:
    
    1. Don't suggest boxing when we have `-> dyn Trait` and are already returning `Box<T>` where `T: Trait` (before we always boxed the value).
    2. Suggestion applies even when the return type is a type alias (e.g. `type Foo = dyn Trait`). This does cause the suggestion to expand to the aliased type, but I think it's still beneficial.
    3. Split up the multipart suggestion because there's a 6-line max in the printed output...
    
    I am open to splitting out the above changes, if we just want to fix the ICE first.
    
    cc: ```@terrarier2111``` and rust-lang#92289
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    92e53f5 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#95620 - RalfJung:memory-no-extras, r=oli-obk

    interpret: remove MemoryExtra in favor of giving access to the Machine
    
    The Miri PR for this is upcoming.
    
    r? ``@oli-obk``
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    78f81f0 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#95630 - declanvk:update-nonnull-doc, r=Ralf…

    …Jung
    
    Update `NonNull` pointer provenance methods' documentation
    
     - Add links to equivalent methods on raw pointers
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    1c2b4b7 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#95631 - TaKO8Ki:remove-unnecessary-nested-b…

    …locks, r=davidtwco
    
    Refactor: remove unnecessary nested blocks
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    5b8ac2d View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#95642 - lcnr:probe-smol, r=compiler-errors

    `CandidateSource::XCandidate` -> `CandidateSource::X`
    Dylan-DPC committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    b3c3eda View commit details
    Browse the repository at this point in the history