diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-05-04 00:17:23 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-04 00:17:23 +0530 |
| commit | 80df4ab403cbdaf0fc7a8301d8490ee60d7063bf (patch) | |
| tree | 9c49bfac0499b037a7b2e35ea6c374962a1e2249 /compiler/rustc_parse/src/errors.rs | |
| parent | 32f3ddb902e03b7ac23de3e677ff27bc97eff0d6 (diff) | |
| parent | 6fca051b76342f8c21ec85fb9a77103b7c05adb9 (diff) | |
| download | rust-80df4ab403cbdaf0fc7a8301d8490ee60d7063bf.tar.gz rust-80df4ab403cbdaf0fc7a8301d8490ee60d7063bf.zip | |
Rollup merge of #110791 - compiler-errors:negative-bounds, r=oli-obk
Implement negative bounds for internal testing purposes Implements partial support the `!` negative polarity on trait bounds. This is incomplete, but should allow us to at least be able to play with the feature. Not even gonna consider them as a public-facing feature, but I'm implementing them because would've been nice to have in UI tests, for example in #110671.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index b445ccc7ad0..010a13aefa4 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -2280,31 +2280,6 @@ pub(crate) struct InvalidDynKeyword { pub span: Span, } -#[derive(Diagnostic)] -#[diag(parse_negative_bounds_not_supported)] -pub(crate) struct NegativeBoundsNotSupported { - #[primary_span] - pub negative_bounds: Vec<Span>, - #[label] - pub last_span: Span, - #[subdiagnostic] - pub sub: Option<NegativeBoundsNotSupportedSugg>, -} - -#[derive(Subdiagnostic)] -#[suggestion( - parse_suggestion, - style = "tool-only", - code = "{fixed}", - applicability = "machine-applicable" -)] -pub(crate) struct NegativeBoundsNotSupportedSugg { - #[primary_span] - pub bound_list: Span, - pub num_bounds: usize, - pub fixed: String, -} - #[derive(Subdiagnostic)] pub enum HelpUseLatestEdition { #[help(parse_help_set_edition_cargo)] @@ -2412,10 +2387,12 @@ pub(crate) struct TildeConstLifetime { } #[derive(Diagnostic)] -#[diag(parse_maybe_lifetime)] -pub(crate) struct MaybeLifetime { +#[diag(parse_modifier_lifetime)] +pub(crate) struct ModifierLifetime { #[primary_span] + #[suggestion(style = "tool-only", applicability = "maybe-incorrect", code = "")] pub span: Span, + pub sigil: &'static str, } #[derive(Diagnostic)] |
