diff options
| author | bors <bors@rust-lang.org> | 2024-12-05 07:08:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-05 07:08:49 +0000 |
| commit | 0e98766a5478abd9a279777e55e3d3e06e1761c0 (patch) | |
| tree | fede924d637e7066db7ae6cc5869ede49469509a /compiler/rustc_parse/src/errors.rs | |
| parent | 5a0a5e6db9727917ce3e36950dae92696bc17079 (diff) | |
| parent | 1f1dfd54eb7f20a91950188fdcc5534ab86a6d17 (diff) | |
| download | rust-0e98766a5478abd9a279777e55e3d3e06e1761c0.tar.gz rust-0e98766a5478abd9a279777e55e3d3e06e1761c0.zip | |
Auto merge of #133893 - fmease:rollup-11pi6fg, r=fmease
Rollup of 10 pull requests Successful merges: - #118833 (Add lint against function pointer comparisons) - #122161 (Fix suggestion when shorthand `self` has erroneous type) - #133233 (Add context to "const in pattern" errors) - #133761 (Update books) - #133843 (Do not emit empty suggestion) - #133863 (Rename `core_pattern_type` and `core_pattern_types` lib feature gates to `pattern_type_macro`) - #133872 (No need to create placeholders for GAT args in confirm_object_candidate) - #133874 (`fn_sig_for_fn_abi` should return a `ty::FnSig`, no need for a binder) - #133890 (Add a new test ui/incoherent-inherent-impls/no-other-unrelated-errors to check E0116 does not cause unrelated errors) - #133892 (Revert #133817) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 2579e4c1f25..14f2dd32e92 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -3409,3 +3409,22 @@ pub(crate) struct PolarityAndModifiers { pub polarity: &'static str, pub modifiers_concatenated: String, } + +#[derive(Diagnostic)] +#[diag(parse_incorrect_type_on_self)] +pub(crate) struct IncorrectTypeOnSelf { + #[primary_span] + pub span: Span, + #[subdiagnostic] + pub move_self_modifier: MoveSelfModifier, +} + +#[derive(Subdiagnostic)] +#[multipart_suggestion(parse_suggestion, applicability = "machine-applicable")] +pub(crate) struct MoveSelfModifier { + #[suggestion_part(code = "")] + pub removal_span: Span, + #[suggestion_part(code = "{modifier}")] + pub insertion_span: Span, + pub modifier: String, +} |
