Sort valid labels in UnknownLabels error test so the order always matches
@@ -2609,11 +2609,11 @@ fn x() {
let x = X(a: 1, c: 2.0)
x
}"#,
- Error::UnknownLabels {
+ sort_options(Error::UnknownLabels {
unknown: vec![("c".to_string(), SrcSpan { start: 60, end: 66 })],
valid: vec!["a".to_string(), "b".to_string()],
supplied: vec!["a".to_string()],
- }
+ })
);
}
@@ -2740,6 +2740,19 @@ fn sort_options(e: Error) -> Error {
}
}
+ Error::UnknownLabels {
+ unknown,
+ mut valid,
+ supplied,
+ } => {
+ valid.sort();
+ Error::UnknownLabels {
+ unknown,
+ valid,
+ supplied,
+ }
+ }
+
_ => e,
}
}
