diff --git a/src/librustc_span/lib.rs b/src/librustc_span/lib.rs index 85a870ae34c..e8252d96350 100644 --- a/src/librustc_span/lib.rs +++ b/src/librustc_span/lib.rs @@ -657,7 +657,8 @@ impl MultiSpan { MultiSpan { primary_spans: vec![primary_span], span_labels: vec![] } } - pub fn from_spans(vec: Vec) -> MultiSpan { + pub fn from_spans(mut vec: Vec) -> MultiSpan { + vec.sort(); MultiSpan { primary_spans: vec, span_labels: vec![] } } diff --git a/src/test/ui/specialization/defaultimpl/validation.stderr b/src/test/ui/specialization/defaultimpl/validation.stderr index 9bf59bd4f63..254eaf51a64 100644 --- a/src/test/ui/specialization/defaultimpl/validation.stderr +++ b/src/test/ui/specialization/defaultimpl/validation.stderr @@ -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 {} | ^^^^^^^ ^ diff --git a/src/test/ui/traits/negative-impls/negative-default-impls.stderr b/src/test/ui/traits/negative-impls/negative-default-impls.stderr index d2423d01a9a..a70bbe6b948 100644 --- a/src/test/ui/traits/negative-impls/negative-default-impls.stderr +++ b/src/test/ui/traits/negative-impls/negative-default-impls.stderr @@ -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 {} | ^^^^^^^ ^