@@ -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
@@ -2224,7 +2225,8 @@ impl<'tcx> LateLintPass<'tcx> for ExplicitOutlivesRequirements {
22242225 hir_generics. span . shrink_to_hi ( ) . to ( where_span)
22252226 } ;
22262227
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.
22282230 if where_lint_spans. iter ( ) . all ( |& sp| full_where_span. contains ( sp) ) {
22292231 lint_spans. push ( full_where_span) ;
22302232 } else {
@@ -2601,7 +2603,8 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
26012603 } ;
26022604 // So we have at least one potentially inhabited variant. Might we have two?
26032605 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!
26052608 return variant_find_init_error (
26062609 cx,
26072610 ty,
@@ -2611,10 +2614,10 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
26112614 init,
26122615 ) ;
26132616 } ;
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.)
26182621 if init == InitKind :: Uninit {
26192622 let definitely_inhabited = ( first_variant. 1 as usize )
26202623 + ( second_variant. 1 as usize )
@@ -2825,7 +2828,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28252828
28262829 let mut found_labels = Vec :: new ( ) ;
28272830
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.
28292833 let statements = template_str. split ( |c| matches ! ( c, '\n' | ';' ) ) ;
28302834 for statement in statements {
28312835 // If there's a comment, trim it from the statement
@@ -2838,7 +2842,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28382842 let mut chars = possible_label. chars ( ) ;
28392843
28402844 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.
28422847 break ' label_loop;
28432848 } ;
28442849
@@ -2855,12 +2860,15 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28552860
28562861 // Labels continue with ASCII alphanumeric characters, _, or $
28572862 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.
28612868 if !raw && in_bracket {
28622869 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.
28642872 break ' label_loop;
28652873 }
28662874
@@ -2873,7 +2881,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28732881 in_bracket = true ;
28742882 } else {
28752883 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.
28772886 break ' label_loop;
28782887 }
28792888 }
@@ -2892,7 +2901,8 @@ impl<'tcx> LateLintPass<'tcx> for NamedAsmLabels {
28922901 . into_iter ( )
28932902 . filter_map ( |label| find_label_span ( label) )
28942903 . 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.
28962906 let target_spans: MultiSpan =
28972907 if spans. len ( ) > 0 { spans. into ( ) } else { ( * template_span) . into ( ) } ;
28982908
0 commit comments