Skip to content

Commit f56d285

Browse files
committed
Use multispan
1 parent bb3549f commit f56d285

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustc_passes/ast_validation.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax::ptr::P;
2020
use syntax::visit::{self, Visitor};
2121
use syntax::{span_err, struct_span_err, walk_list};
2222
use syntax_ext::proc_macro_decls::is_proc_macro_attr;
23-
use syntax_pos::Span;
23+
use syntax_pos::{Span, MultiSpan};
2424
use errors::Applicability;
2525
use log::debug;
2626

@@ -682,7 +682,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
682682
ItemKind::Existential(ref bounds, _) => {
683683
if !bounds.iter()
684684
.any(|b| if let GenericBound::Trait(..) = *b { true } else { false }) {
685-
self.err_handler().span_err(item.span, "at least one trait must be specified");
685+
let msp = MultiSpan::from_spans(bounds.iter()
686+
.map(|bound| bound.span()).collect());
687+
self.err_handler().span_err(msp, "at least one trait must be specified");
686688
}
687689
}
688690
_ => {}

0 commit comments

Comments
 (0)