1use flux_errors::E0999;
2use flux_macros::Diagnostic;
3use flux_syntax::surface;
4use rustc_span::{Span, Symbol};
5
6#[derive(Diagnostic)]
7#[diag(desugar_int_too_large, code = E0999)]
8pub(super) struct IntTooLarge {
9 #[primary_span]
10 pub(super) span: Span,
11}
12
13#[derive(Diagnostic)]
14#[diag(desugar_unexpected_literal, code = E0999)]
15pub(super) struct UnexpectedLiteral {
16 #[primary_span]
17 pub(super) span: Span,
18}
19
20#[derive(Diagnostic)]
21#[diag(desugar_invalid_constructor_path, code = E0999)]
22pub(super) struct InvalidConstructorPath {
23 #[primary_span]
24 pub(super) span: Span,
25}
26
27#[derive(Diagnostic)]
28#[diag(desugar_invalid_loc, code = E0999)]
29pub(super) struct InvalidLoc {
30 #[primary_span]
31 pub(super) span: Span,
32}
33
34#[derive(Diagnostic)]
35#[diag(desugar_invalid_numeric_suffix, code = E0999)]
36pub(super) struct InvalidNumericSuffix {
37 #[primary_span]
38 #[label]
39 span: Span,
40 suffix: Symbol,
41}
42
43impl InvalidNumericSuffix {
44 pub(super) fn new(span: Span, suffix: Symbol) -> Self {
45 Self { span, suffix }
46 }
47}
48
49#[derive(Diagnostic)]
50#[diag(desugar_invalid_alias_reft, code = E0999)]
51pub(super) struct InvalidAliasReft {
52 #[primary_span]
53 #[label]
54 pub(super) span: Span,
55}
56
57impl InvalidAliasReft {
58 pub(super) fn new(path: &surface::Path) -> Self {
59 Self { span: path.span }
60 }
61}
62
63#[derive(Diagnostic)]
64#[diag(desugar_invalid_variant_ret, code = E0999)]
65pub(super) struct InvalidVariantRet {
66 #[primary_span]
67 pub(super) span: Span,
68}
69
70impl InvalidVariantRet {
71 pub(super) fn new(path: &surface::Path) -> Self {
72 Self { span: path.span }
73 }
74}
75
76#[derive(Diagnostic)]
77#[diag(desugar_invalid_reflected_variant, code = E0999)]
78pub(super) struct InvalidReflectedVariant {
79 #[primary_span]
80 pub(super) span: Span,
81}
82
83impl InvalidReflectedVariant {
84 pub(super) fn new(span: Span) -> Self {
85 Self { span }
86 }
87}
88
89#[derive(Diagnostic)]
90#[diag(desugar_multiple_spreads_in_constructor, code = E0999)]
91pub(super) struct MultipleSpreadsInConstructor {
92 #[primary_span]
93 pub(super) span: Span,
94 #[help]
95 pub(super) prev_span: Span,
96}
97
98impl MultipleSpreadsInConstructor {
99 pub(super) fn new(span: Span, prev_span: Span) -> Self {
100 Self { span, prev_span }
101 }
102}
103
104#[derive(Diagnostic)]
105#[diag(desugar_unsupported_position, code = E0999)]
106pub(super) struct UnsupportedPosition {
107 #[primary_span]
108 span: Span,
109}
110
111impl UnsupportedPosition {
112 pub(super) fn new(span: Span) -> Self {
113 Self { span }
114 }
115}