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 8 pull requests #108027

Closed
wants to merge 29 commits into from
Closed

Commits on Dec 31, 2022

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

Commits on Jan 17, 2023

  1. rework min_choice algorithm of member constraints

    See the inline comments for the description of the new algorithm.
    aliemjay committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    837c1af View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2023

  1. Remove some superfluous type parameters from layout.rs.

    Specifically remove V, which can always be VariantIdx, and F, which can
    always be Layout.
    mikebenfield committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    8df27d0 View commit details
    Browse the repository at this point in the history

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 6, 2023

  1. Remove redundant test.

    cjgillot committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    0d59b8c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cd3649b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9a6c04f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c48756c View commit details
    Browse the repository at this point in the history
  5. Improve value_analysis API.

    cjgillot committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    9af191f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    67a8c16 View commit details
    Browse the repository at this point in the history
  7. Rename assign_idx methods.

    cjgillot committed Feb 6, 2023
    Configuration menu
    Copy the full SHA
    df889c9 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2023

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

    cjgillot committed Feb 13, 2023
    Configuration menu
    Copy the full SHA
    09797a4 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. 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
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    765f703 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#105300 - aliemjay:member-lower, r=oli-obk

    rework min_choice algorithm of member constraints
    
    See [this comment](rust-lang#105300 (comment)) for the description of the new algorithm.
    
    Fixes rust-lang#63033
    Fixes rust-lang#104639
    
    This uses a more general algorithm than rust-lang#89056 that doesn't treat `'static` as a special case. It thus accepts more code. For example:
    ```rust
    async fn test2<'s>(_: &'s u8, _: &'_ &'s u8, _: &'_ &'s u8) {}
    ```
    I claim it's more correct as well because it fixes rust-lang#104639.
    
    cc `@nikomatsakis` `@lqd` `@tmandry` `@eholk` `@chenyukang` `@oli-obk`
    
    r? types
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    86368ae View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#106372 - joboet:solid_id_parking, r=m-ou-se

    Use id-based thread parking on SOLID
    
    By using the [`slp_tsk`/`wup_tsk`](https://cs.uwaterloo.ca/~brecht/courses/702/Possible-Readings/embedded/uITRON-4.0-specification.pdf) system functions instead of an event-flag structure, `Parker` becomes cheaper to construct and SOLID can share the implementation used by NetBSD and SGX.
    
    ping `@kawadakk`
    r? `@m-ou-se`
    `@rustbot` label +T-libs
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    6f88493 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#107163 - mikebenfield:parameters-pr, r=TaKO8Ki

    Remove some superfluous type parameters from layout.rs.
    
    Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    6bfabbe View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#107411 - cjgillot:dataflow-discriminant, r=…

    …oli-obk
    
    Handle discriminant in DataflowConstProp
    
    cc `@jachris`
    r? `@JakobDegen`
    
    This PR attempts to extend the DataflowConstProp pass to handle propagation of discriminants. We handle this by adding 2 new variants to `TrackElem`: `TrackElem::Variant` for enum variants and `TrackElem::Discriminant` for the enum discriminant pseudo-place.
    
    The difficulty is that the enum discriminant and enum variants may alias each another. This is the issue of the `Option<NonZeroUsize>` test, which is the equivalent of rust-lang/unsafe-code-guidelines#84 with a direct write.
    
    To handle that, we generalize the flood process to flood all the potentially aliasing places. In particular:
    - any write to `(PLACE as Variant)`, either direct or through a projection, floods `(PLACE as OtherVariant)` for all other variants and `discriminant(PLACE)`;
    - `SetDiscriminant(PLACE)` floods `(PLACE as Variant)` for each variant.
    
    This implies that flooding is not hierarchical any more, and that an assignment to a non-tracked place may need to flood a tracked place. This is handled by `for_each_aliasing_place` which generalizes `preorder_invoke`.
    
    As we deaggregate enums by putting `SetDiscriminant` last, this allows to propagate the value of the discriminant.
    
    This refactor will allow to make rust-lang#107009 able to handle discriminants too.
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    1756653 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#107972 - saethlin:fix-test-ub, r=michaelwoe…

    …rister
    
    Fix unintentional UB in ui tests
    
    `@matthiaskrgr` found UB in a bunch of the ui tests. This PR fixes a batch of miscellaneous tests I didn't think needed reviewers from a particular part of the project.
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    81e6e3a View commit details
    Browse the repository at this point in the history
  9. 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`
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    d34957d View commit details
    Browse the repository at this point in the history
  10. 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
    Dylan-DPC authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    b8d1547 View commit details
    Browse the repository at this point in the history