@@ -1494,8 +1494,9 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
1494
1494
1495
1495
let ty = cx. tcx . type_of ( item. owner_id ) . skip_binder ( ) ;
1496
1496
if ty. has_inherent_projections ( ) {
1497
- // Bounds of type aliases that contain opaque types or inherent projections are respected.
1498
- // E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`, `type X = Type::Inherent;`.
1497
+ // Bounds of type aliases that contain opaque types or inherent projections are
1498
+ // respected. E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`, `type X =
1499
+ // Type::Inherent;`.
1499
1500
return ;
1500
1501
}
1501
1502
@@ -2224,7 +2225,8 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
2224
2225
hir_generics. span . shrink_to_hi ( ) . to ( where_span)
2225
2226
} ;
2226
2227
2227
- // Due to macro expansions, the `full_where_span` might not actually contain all predicates.
2228
+ // Due to macro expansions, the `full_where_span` might not actually contain all
2229
+ // predicates.
2228
2230
if where_lint_spans. iter ( ) . all ( |& sp| full_where_span. contains ( sp) ) {
2229
2231
lint_spans. push ( full_where_span) ;
2230
2232
} else {
@@ -2601,7 +2603,8 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
2601
2603
} ;
2602
2604
// So we have at least one potentially inhabited variant. Might we have two?
2603
2605
let Some ( second_variant) = potential_variants. next ( ) else {
2604
- // There is only one potentially inhabited variant. So we can recursively check that variant!
2606
+ // There is only one potentially inhabited variant. So we can recursively
2607
+ // check that variant!
2605
2608
return variant_find_init_error (
2606
2609
cx,
2607
2610
ty,
@@ -2611,10 +2614,10 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
2611
2614
init,
2612
2615
) ;
2613
2616
} ;
2614
- // So we have at least two potentially inhabited variants.
2615
- // If we can prove that we have at least two *definitely* inhabited variants,
2616
- // then we have a tag and hence leaving this uninit is definitely disallowed.
2617
- // (Leaving it zeroed could be okay, depending on which variant is encoded as zero tag.)
2617
+ // So we have at least two potentially inhabited variants. If we can prove that
2618
+ // we have at least two *definitely* inhabited variants, then we have a tag and
2619
+ // hence leaving this uninit is definitely disallowed. (Leaving it zeroed could
2620
+ // be okay, depending on which variant is encoded as zero tag.)
2618
2621
if init == InitKind :: Uninit {
2619
2622
let definitely_inhabited = ( first_variant. 1 as usize )
2620
2623
+ ( second_variant. 1 as usize )
@@ -2825,7 +2828,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2825
2828
2826
2829
let mut found_labels = Vec :: new ( ) ;
2827
2830
2828
- // A semicolon might not actually be specified as a separator for all targets, but it seems like LLVM accepts it always
2831
+ // A semicolon might not actually be specified as a separator for all targets, but
2832
+ // it seems like LLVM accepts it always.
2829
2833
let statements = template_str. split ( |c| matches ! ( c, '\n' | ';' ) ) ;
2830
2834
for statement in statements {
2831
2835
// If there's a comment, trim it from the statement
@@ -2838,7 +2842,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2838
2842
let mut chars = possible_label. chars ( ) ;
2839
2843
2840
2844
let Some ( start) = chars. next ( ) else {
2841
- // Empty string means a leading ':' in this section, which is not a label.
2845
+ // Empty string means a leading ':' in this section, which is not a
2846
+ // label.
2842
2847
break ' label_loop;
2843
2848
} ;
2844
2849
@@ -2855,12 +2860,15 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2855
2860
2856
2861
// Labels continue with ASCII alphanumeric characters, _, or $
2857
2862
for c in chars {
2858
- // Inside a template format arg, any character is permitted for the puproses of label detection
2859
- // because we assume that it can be replaced with some other valid label string later.
2860
- // `options(raw)` asm blocks cannot have format args, so they are excluded from this special case.
2863
+ // Inside a template format arg, any character is permitted for the
2864
+ // puproses of label detection because we assume that it can be
2865
+ // replaced with some other valid label string later. `options(raw)`
2866
+ // asm blocks cannot have format args, so they are excluded from this
2867
+ // special case.
2861
2868
if !raw && in_bracket {
2862
2869
if c == '{' {
2863
- // Nested brackets are not allowed in format args, this cannot be a label.
2870
+ // Nested brackets are not allowed in format args, this cannot
2871
+ // be a label.
2864
2872
break ' label_loop;
2865
2873
}
2866
2874
@@ -2873,7 +2881,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2873
2881
in_bracket = true ;
2874
2882
} else {
2875
2883
if !( c. is_ascii_alphanumeric ( ) || matches ! ( c, '_' | '$' ) ) {
2876
- // The potential label had an invalid character inside it, it cannot be a label.
2884
+ // The potential label had an invalid character inside it, it
2885
+ // cannot be a label.
2877
2886
break ' label_loop;
2878
2887
}
2879
2888
}
@@ -2892,7 +2901,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2892
2901
. into_iter ( )
2893
2902
. filter_map ( |label| find_label_span ( label) )
2894
2903
. collect :: < Vec < Span > > ( ) ;
2895
- // If there were labels but we couldn't find a span, combine the warnings and use the template span
2904
+ // If there were labels but we couldn't find a span, combine the warnings and
2905
+ // use the template span.
2896
2906
let target_spans: MultiSpan =
2897
2907
if spans. len ( ) > 0 { spans. into ( ) } else { ( * template_span) . into ( ) } ;
2898
2908
0 commit comments