-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 5 pull requests #98970
Conversation
Signed-off-by: David Wood <david.wood@huawei.com>
Signed-off-by: David Wood <david.wood@huawei.com>
Add a new trait to be generated by diagnostic derives which uses a `LintDiagnosticBuilder`. Signed-off-by: David Wood <david.wood@huawei.com>
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 <david.wood@huawei.com>
`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 <david.wood@huawei.com>
`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.
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'.
Only compute DefKind through the query.
…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`
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`
…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'.
assert Scalar sanity With rust-lang#96814 having landed, finally our `Scalar` layouts have the invariants they deserve. :)
@bors r+ rollup=never p=5 |
📌 Commit 7f62a71 has been approved by |
⌛ Testing commit 7f62a71 with merge 3f88fbe21291eec99eb5a2117b43544379059fd7... |
FWIW the following PRs in the queue are all older than the oldest one in this rollup and have been unfairly overtaken
|
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (049308c): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Successful merges:
LintDiagnostic
derive #98884 (macros:LintDiagnostic
derive)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup