diff options
| author | Xiretza <xiretza@xiretza.xyz> | 2022-10-20 21:17:14 +0200 |
|---|---|---|
| committer | Xiretza <xiretza@xiretza.xyz> | 2022-10-26 15:04:09 +0200 |
| commit | 20f2958b8af32dd08173272a7ede09aaa255c980 (patch) | |
| tree | b5b1a6ccb04f195519a69912baad8ec6e2609e2c /src/test/ui-fulldeps | |
| parent | 29334b951a6ab997d63d72a496454a0455ce5ee2 (diff) | |
| download | rust-20f2958b8af32dd08173272a7ede09aaa255c980.tar.gz rust-20f2958b8af32dd08173272a7ede09aaa255c980.zip | |
Add "tool-only" suggestion style
Diffstat (limited to 'src/test/ui-fulldeps')
| -rw-r--r-- | src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs | 7 | ||||
| -rw-r--r-- | src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr | 18 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs index 50a6c816578..7d9e2576cae 100644 --- a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs +++ b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs @@ -736,6 +736,13 @@ struct SuggestionStyleVerbose { } #[derive(Subdiagnostic)] +#[suggestion(parser_add_paren, code = "", style = "tool-only")] +struct SuggestionStyleToolOnly { + #[primary_span] + sub: Span, +} + +#[derive(Subdiagnostic)] #[suggestion(parser_add_paren, code = "", style = "hidden", style = "normal")] //~^ ERROR specified multiple times //~| NOTE previously specified here diff --git a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr index 4ae7ed34230..b76b7fdfcea 100644 --- a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr +++ b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr @@ -446,45 +446,45 @@ LL | #[suggestion_part(code = 3)] | ^^^^^^^^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:739:61 + --> $DIR/subdiagnostic-derive.rs:746:61 | LL | #[suggestion(parser_add_paren, code = "", style = "hidden", style = "normal")] | ^^^^^^^^^^^^^^^^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:739:43 + --> $DIR/subdiagnostic-derive.rs:746:43 | LL | #[suggestion(parser_add_paren, code = "", style = "hidden", style = "normal")] | ^^^^^^^^^^^^^^^^ error: specified multiple times - --> $DIR/subdiagnostic-derive.rs:748:50 + --> $DIR/subdiagnostic-derive.rs:755:50 | LL | #[suggestion_hidden(parser_add_paren, code = "", style = "normal")] | ^^^^^^^^^^^^^^^^ | note: previously specified here - --> $DIR/subdiagnostic-derive.rs:748:3 + --> $DIR/subdiagnostic-derive.rs:755:3 | LL | #[suggestion_hidden(parser_add_paren, code = "", style = "normal")] | ^^^^^^^^^^^^^^^^^ error: invalid suggestion style - --> $DIR/subdiagnostic-derive.rs:757:51 + --> $DIR/subdiagnostic-derive.rs:764:51 | LL | #[suggestion(parser_add_paren, code = "", style = "foo")] | ^^^^^ | - = help: valid styles are `normal`, `short`, `hidden` and `verbose` + = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only` error: `#[suggestion(style = ...)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:765:43 + --> $DIR/subdiagnostic-derive.rs:772:43 | LL | #[suggestion(parser_add_paren, code = "", style = 42)] | ^^^^^^^^^^ error: `#[suggestion(style)]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:773:43 + --> $DIR/subdiagnostic-derive.rs:780:43 | LL | #[suggestion(parser_add_paren, code = "", style)] | ^^^^^ @@ -492,7 +492,7 @@ LL | #[suggestion(parser_add_paren, code = "", style)] = help: a diagnostic slug must be the first argument to the attribute error: `#[suggestion(style(...))]` is not a valid attribute - --> $DIR/subdiagnostic-derive.rs:781:43 + --> $DIR/subdiagnostic-derive.rs:788:43 | LL | #[suggestion(parser_add_paren, code = "", style("foo"))] | ^^^^^^^^^^^^ |
