@@ -260,7 +260,7 @@ pub(crate) struct NotAsNegationOperator {
260
260
}
261
261
262
262
#[ derive( Subdiagnostic ) ]
263
- pub enum NotAsNegationOperatorSub {
263
+ pub ( crate ) enum NotAsNegationOperatorSub {
264
264
#[ suggestion(
265
265
parse_unexpected_token_after_not_default,
266
266
style = "verbose" ,
@@ -424,7 +424,7 @@ pub(crate) enum IfExpressionMissingThenBlockSub {
424
424
#[ derive( Diagnostic ) ]
425
425
#[ diag( parse_ternary_operator) ]
426
426
#[ help]
427
- pub struct TernaryOperator {
427
+ pub ( crate ) struct TernaryOperator {
428
428
#[ primary_span]
429
429
pub span : Span ,
430
430
}
@@ -1088,7 +1088,7 @@ pub(crate) enum ExpectedIdentifierFound {
1088
1088
}
1089
1089
1090
1090
impl ExpectedIdentifierFound {
1091
- pub fn new ( token_descr : Option < TokenDescription > , span : Span ) -> Self {
1091
+ pub ( crate ) fn new ( token_descr : Option < TokenDescription > , span : Span ) -> Self {
1092
1092
( match token_descr {
1093
1093
Some ( TokenDescription :: ReservedIdentifier ) => {
1094
1094
ExpectedIdentifierFound :: ReservedIdentifier
@@ -1659,7 +1659,7 @@ pub(crate) struct SelfArgumentPointer {
1659
1659
1660
1660
#[ derive( Diagnostic ) ]
1661
1661
#[ diag( parse_unexpected_token_after_dot) ]
1662
- pub struct UnexpectedTokenAfterDot < ' a > {
1662
+ pub ( crate ) struct UnexpectedTokenAfterDot < ' a > {
1663
1663
#[ primary_span]
1664
1664
pub span : Span ,
1665
1665
pub actual : Cow < ' a , str > ,
@@ -1928,7 +1928,7 @@ pub(crate) enum UnexpectedTokenAfterStructName {
1928
1928
}
1929
1929
1930
1930
impl UnexpectedTokenAfterStructName {
1931
- pub fn new ( span : Span , token : Token ) -> Self {
1931
+ pub ( crate ) fn new ( span : Span , token : Token ) -> Self {
1932
1932
match TokenDescription :: from_token ( & token) {
1933
1933
Some ( TokenDescription :: ReservedIdentifier ) => Self :: ReservedIdentifier { span, token } ,
1934
1934
Some ( TokenDescription :: Keyword ) => Self :: Keyword { span, token } ,
@@ -2006,60 +2006,60 @@ pub(crate) enum TopLevelOrPatternNotAllowed {
2006
2006
2007
2007
#[ derive( Diagnostic ) ]
2008
2008
#[ diag( parse_cannot_be_raw_ident) ]
2009
- pub struct CannotBeRawIdent {
2009
+ pub ( crate ) struct CannotBeRawIdent {
2010
2010
#[ primary_span]
2011
2011
pub span : Span ,
2012
2012
pub ident : Symbol ,
2013
2013
}
2014
2014
2015
2015
#[ derive( Diagnostic ) ]
2016
2016
#[ diag( parse_keyword_lifetime) ]
2017
- pub struct KeywordLifetime {
2017
+ pub ( crate ) struct KeywordLifetime {
2018
2018
#[ primary_span]
2019
2019
pub span : Span ,
2020
2020
}
2021
2021
2022
2022
#[ derive( Diagnostic ) ]
2023
2023
#[ diag( parse_invalid_label) ]
2024
- pub struct InvalidLabel {
2024
+ pub ( crate ) struct InvalidLabel {
2025
2025
#[ primary_span]
2026
2026
pub span : Span ,
2027
2027
pub name : Symbol ,
2028
2028
}
2029
2029
2030
2030
#[ derive( Diagnostic ) ]
2031
2031
#[ diag( parse_cr_doc_comment) ]
2032
- pub struct CrDocComment {
2032
+ pub ( crate ) struct CrDocComment {
2033
2033
#[ primary_span]
2034
2034
pub span : Span ,
2035
2035
pub block : bool ,
2036
2036
}
2037
2037
2038
2038
#[ derive( Diagnostic ) ]
2039
2039
#[ diag( parse_no_digits_literal, code = E0768 ) ]
2040
- pub struct NoDigitsLiteral {
2040
+ pub ( crate ) struct NoDigitsLiteral {
2041
2041
#[ primary_span]
2042
2042
pub span : Span ,
2043
2043
}
2044
2044
2045
2045
#[ derive( Diagnostic ) ]
2046
2046
#[ diag( parse_invalid_digit_literal) ]
2047
- pub struct InvalidDigitLiteral {
2047
+ pub ( crate ) struct InvalidDigitLiteral {
2048
2048
#[ primary_span]
2049
2049
pub span : Span ,
2050
2050
pub base : u32 ,
2051
2051
}
2052
2052
2053
2053
#[ derive( Diagnostic ) ]
2054
2054
#[ diag( parse_empty_exponent_float) ]
2055
- pub struct EmptyExponentFloat {
2055
+ pub ( crate ) struct EmptyExponentFloat {
2056
2056
#[ primary_span]
2057
2057
pub span : Span ,
2058
2058
}
2059
2059
2060
2060
#[ derive( Diagnostic ) ]
2061
2061
#[ diag( parse_float_literal_unsupported_base) ]
2062
- pub struct FloatLiteralUnsupportedBase {
2062
+ pub ( crate ) struct FloatLiteralUnsupportedBase {
2063
2063
#[ primary_span]
2064
2064
pub span : Span ,
2065
2065
pub base : & ' static str ,
@@ -2068,7 +2068,7 @@ pub struct FloatLiteralUnsupportedBase {
2068
2068
#[ derive( Diagnostic ) ]
2069
2069
#[ diag( parse_unknown_prefix) ]
2070
2070
#[ note]
2071
- pub struct UnknownPrefix < ' a > {
2071
+ pub ( crate ) struct UnknownPrefix < ' a > {
2072
2072
#[ primary_span]
2073
2073
#[ label]
2074
2074
pub span : Span ,
@@ -2079,12 +2079,12 @@ pub struct UnknownPrefix<'a> {
2079
2079
2080
2080
#[ derive( Subdiagnostic ) ]
2081
2081
#[ note( parse_macro_expands_to_adt_field) ]
2082
- pub struct MacroExpandsToAdtField < ' a > {
2082
+ pub ( crate ) struct MacroExpandsToAdtField < ' a > {
2083
2083
pub adt_ty : & ' a str ,
2084
2084
}
2085
2085
2086
2086
#[ derive( Subdiagnostic ) ]
2087
- pub enum UnknownPrefixSugg {
2087
+ pub ( crate ) enum UnknownPrefixSugg {
2088
2088
#[ suggestion(
2089
2089
parse_suggestion_br,
2090
2090
code = "br" ,
@@ -2114,15 +2114,15 @@ pub enum UnknownPrefixSugg {
2114
2114
2115
2115
#[ derive( Diagnostic ) ]
2116
2116
#[ diag( parse_too_many_hashes) ]
2117
- pub struct TooManyHashes {
2117
+ pub ( crate ) struct TooManyHashes {
2118
2118
#[ primary_span]
2119
2119
pub span : Span ,
2120
2120
pub num : u32 ,
2121
2121
}
2122
2122
2123
2123
#[ derive( Diagnostic ) ]
2124
2124
#[ diag( parse_unknown_start_of_token) ]
2125
- pub struct UnknownTokenStart {
2125
+ pub ( crate ) struct UnknownTokenStart {
2126
2126
#[ primary_span]
2127
2127
pub span : Span ,
2128
2128
pub escaped : String ,
@@ -2135,7 +2135,7 @@ pub struct UnknownTokenStart {
2135
2135
}
2136
2136
2137
2137
#[ derive( Subdiagnostic ) ]
2138
- pub enum TokenSubstitution {
2138
+ pub ( crate ) enum TokenSubstitution {
2139
2139
#[ suggestion(
2140
2140
parse_sugg_quotes,
2141
2141
code = "{suggestion}" ,
@@ -2168,16 +2168,16 @@ pub enum TokenSubstitution {
2168
2168
2169
2169
#[ derive( Subdiagnostic ) ]
2170
2170
#[ note( parse_note_repeats) ]
2171
- pub struct UnknownTokenRepeat {
2171
+ pub ( crate ) struct UnknownTokenRepeat {
2172
2172
pub repeats : usize ,
2173
2173
}
2174
2174
2175
2175
#[ derive( Subdiagnostic ) ]
2176
2176
#[ help( parse_help_null) ]
2177
- pub struct UnknownTokenNull ;
2177
+ pub ( crate ) struct UnknownTokenNull ;
2178
2178
2179
2179
#[ derive( Diagnostic ) ]
2180
- pub enum UnescapeError {
2180
+ pub ( crate ) enum UnescapeError {
2181
2181
#[ diag( parse_invalid_unicode_escape) ]
2182
2182
#[ help]
2183
2183
InvalidUnicodeEscape {
@@ -2322,7 +2322,7 @@ pub enum UnescapeError {
2322
2322
}
2323
2323
2324
2324
#[ derive( Subdiagnostic ) ]
2325
- pub enum MoreThanOneCharSugg {
2325
+ pub ( crate ) enum MoreThanOneCharSugg {
2326
2326
#[ suggestion(
2327
2327
parse_consider_normalized,
2328
2328
code = "{normalized}" ,
@@ -2370,7 +2370,7 @@ pub enum MoreThanOneCharSugg {
2370
2370
}
2371
2371
2372
2372
#[ derive( Subdiagnostic ) ]
2373
- pub enum MoreThanOneCharNote {
2373
+ pub ( crate ) enum MoreThanOneCharNote {
2374
2374
#[ note( parse_followed_by) ]
2375
2375
AllCombining {
2376
2376
#[ primary_span]
@@ -2388,7 +2388,7 @@ pub enum MoreThanOneCharNote {
2388
2388
}
2389
2389
2390
2390
#[ derive( Subdiagnostic ) ]
2391
- pub enum NoBraceUnicodeSub {
2391
+ pub ( crate ) enum NoBraceUnicodeSub {
2392
2392
#[ suggestion(
2393
2393
parse_use_braces,
2394
2394
code = "{suggestion}" ,
@@ -2703,7 +2703,7 @@ pub(crate) struct InvalidDynKeyword {
2703
2703
}
2704
2704
2705
2705
#[ derive( Subdiagnostic ) ]
2706
- pub enum HelpUseLatestEdition {
2706
+ pub ( crate ) enum HelpUseLatestEdition {
2707
2707
#[ help( parse_help_set_edition_cargo) ]
2708
2708
#[ note( parse_note_edition_guide) ]
2709
2709
Cargo { edition : Edition } ,
@@ -2713,7 +2713,7 @@ pub enum HelpUseLatestEdition {
2713
2713
}
2714
2714
2715
2715
impl HelpUseLatestEdition {
2716
- pub fn new ( ) -> Self {
2716
+ pub ( crate ) fn new ( ) -> Self {
2717
2717
let edition = LATEST_STABLE_EDITION ;
2718
2718
if rustc_session:: utils:: was_invoked_from_cargo ( ) {
2719
2719
Self :: Cargo { edition }
@@ -2725,7 +2725,7 @@ impl HelpUseLatestEdition {
2725
2725
2726
2726
#[ derive( Diagnostic ) ]
2727
2727
#[ diag( parse_box_syntax_removed) ]
2728
- pub struct BoxSyntaxRemoved {
2728
+ pub ( crate ) struct BoxSyntaxRemoved {
2729
2729
#[ primary_span]
2730
2730
pub span : Span ,
2731
2731
#[ subdiagnostic]
@@ -2738,7 +2738,7 @@ pub struct BoxSyntaxRemoved {
2738
2738
applicability = "machine-applicable" ,
2739
2739
style = "verbose"
2740
2740
) ]
2741
- pub struct AddBoxNew {
2741
+ pub ( crate ) struct AddBoxNew {
2742
2742
#[ suggestion_part( code = "Box::new(" ) ]
2743
2743
pub box_kw_and_lo : Span ,
2744
2744
#[ suggestion_part( code = ")" ) ]
@@ -3190,7 +3190,7 @@ pub(crate) struct DotDotRangeAttribute {
3190
3190
#[ derive( Diagnostic ) ]
3191
3191
#[ diag( parse_invalid_attr_unsafe) ]
3192
3192
#[ note]
3193
- pub struct InvalidAttrUnsafe {
3193
+ pub ( crate ) struct InvalidAttrUnsafe {
3194
3194
#[ primary_span]
3195
3195
#[ label]
3196
3196
pub span : Span ,
@@ -3199,7 +3199,7 @@ pub struct InvalidAttrUnsafe {
3199
3199
3200
3200
#[ derive( Diagnostic ) ]
3201
3201
#[ diag( parse_unsafe_attr_outside_unsafe) ]
3202
- pub struct UnsafeAttrOutsideUnsafe {
3202
+ pub ( crate ) struct UnsafeAttrOutsideUnsafe {
3203
3203
#[ primary_span]
3204
3204
#[ label]
3205
3205
pub span : Span ,
@@ -3212,7 +3212,7 @@ pub struct UnsafeAttrOutsideUnsafe {
3212
3212
parse_unsafe_attr_outside_unsafe_suggestion,
3213
3213
applicability = "machine-applicable"
3214
3214
) ]
3215
- pub struct UnsafeAttrOutsideUnsafeSuggestion {
3215
+ pub ( crate ) struct UnsafeAttrOutsideUnsafeSuggestion {
3216
3216
#[ suggestion_part( code = "unsafe(" ) ]
3217
3217
pub left : Span ,
3218
3218
#[ suggestion_part( code = ")" ) ]
@@ -3221,7 +3221,7 @@ pub struct UnsafeAttrOutsideUnsafeSuggestion {
3221
3221
3222
3222
#[ derive( Diagnostic ) ]
3223
3223
#[ diag( parse_binder_before_modifiers) ]
3224
- pub struct BinderBeforeModifiers {
3224
+ pub ( crate ) struct BinderBeforeModifiers {
3225
3225
#[ primary_span]
3226
3226
pub binder_span : Span ,
3227
3227
#[ label]
@@ -3230,7 +3230,7 @@ pub struct BinderBeforeModifiers {
3230
3230
3231
3231
#[ derive( Diagnostic ) ]
3232
3232
#[ diag( parse_binder_and_polarity) ]
3233
- pub struct BinderAndPolarity {
3233
+ pub ( crate ) struct BinderAndPolarity {
3234
3234
#[ primary_span]
3235
3235
pub polarity_span : Span ,
3236
3236
#[ label]
@@ -3240,7 +3240,7 @@ pub struct BinderAndPolarity {
3240
3240
3241
3241
#[ derive( Diagnostic ) ]
3242
3242
#[ diag( parse_modifiers_and_polarity) ]
3243
- pub struct PolarityAndModifiers {
3243
+ pub ( crate ) struct PolarityAndModifiers {
3244
3244
#[ primary_span]
3245
3245
pub polarity_span : Span ,
3246
3246
#[ label]
0 commit comments