Use multispan
This commit is contained in:
parent
bb3549fce2
commit
f56d285443
1 changed files with 4 additions and 2 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue