Skip to content

Commit

Permalink
Use multispan
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Apr 30, 2019
1 parent bb3549f commit f56d285
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_passes/ast_validation.rs
Expand Up @@ -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;

Expand Down Expand Up @@ -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");
}
}
_ => {}
Expand Down

0 comments on commit f56d285

Please sign in to comment.