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