diff options
| author | bors <bors@rust-lang.org> | 2022-11-15 03:37:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-11-15 03:37:07 +0000 |
| commit | 101e1822c3e54e63996c8aaa014d55716f3937eb (patch) | |
| tree | 4221eb50b20ad8cb84e1320b3e21cd80bad30813 /compiler/rustc_parse/src/errors.rs | |
| parent | dedfb9c2140dcc770054b1515d6099e42d35004d (diff) | |
| parent | c3890976937e1e6d7c5e892ebbef4a8676d4baec (diff) | |
| download | rust-101e1822c3e54e63996c8aaa014d55716f3937eb.tar.gz rust-101e1822c3e54e63996c8aaa014d55716f3937eb.zip | |
Auto merge of #104418 - matthiaskrgr:rollup-y4i6xjc, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - #101967 (Move `unix_socket_abstract` feature API to `SocketAddrExt`.) - #102470 (Stabilize const char convert) - #104223 (Recover from function pointer types with generic parameter list) - #104229 (Don't print full paths in overlap errors) - #104294 (Don't ICE with inline const errors during MIR build) - #104332 (Fixed some `_i32` notation in `maybe_uninit`’s doc) - #104349 (fix some typos in comments) - #104350 (Fix x finding Python on Windows) - #104356 (interpret: make check_mplace public) - #104364 (rustdoc: Resolve doc links in external traits having local impls) - #104378 (Bump chalk to v0.87) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index d59982f7063..a39398950a5 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1280,3 +1280,24 @@ pub(crate) struct DoubleColonInBound { #[suggestion(code = ": ", applicability = "machine-applicable")] pub between: Span, } + +#[derive(Diagnostic)] +#[diag(parser_fn_ptr_with_generics)] +pub(crate) struct FnPtrWithGenerics { + #[primary_span] + pub span: Span, + #[subdiagnostic] + pub sugg: Option<FnPtrWithGenericsSugg>, +} + +#[derive(Subdiagnostic)] +#[multipart_suggestion(suggestion, applicability = "maybe-incorrect")] +pub(crate) struct FnPtrWithGenericsSugg { + #[suggestion_part(code = "{snippet}")] + pub left: Span, + pub snippet: String, + #[suggestion_part(code = "")] + pub right: Span, + pub arity: usize, + pub for_param_list_exists: bool, +} |
