about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-06-07 17:17:27 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-06-07 19:08:50 +0000
commitc38d80ee9f4fde1596ae4bff0733c3ec045e2f3e (patch)
treede3fe8550b51f0b989adbeac1cde83ad9e1236b2
parente94bda3bf13303671427363d1cd93ac5e089f090 (diff)
downloadrust-c38d80ee9f4fde1596ae4bff0733c3ec045e2f3e.tar.gz
rust-c38d80ee9f4fde1596ae4bff0733c3ec045e2f3e.zip
Track more diagnostics in `rustc_expand`
-rw-r--r--compiler/rustc_expand/src/base.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs
index 0d43b30474b..6839e6ffa35 100644
--- a/compiler/rustc_expand/src/base.rs
+++ b/compiler/rustc_expand/src/base.rs
@@ -1108,6 +1108,7 @@ impl<'a> ExtCtxt<'a> {
     }
 
     #[rustc_lint_diagnostics]
+    #[track_caller]
     pub fn struct_span_err<S: Into<MultiSpan>>(
         &self,
         sp: S,
@@ -1116,6 +1117,7 @@ impl<'a> ExtCtxt<'a> {
         self.sess.parse_sess.span_diagnostic.struct_span_err(sp, msg)
     }
 
+    #[track_caller]
     pub fn create_err(
         &self,
         err: impl IntoDiagnostic<'a>,
@@ -1123,6 +1125,7 @@ impl<'a> ExtCtxt<'a> {
         self.sess.create_err(err)
     }
 
+    #[track_caller]
     pub fn emit_err(&self, err: impl IntoDiagnostic<'a>) -> ErrorGuaranteed {
         self.sess.emit_err(err)
     }
@@ -1133,10 +1136,12 @@ impl<'a> ExtCtxt<'a> {
     /// Compilation will be stopped in the near future (at the end of
     /// the macro expansion phase).
     #[rustc_lint_diagnostics]
+    #[track_caller]
     pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: impl Into<DiagnosticMessage>) {
         self.sess.parse_sess.span_diagnostic.span_err(sp, msg);
     }
     #[rustc_lint_diagnostics]
+    #[track_caller]
     pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: impl Into<DiagnosticMessage>) {
         self.sess.parse_sess.span_diagnostic.span_warn(sp, msg);
     }