From c722a1eb9992ac76f5c3dd0aee36b8734d613f11 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Wed, 16 Nov 2016 10:18:46 -0500 Subject: [PATCH] Add span to warning about incr. comp. vs Token::Interpolated. --- src/librustc_incremental/calculate_svh/svh_visitor.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/librustc_incremental/calculate_svh/svh_visitor.rs b/src/librustc_incremental/calculate_svh/svh_visitor.rs index faf4da55ee5..a1ece48462b 100644 --- a/src/librustc_incremental/calculate_svh/svh_visitor.rs +++ b/src/librustc_incremental/calculate_svh/svh_visitor.rs @@ -944,7 +944,7 @@ fn hash_token_tree(&mut self, tt: &tokenstream::TokenTree) { 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); @@ -978,7 +978,7 @@ fn hash_token_tree(&mut self, tt: &tokenstream::TokenTree) { } 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); @@ -986,7 +986,9 @@ fn hash_token_tree(&mut self, tt: &tokenstream::TokenTree) { } } - 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 | @@ -1061,7 +1063,7 @@ fn hash_token(&mut self, token: &token::Token) { 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); -- 2.44.0