-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Labels
A-outputArea: Outputting TOMLArea: Outputting TOMLC-bugCategory: Things not working as expectedCategory: Things not working as expected
Description
Repro that just round-trips some toml:
[dependencies]
pretty_assertions = "=1.3.0"
toml_edit = "=0.21.1"
#[test]
fn toml_edit_bug() {
use pretty_assertions::assert_eq;
let text = r###"
[workspace.lints]
rust.unsafe_op_in_unsafe_fn = "deny"
rust.explicit_outlives_requirements = "warn"
# rust.unused_crate_dependencies = "warn"
clippy.cast_lossless = "warn"
clippy.doc_markdown = "warn"
clippy.exhaustive_enums = "warn"
"###;
let manifest: toml_edit::Document = text.parse().unwrap();
assert_eq!(text, manifest.to_string());
}
The text should be identical, but it is not. Specifically, the whitespace between the first two items is deleted, and the comment and whitespace are duplicated between all following pairs of items.
[workspace.lints]
rust.unsafe_op_in_unsafe_fn = "deny"
-
rust.explicit_outlives_requirements = "warn"
# rust.unused_crate_dependencies = "warn"
clippy.cast_lossless = "warn"
+# rust.unused_crate_dependencies = "warn"
+
clippy.doc_markdown = "warn"
+# rust.unused_crate_dependencies = "warn"
+
clippy.exhaustive_enums = "warn"
The same behavior happens with toml_edit
0.19.15, so this is not a new bug.
Metadata
Metadata
Assignees
Labels
A-outputArea: Outputting TOMLArea: Outputting TOMLC-bugCategory: Things not working as expectedCategory: Things not working as expected