@@ -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
@@ -2210,7 +2211,8 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
2210
2211
hir_generics. span . shrink_to_hi ( ) . to ( where_span)
2211
2212
} ;
2212
2213
2213
- // Due to macro expansions, the `full_where_span` might not actually contain all predicates.
2214
+ // Due to macro expansions, the `full_where_span` might not actually contain all
2215
+ // predicates.
2214
2216
if where_lint_spans. iter ( ) . all ( |& sp| full_where_span. contains ( sp) ) {
2215
2217
lint_spans. push ( full_where_span) ;
2216
2218
} else {
@@ -2587,7 +2589,8 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
2587
2589
} ;
2588
2590
// So we have at least one potentially inhabited variant. Might we have two?
2589
2591
let Some ( second_variant) = potential_variants. next ( ) else {
2590
- // There is only one potentially inhabited variant. So we can recursively check that variant!
2592
+ // There is only one potentially inhabited variant. So we can recursively
2593
+ // check that variant!
2591
2594
return variant_find_init_error (
2592
2595
cx,
2593
2596
ty,
@@ -2597,10 +2600,10 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
2597
2600
init,
2598
2601
) ;
2599
2602
} ;
2600
- // So we have at least two potentially inhabited variants.
2601
- // If we can prove that we have at least two *definitely* inhabited variants,
2602
- // then we have a tag and hence leaving this uninit is definitely disallowed.
2603
- // (Leaving it zeroed could be okay, depending on which variant is encoded as zero tag.)
2603
+ // So we have at least two potentially inhabited variants. If we can prove that
2604
+ // we have at least two *definitely* inhabited variants, then we have a tag and
2605
+ // hence leaving this uninit is definitely disallowed. (Leaving it zeroed could
2606
+ // be okay, depending on which variant is encoded as zero tag.)
2604
2607
if init == InitKind :: Uninit {
2605
2608
let definitely_inhabited = ( first_variant. 1 as usize )
2606
2609
+ ( second_variant. 1 as usize )
@@ -2811,7 +2814,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2811
2814
2812
2815
let mut found_labels = Vec :: new ( ) ;
2813
2816
2814
- // A semicolon might not actually be specified as a separator for all targets, but it seems like LLVM accepts it always
2817
+ // A semicolon might not actually be specified as a separator for all targets, but
2818
+ // it seems like LLVM accepts it always.
2815
2819
let statements = template_str. split ( |c| matches ! ( c, '\n' | ';' ) ) ;
2816
2820
for statement in statements {
2817
2821
// If there's a comment, trim it from the statement
@@ -2824,7 +2828,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2824
2828
let mut chars = possible_label. chars ( ) ;
2825
2829
2826
2830
let Some ( start) = chars. next ( ) else {
2827
- // Empty string means a leading ':' in this section, which is not a label.
2831
+ // Empty string means a leading ':' in this section, which is not a
2832
+ // label.
2828
2833
break ' label_loop;
2829
2834
} ;
2830
2835
@@ -2841,12 +2846,15 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2841
2846
2842
2847
// Labels continue with ASCII alphanumeric characters, _, or $
2843
2848
for c in chars {
2844
- // Inside a template format arg, any character is permitted for the puproses of label detection
2845
- // because we assume that it can be replaced with some other valid label string later.
2846
- // `options(raw)` asm blocks cannot have format args, so they are excluded from this special case.
2849
+ // Inside a template format arg, any character is permitted for the
2850
+ // puproses of label detection because we assume that it can be
2851
+ // replaced with some other valid label string later. `options(raw)`
2852
+ // asm blocks cannot have format args, so they are excluded from this
2853
+ // special case.
2847
2854
if !raw && in_bracket {
2848
2855
if c == '{' {
2849
- // Nested brackets are not allowed in format args, this cannot be a label.
2856
+ // Nested brackets are not allowed in format args, this cannot
2857
+ // be a label.
2850
2858
break ' label_loop;
2851
2859
}
2852
2860
@@ -2859,7 +2867,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2859
2867
in_bracket = true ;
2860
2868
} else {
2861
2869
if !( c. is_ascii_alphanumeric ( ) || matches ! ( c, '_' | '$' ) ) {
2862
- // The potential label had an invalid character inside it, it cannot be a label.
2870
+ // The potential label had an invalid character inside it, it
2871
+ // cannot be a label.
2863
2872
break ' label_loop;
2864
2873
}
2865
2874
}
@@ -2878,7 +2887,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
2878
2887
. into_iter ( )
2879
2888
. filter_map ( |label| find_label_span ( label) )
2880
2889
. collect :: < Vec < Span > > ( ) ;
2881
- // If there were labels but we couldn't find a span, combine the warnings and use the template span
2890
+ // If there were labels but we couldn't find a span, combine the warnings and
2891
+ // use the template span.
2882
2892
let target_spans: MultiSpan =
2883
2893
if spans. len ( ) > 0 { spans. into ( ) } else { ( * template_span) . into ( ) } ;
2884
2894
0 commit comments