Skip to content

Commit c38d80e

Browse files
committed
Track more diagnostics in rustc_expand
1 parent e94bda3 commit c38d80e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_expand/src/base.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,7 @@ impl<'a> ExtCtxt<'a> {
11081108
}
11091109

11101110
#[rustc_lint_diagnostics]
1111+
#[track_caller]
11111112
pub fn struct_span_err<S: Into<MultiSpan>>(
11121113
&self,
11131114
sp: S,
@@ -1116,13 +1117,15 @@ impl<'a> ExtCtxt<'a> {
11161117
self.sess.parse_sess.span_diagnostic.struct_span_err(sp, msg)
11171118
}
11181119

1120+
#[track_caller]
11191121
pub fn create_err(
11201122
&self,
11211123
err: impl IntoDiagnostic<'a>,
11221124
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
11231125
self.sess.create_err(err)
11241126
}
11251127

1128+
#[track_caller]
11261129
pub fn emit_err(&self, err: impl IntoDiagnostic<'a>) -> ErrorGuaranteed {
11271130
self.sess.emit_err(err)
11281131
}
@@ -1133,10 +1136,12 @@ impl<'a> ExtCtxt<'a> {
11331136
/// Compilation will be stopped in the near future (at the end of
11341137
/// the macro expansion phase).
11351138
#[rustc_lint_diagnostics]
1139+
#[track_caller]
11361140
pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: impl Into<DiagnosticMessage>) {
11371141
self.sess.parse_sess.span_diagnostic.span_err(sp, msg);
11381142
}
11391143
#[rustc_lint_diagnostics]
1144+
#[track_caller]
11401145
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: impl Into<DiagnosticMessage>) {
11411146
self.sess.parse_sess.span_diagnostic.span_warn(sp, msg);
11421147
}

0 commit comments

Comments
 (0)