Sort MultiSpans on creation

This commit is contained in:
Esteban Küber 2020-04-22 17:15:34 -07:00
parent 59c816d58b
commit 25f8966b5a
3 changed files with 5 additions and 4 deletions

View File

@ -657,7 +657,8 @@ impl MultiSpan {
MultiSpan { primary_spans: vec![primary_span], span_labels: vec![] }
}
pub fn from_spans(vec: Vec<Span>) -> MultiSpan {
pub fn from_spans(mut vec: Vec<Span>) -> MultiSpan {
vec.sort();
MultiSpan { primary_spans: vec, span_labels: vec![] }
}

View File

@ -25,13 +25,13 @@ LL | default impl !Send for Z {}
| default because of this
error[E0750]: negative impls cannot be default impls
--> $DIR/validation.rs:10:14
--> $DIR/validation.rs:10:1
|
LL | default impl !Send for Z {}
| ^^^^^^^ ^
error[E0750]: negative impls cannot be default impls
--> $DIR/validation.rs:14:14
--> $DIR/validation.rs:14:1
|
LL | default impl !Tr for S {}
| ^^^^^^^ ^

View File

@ -1,5 +1,5 @@
error[E0750]: negative impls cannot be default impls
--> $DIR/negative-default-impls.rs:8:14
--> $DIR/negative-default-impls.rs:8:1
|
LL | default impl !MyTrait for u32 {}
| ^^^^^^^ ^