Use multispan

This commit is contained in:
Yuki OKUSHI 2019-04-30 21:28:13 +09:00
parent bb3549fce2
commit f56d285443

View file

@ -20,7 +20,7 @@ use syntax::ptr::P;
use syntax::visit::{self, Visitor};
use syntax::{span_err, struct_span_err, walk_list};
use syntax_ext::proc_macro_decls::is_proc_macro_attr;
use syntax_pos::Span;
use syntax_pos::{Span, MultiSpan};
use errors::Applicability;
use log::debug;
@ -682,7 +682,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
ItemKind::Existential(ref bounds, _) => {
if !bounds.iter()
.any(|b| if let GenericBound::Trait(..) = *b { true } else { false }) {
self.err_handler().span_err(item.span, "at least one trait must be specified");
let msp = MultiSpan::from_spans(bounds.iter()
.map(|bound| bound.span()).collect());
self.err_handler().span_err(msp, "at least one trait must be specified");
}
}
_ => {}