Skip to content

Unnecessary indentation for a commented block of code #2949

@scampi

Description

@scampi

In PR #2925 an integration test on the packed_simd code base failed with the following:

Diff in /home/yfful/documents/code/rustfmt/packed_simd/src/api/from/from_vector.rs at line 18:
         }
 
         // FIXME: `Into::into` is not inline, but due to
-                                                // the blanket impl in `std`, which is not
-                                                // marked `default`, we cannot override it here with
-                                                // specialization.
-                                                /*
-                                                impl Into<$id> for $source {
-                                                    #[inline]
-                                                    fn into(self) -> $id {
-                                                        unsafe { simd_cast(self) }
-                                                    }
-                                                }
-                                                */
+                                                        // the blanket impl in `std`, which is not
+                                                        // marked `default`, we cannot override it here with
+                                                        // specialization.
+                                                        /*
+                                                        impl Into<$id> for $source {
+                                                            #[inline]
+                                                            fn into(self) -> $id {
+                                                                unsafe { simd_cast(self) }
+                                                            }
+                                                        }
+                                                        */

This can be seen when running cargo fmt --all -- --check against
rust-lang/packed_simd@1a6450d

The commented block should not have the extra indentation, i.e., it would be nicer if it were like below:

         }

         // FIXME: `Into::into` is not inline, but due to
         // the blanket impl in `std`, which is not
         // marked `default`, we cannot override it here with
         // specialization.
         /*
         impl Into<$id> for $source {
             #[inline]
             fn into(self) -> $id {
                 unsafe { simd_cast(self) }
             }
         }
         */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions