Open ajewellamz opened 3 days ago
Hey @ajewellamz what exact version of cargo fmt / rustfmt are you using. You can run cargo fmt --version
to get that info.
Also, any chance you can get this down to a reproducible code snippet that you can add inline? That would be best. rustfmt can run just fine on code that doesn't compile (as long as it parses) so my suggestion would be to slowly remove function, struct, enum, macro, and trait definitions / impls from the file until you're able to narrow down what's causing the issue. It would be a great help 🙏🏼
rustfmt 1.7.1-stable (eeb90cda 2024-09-04)
I won't be able to do any work on this until next week at the earliest. I was assuming you could just run it in the debugger or something, if you had a fail case.
Ok, here's a minimal fail case. I've tried deleting various parts, and it seems to always succeed.
pub use ::dafny_runtime::Sequence;
pub use ::std::rc::Rc;
pub use crate::r#_StructuredEncryptionUtil_Compile::CanonCryptoItem;
pub use ::dafny_runtime::itertools::Itertools;
pub use crate::software::amazon::cryptography::dbencryptionsdk::structuredencryption::internaldafny::types::CryptoAction;
pub use crate::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
pub use ::dafny_runtime::Object;
pub use crate::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
pub use crate::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
pub use ::dafny_runtime::DafnyCharUTF16;
pub use crate::r#_StructuredEncryptionUtil_Compile::MessageID;
pub use crate::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
pub use crate::r#_Wrappers_Compile::Outcome;
pub use ::dafny_runtime::string_utf16_of;
pub use ::dafny_runtime::int;
pub use ::dafny_runtime::MapBuilder;
pub use ::dafny_runtime::_System::nat;
pub use crate::software::amazon::cryptography::primitives::internaldafny::types::HMacInput;
pub use ::dafny_runtime::rd;
pub use ::dafny_runtime::truncate;
pub use ::dafny_runtime::DafnyTypeEq;
pub use ::dafny_runtime::DafnyType;
Thanks! confirming that with rustfmt +1.81
(rustfmt 1.7.1-stable (eeb90cda 2024-09-04)
) I'm able to reproduce the panic with the above example:
lib.rs.gz
Un-gzip the attached lib.rs make it the only file in a crate run
cargo fmt
SeeAs an aside - with previous versions of Rust, cargo fmt also failed on this file. It didn't crash, but it left trailing spaces on some lines, and then reported failure.