Skip to content

Commit c722a1e

Browse files
Add span to warning about incr. comp. vs Token::Interpolated.
1 parent 52d250e commit c722a1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/librustc_incremental/calculate_svh/svh_visitor.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
944944
match *tt {
945945
tokenstream::TokenTree::Token(span, ref token) => {
946946
hash_span!(self, span);
947-
self.hash_token(token);
947+
self.hash_token(token, span);
948948
}
949949
tokenstream::TokenTree::Delimited(span, ref delimited) => {
950950
hash_span!(self, span);
@@ -978,15 +978,17 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
978978
}
979979
self.hash_discriminant(separator);
980980
if let Some(ref separator) = *separator {
981-
self.hash_token(separator);
981+
self.hash_token(separator, span);
982982
}
983983
op.hash(self.st);
984984
num_captures.hash(self.st);
985985
}
986986
}
987987
}
988988

989-
fn hash_token(&mut self, token: &token::Token) {
989+
fn hash_token(&mut self,
990+
token: &token::Token,
991+
error_reporting_span: Span) {
990992
self.hash_discriminant(token);
991993
match *token {
992994
token::Token::Eq |
@@ -1061,7 +1063,7 @@ impl<'a, 'hash, 'tcx> StrictVersionHashVisitor<'a, 'hash, 'tcx> {
10611063
let msg = format!("Quasi-quoting might make incremental \
10621064
compilation very inefficient: {:?}",
10631065
non_terminal);
1064-
self.tcx.sess.warn(&msg[..]);
1066+
self.tcx.sess.span_warn(error_reporting_span, &msg[..]);
10651067
}
10661068

10671069
non_terminal.hash(self.st);

0 commit comments

Comments
 (0)