-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustfmt formats a macro when it should not #6418
Comments
cc @ytmimi |
@jaskij any chance you've got a global I created a local file #[derive(Debug, Clone, Eq, PartialEq)]
pub struct Item {
pub first_long_name_a: u16,
pub item_count: u16,
pub area: u16,
pub address: u16,
}
#[cfg(test)]
mod tests {
use proptest::prelude::*;
use super::Item;
proptest! {
#[test]
fn read_item_chars(s in "\\PC*") {
let pi = Item {
first_long_name_a: 0,item_count: 0,area: 0,address: 0
};
}
}
} And when I build and run rustfmt locally (from commit 8a2c073 and executing the command I'm also unable to see any changes in the file content when running with |
Having poked it around - this may look like a bug but probably isn't. I'm not sure. What I have found out:
I have added more files in that repro repository, ones that do get formatted. Edit: Almost forgot, no, no global config file whatsoever. Running current master (
|
rustfmt
is formatting - changing indentation - inside a macro, in what is not valid Rust code.In the code below, if you change the indentation inside the
proptest!
macro,rustfmt
will change it back to the way it is currently, when it should not. Repo with the repro.Tested on both 1.82 and nightly.
The text was updated successfully, but these errors were encountered: