You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat fmt-comment-trouble.rs
const RLIB_CRATE_TYPES: [&str; 2] = [
// https://doc.rust-lang.org/nightly/reference/linkage.html#r-link.lib
// says:
//
// > The purpose of this generic lib option is to generate
// > the “compiler recommended” style of library.
//
// For us this means `Rlib`.
"lib",
// Naturally "rlib" maps to `LibType::Rlib`.
"rlib",
];
lukasza2 in /usr/local/google/home/lukasza/scratch
$ rustfmt --version
rustfmt 1.8.0-nightly (3ea711f17e 2025-03-09)
lukasza2 in /usr/local/google/home/lukasza/scratch
$ rustfmt fmt-comment-trouble.rs
Warning: the `fn_args_layout` option is deprecated. Use `fn_params_layout`. instead
Warning: the `version` option is deprecated. Use `style_edition` instead.
lukasza2 in /usr/local/google/home/lukasza/scratch
$ cat fmt-comment-trouble.rs
const RLIB_CRATE_TYPES: [&str; 2] = [
// https://doc.rust-lang.org/nightly/reference/linkage.html#r-link.lib
// says:
//
// > The purpose of this generic lib option is to generate
// > the “compiler recommended” style of library.
//
// For us this means `Rlib`.
"lib", // Naturally "rlib" maps to `LibType::Rlib`.
"rlib",
];
EXPECTED BEHAVIOR: // Naturally "rlib" maps to LibType::Rlib. stays below"lib" and above"rlibs".
ACTUAL BEHAVIOR: The comment is no longer on a separate line - the comment got transformed into a trailing comment that seems to apply to "lib" rather than to "rlib".
The text was updated successfully, but these errors were encountered:
REPRO:
EXPECTED BEHAVIOR:
// Naturally "rlib" maps to LibType::Rlib.
stays below"lib"
and above"rlibs"
.ACTUAL BEHAVIOR: The comment is no longer on a separate line - the comment got transformed into a trailing comment that seems to apply to
"lib"
rather than to"rlib"
.The text was updated successfully, but these errors were encountered: