We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 928b956 + 8d143cc commit 18a28a1Copy full SHA for 18a28a1
src/cargo/core/features.rs
@@ -687,6 +687,26 @@ macro_rules! unstable_cli_options {
687
fields
688
}
689
690
+
691
+ #[cfg(test)]
692
+ mod test {
693
+ #[test]
694
+ fn ensure_sorted() {
695
+ // This will be printed out if the fields are not sorted.
696
+ let location = std::panic::Location::caller();
697
+ println!(
698
+ "\nTo fix this test, sort the features inside the macro at {}:{}\n",
699
+ location.file(),
700
+ location.line()
701
+ );
702
+ let mut expected = vec![$(stringify!($element)),*];
703
+ expected[2..].sort();
704
+ snapbox::assert_eq(
705
+ format!("{:#?}", expected),
706
+ format!("{:#?}", vec![$(stringify!($element)),*])
707
708
+ }
709
710
711
712
0 commit comments