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 5 pull requests #98970

Merged
merged 18 commits into from
Jul 6, 2022
Merged

Rollup of 5 pull requests #98970

merged 18 commits into from
Jul 6, 2022

Commits on Jul 4, 2022

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

Commits on Jul 5, 2022

  1. macros: fix documentation link for diag derive

    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    84ec777 View commit details
    Browse the repository at this point in the history
  2. lint: LintDiagnosticBuilder into rustc_errors

    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    2874f09 View commit details
    Browse the repository at this point in the history
  3. errors: introduce DecorateLint

    Add a new trait to be generated by diagnostic derives which uses a
    `LintDiagnosticBuilder`.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    540eaf9 View commit details
    Browse the repository at this point in the history
  4. macros: introduce build_field_mapping

    Move the logic for building a field mapping (which is used by the
    building of format strings in `suggestion` annotations) into a helper
    function.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    406579a View commit details
    Browse the repository at this point in the history
  5. macros: move sess out of builder

    `sess` field of `SessionDiagnosticDeriveBuilder` is never actually used
    in the builder's member functions, so it doesn't need to be a field.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    7f9d848 View commit details
    Browse the repository at this point in the history
  6. macros: add diagnostic derive for lints

    `SessionDiagnostic` isn't suitable for use on lints as whether or not it
    creates an error or a warning is decided at compile-time by the macro,
    whereas lints decide this at runtime based on the location of the lint
    being reported (as it will depend on the user's `allow`/`deny`
    attributes, etc). Re-using most of the machinery for
    `SessionDiagnostic`, this macro introduces a `LintDiagnostic` derive
    which implements a `DecorateLint` trait, taking a
    `LintDiagnosticBuilder` and adding to the lint according to the
    diagnostic struct.
    davidtwco committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    9d864c8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    974b1e3 View commit details
    Browse the repository at this point in the history
  8. fix type in function name

    RalfJung committed Jul 5, 2022
    Configuration menu
    Copy the full SHA
    4687afa View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2022

  1. fix typo in note about multiple inaccessible type aliases

    Mainly intended as a small typo fix ("aliass" -> "aliases") for
    the case where a type cannot be found in scope, and there are
    multiple inaccessible type aliases that match the missing type.
    
    In general this change would use the correct plural form in
    this scenario for words that end with 's'.
    ClementTsang committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    503c669 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8f867c5 View commit details
    Browse the repository at this point in the history
  3. add test

    RalfJung committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    2a1a718 View commit details
    Browse the repository at this point in the history
  4. Fix double space

    fee1-dead authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    3162986 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#98881 - cjgillot:q-def-kind, r=fee1-dead

    Only compute DefKind through the query.
    Dylan-DPC authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    707c0d9 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#98884 - davidtwco:translation-on-lints-deri…

    …ve, r=oli-obk
    
    macros: `LintDiagnostic` derive
    
    - Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it.
    - Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning).
    - Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`).
    - Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro  except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery.
    
    ~~At time of opening this pull request, ignore all of the commits from rust-lang#98624, it's just the last few commits that are new.~~
    
    r? `@oli-obk`
    Dylan-DPC authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    df1f415 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#98964 - RalfJung:typo, r=Dylan-DPC

    fix typo in function name
    
    I don't know what I was doing when I named that function...
    follow-up to rust-lang#98888
    r? `@oli-obk`
    Dylan-DPC authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    56667b5 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#98967 - ClementTsang:fix_inaccessible_type_…

    …alias_plural_typo, r=lcnr
    
    fix typo in note about multiple inaccessible type aliases
    
    Mainly intended as a small typo fix ("aliass" -> "aliases") for the case where a type cannot be found in scope but there are multiple inaccessible type aliases that match the missing type.
    
    In general this change would use the correct plural form in this scenario for base words that end with 's'.
    Dylan-DPC authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    41e30e3 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#98968 - RalfJung:scalar-sanity, r=oli-obk

    assert Scalar sanity
    
    With rust-lang#96814 having landed, finally our `Scalar` layouts have the invariants they deserve. :)
    Dylan-DPC authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    7f62a71 View commit details
    Browse the repository at this point in the history