Skip to content

Commit

Permalink
Add span to warning about incr. comp. vs Token::Interpolated.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Nov 18, 2016
1 parent 52d250e commit c722a1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/librustc_incremental/calculate_svh/svh_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
match *tt {
tokenstream::TokenTree::Token(span, ref token) => {
hash_span!(self, span);
self.hash_token(token);
self.hash_token(token, span);
}
tokenstream::TokenTree::Delimited(span, ref delimited) => {
hash_span!(self, span);
Expand Down Expand Up @@ -978,15 +978,17 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
}
self.hash_discriminant(separator);
if let Some(ref separator) = *separator {
self.hash_token(separator);
self.hash_token(separator, span);
}
op.hash(self.st);
num_captures.hash(self.st);
}
}
}

fn hash_token(&mut self, token: &token::Token) {
fn hash_token(&mut self,
token: &token::Token,
error_reporting_span: Span) {
self.hash_discriminant(token);
match *token {
token::Token::Eq |
Expand Down Expand Up @@ -1061,7 +1063,7 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
let msg = format!("Quasi-quoting might make incremental \
compilation very inefficient: {:?}",
non_terminal);
self.tcx.sess.warn(&msg[..]);
self.tcx.sess.span_warn(error_reporting_span, &msg[..]);
}

non_terminal.hash(self.st);
Expand Down

0 comments on commit c722a1e

Please sign in to comment.