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

Merged
merged 31 commits into from
Feb 14, 2023
Merged

Rollup of 10 pull requests #108052

merged 31 commits into from
Feb 14, 2023

Commits on Jan 22, 2023

  1. --wip-- [skip ci]

    --wip-- [skip ci]
    
    get the generic text and put it int he suggestion, but suggestion not working on derive subdiagnostic
    
    refactor away from derives and use span_suggestion() instead. Show's the correct(?) generic contents, but overwrites the fn name :(
    
    x fmt
    
    drop commented code and s/todo/fixme
    
    get the correct diagnostic for functions, at least
    
    x fmt
    
    remove some debugs
    
    remove format
    
    remove debugs
    
    remove useless change
    
    remove useless change
    
    remove legacy approach
    
    correct lookahead + error message contains the ident name
    
    fmt
    
    refactor code
    
    tests
    
    add tests
    
    remoev debug
    
    remove comment
    SpanishPear committed Jan 22, 2023
    Configuration menu
    Copy the full SHA
    e813132 View commit details
    Browse the repository at this point in the history
  2. Apply automatic suggestions from code review

    Co-authored-by: Takayuki Maeda <[email protected]>
    SpanishPear and TaKO8Ki committed Jan 22, 2023
    Configuration menu
    Copy the full SHA
    5287004 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    655beb4 View commit details
    Browse the repository at this point in the history
  4. revert to previous span

    SpanishPear committed Jan 22, 2023
    Configuration menu
    Copy the full SHA
    4447949 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8292d07 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2023

  1. move to multipart spans

    SpanishPear committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    70bfcc2 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2023

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

Commits on Feb 13, 2023

  1. Configuration menu
    Copy the full SHA
    44a2388 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    873c83b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    826bee7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ef6a59b View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2023

  1. Configuration menu
    Copy the full SHA
    3180f1c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    826abcc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2a5a1a8 View commit details
    Browse the repository at this point in the history
  4. rustdoc: add more tooltips to intra-doc links

    This commit makes intra-doc link tooltips consistent with generated
    links in function signatures and item tables, with the format
    `itemtype foo::bar::baz`. This way, you can tell if a link points at
    a trait or a type (for example) by mousing over it.
    
    See also fce944d
    notriddle committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    ba4b026 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    70fd729 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    936bf29 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0e185c2 View commit details
    Browse the repository at this point in the history
  8. Ord entails its supertraits

    eggyal committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    9e2947a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c8dae10 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    26136c6 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#103478 - SpanishPear:spanishpear/issue_1033…

    …66_fix, r=TaKO8Ki
    
     Suggest fix for misplaced generic params on fn item rust-lang#103366
    
    fixes rust-lang#103366
    
    This still has some work to go, but works for 2/3 of the initial base cases described in #1033366
    
    simple fn:
    ```
    error: expected identifier, found `<`
     --> shreys/test_1.rs:1:3
      |
    1 | fn<T> id(x: T) -> T { x }
      |   ^ expected identifier
      |
    help: help: place the generic parameter list after the function name:
      |
    1 | fn id<T>(x: T) -> T { x }
      |    ~~~~
    
    ```
    
    Complicated bounds
    ```
    error: expected identifier, found `<`
     --> spanishpear/test_2.rs:1:3
      |
    1 | fn<'a, B: 'a + std::ops::Add<Output = u32>> f(_x: B) { }
      |   ^ expected identifier
      |
    help: help: place the generic parameter list after the function name:
      |
    1 | fn f<'a, B: 'a + std::ops::Add<Output = u32>>(_x: B) { }
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ```
    
    Opening a draft PR for comments on approach, particularly I have the following questions:
     -  [x]  Is it okay to be using `err.span_suggestion` over struct derives? I struggled to get the initial implementation (particularly the correct suggestion message) on struct derives, although I think given what I've learned since starting, I could attempt re-doing it with that approach.
      -  [x] in the case where the snippet cannot be obtained from a span, is the `help` but no suggestion okay? I think yes (also, when does this case occur?)
      -  [x] are there any red flags for the generalisation of this work for relevant item kinds (i.e. `struct`, `enum`, `trait`, and `union`). My basic testing indicates it does work for those types except the help tip is currently hardcoded to `after the function name` - which should change dependent on the item.
      - [x] I am planning to not show the suggestion if there is already a `<` after the item identifier, (i.e. if there are already generics, as after a function name per the original issue). Any major objections?
      - [x] Is the style of error okay? I wasn't sure if there was a way to make it display nicer, or if thats handled by span_suggestion
    
    These aren't blocking questions, and I will keep working on:
      - check if there is a `<` after the ident (and if so, not showing the suggestion)
      - generalize the help message
      - figuring out how to write/run/etc ui tests (including reading the docs for them)
      - logic cleanups
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    202c706 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#107739 - spastorino:check-overflow-evaluate…

    …_canonical_goal, r=lcnr
    
    Check for overflow in evaluate_canonical_goal
    
    r? `@lcnr`
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    9ee3c7a View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#108003 - chenyukang:yukang/fix-107998, r=co…

    …mpiler-errors
    
    Avoid ICE when the generic_span is empty
    
    Fixes rust-lang#107998
    r? ```@TaKO8Ki```
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    1f486f0 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#108016 - tshepang:just-one-example, r=thomcc

    "Basic usage" is redundant for there is just one example
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    3eb5731 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#108023 - JulianKnodt:smaller_benchmark, r=w…

    …orkingjubilee
    
    Shrink size of array benchmarks
    
    Might've overdone it with the size of these benchmarks, as there's no need for them to be quite as large.
    
    Fixes rust-lang#108011
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    d599be0 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#108024 - zephaniahong:master, r=jyn514

    add message to update Cargo.toml when x is changed
    
    `@jyn514` Is this correct?
    
    As mentioned in rust-lang#108021
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    43b42c5 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#108025 - notriddle:notriddle/intra-doc-link…

    …-tooltips, r=GuillaumeGomez
    
    rustdoc: add more tooltips to intra-doc links
    
    This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it.
    
    See also rust-lang#39697
    
    Partially solves https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931 (though the Internals thread asks for color-coding, while this PR adds a tooltip instead, it's accomplishing the same thing).
    
    Before:
    
    <img width="950" alt="image" src="https://user-images.githubusercontent.com/1593513/218653059-911cea01-7231-438a-ad98-be98ab73783f.png">
    
    After:
    
    <img width="432" alt="image" src="https://user-images.githubusercontent.com/1593513/218653201-34ca3aa7-18f1-4cb1-be68-a1411bbe797e.png">
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    8804e7f View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#108029 - oli-obk:🞋_usize, r=RalfJung

    s/eval_usize/eval_target_usize/ for clarity
    
    r? `@nnethercote`
    
    as discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60Const.60.20and.20.60usize.60.2F.60u64.60 it is unclear what `usize` means and why we use a `u64` for something talking about `usize`. This renaming should make it clear that we're talking about `usize`s on the target platform, irrespective of the compiler host platform.
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    f68864c View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#108035 - oli-obk:oli_new_contributor_funkin…

    …ess, r=Mark-Simulacrum
    
    Avoid using a dead email address as the main email address
    
    This caused highfive to welcome me as a new contributor on every PR, because it couldn't find any commits of mine.
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    7a9e6e8 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#108038 - eggyal:remove_needless_supertrait_…

    …constraints, r=lcnr
    
    Remove needless supertrait constraints from Interner projections
    
    These associated types are already all constrained to implement `Ord`, so specifically requiring its supertraits `Eq`, `PartialEq` and `PartialOrd` is superfluous.
    matthiaskrgr authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    ea679fb View commit details
    Browse the repository at this point in the history