20:21, 8 February 2023, "Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>:

Dmitry Gutov <dgutov@yandex.ru> writes:

 1. Have some buffer with text

 "use std::Path::{self, Path, PathBuf}; // good: std is a crate name
 ... (maybe something else
 "

 2. Have this text in a different buffer (I used scratch):

 "


 let date = DateTime::<chrono::Utc>::from_utc(date, chrono::Utc);
 "

 Meaning, the buffer starts with two empty lines.

 3. Select the first line from the first buffer including the trailing newline,
 yank and then paste at the beginning of the second buffer.

 The second buffer will now look like this:

 "use std::Path::{self, Path, PathBuf}; // good: std is a crate name


 let date = DateTime::<chrono::Utc>::from_utc(date, chrono::Utc);
 "


I just want to confirm that I can reproduce this, and that if you skip
the trailing newline from the use-statement, I don't get this behavior.
So it seems like the newline is the crucial point, right?


Yes, same.

Thr trailing newline is necessary.

The empty lines at the beginning of the buffer (being copied to) are necessary to reproduce this as well.