@@ -1494,8 +1494,9 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14941494
14951495 let ty = cx. tcx . type_of ( item. owner_id ) . skip_binder ( ) ;
14961496 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;`.
14991500 return ;
15001501 }
15011502
@@ -2210,7 +2211,8 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
22102211 hir_generics. span . shrink_to_hi ( ) . to ( where_span)
22112212 } ;
22122213
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.
22142216 if where_lint_spans. iter ( ) . all ( |& sp| full_where_span. contains ( sp) ) {
22152217 lint_spans. push ( full_where_span) ;
22162218 } else {
@@ -2587,7 +2589,8 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
25872589 } ;
25882590 // So we have at least one potentially inhabited variant. Might we have two?
25892591 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!
25912594 return variant_find_init_error (
25922595 cx,
25932596 ty,
@@ -2597,10 +2600,10 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
25972600 init,
25982601 ) ;
25992602 } ;
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.)
26042607 if init == InitKind :: Uninit {
26052608 let definitely_inhabited = ( first_variant. 1 as usize )
26062609 + ( second_variant. 1 as usize )
@@ -2811,7 +2814,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28112814
28122815 let mut found_labels = Vec :: new ( ) ;
28132816
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.
28152819 let statements = template_str. split ( |c| matches ! ( c, '\n' | ';' ) ) ;
28162820 for statement in statements {
28172821 // If there's a comment, trim it from the statement
@@ -2824,7 +2828,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28242828 let mut chars = possible_label. chars ( ) ;
28252829
28262830 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.
28282833 break ' label_loop;
28292834 } ;
28302835
@@ -2841,12 +2846,15 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28412846
28422847 // Labels continue with ASCII alphanumeric characters, _, or $
28432848 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.
28472854 if !raw && in_bracket {
28482855 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.
28502858 break ' label_loop;
28512859 }
28522860
@@ -2859,7 +2867,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28592867 in_bracket = true ;
28602868 } else {
28612869 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.
28632872 break ' label_loop;
28642873 }
28652874 }
@@ -2878,7 +2887,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28782887 . into_iter ( )
28792888 . filter_map ( |label| find_label_span ( label) )
28802889 . 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.
28822892 let target_spans: MultiSpan =
28832893 if spans. len ( ) > 0 { spans. into ( ) } else { ( * template_span) . into ( ) } ;
28842894
0 commit comments