diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 21:14:02 +1100 | 
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-24 07:59:21 +1100 | 
| commit | d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7 (patch) | |
| tree | 6a1bd10bfc900bacf504f9b5e5b7b64378d00e04 /compiler/rustc_errors/src | |
| parent | ec9af0d6cb6386c7be6056a71366d275d5ca3e1e (diff) | |
| download | rust-d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7.tar.gz rust-d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7.zip | |
Remove `ParseSess` methods that duplicate `DiagCtxt` methods.
Also add missing `#[track_caller]` attributes to `DiagCtxt` methods as necessary to keep tests working.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 7a1faac04d3..61f4f2aee7b 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -1203,6 +1203,7 @@ impl DiagCtxt { self.inner.borrow_mut().emit_diagnostic_without_consuming(diagnostic) } + #[track_caller] pub fn emit_err<'a>(&'a self, err: impl IntoDiagnostic<'a>) -> ErrorGuaranteed { self.create_err(err).emit() } @@ -1212,6 +1213,7 @@ impl DiagCtxt { err.into_diagnostic(self, Error { lint: false }) } + #[track_caller] pub fn create_warning<'a>( &'a self, warning: impl IntoDiagnostic<'a, ()>, @@ -1219,10 +1221,12 @@ impl DiagCtxt { warning.into_diagnostic(self, Warning(None)) } + #[track_caller] pub fn emit_warning<'a>(&'a self, warning: impl IntoDiagnostic<'a, ()>) { self.create_warning(warning).emit() } + #[track_caller] pub fn create_almost_fatal<'a>( &'a self, fatal: impl IntoDiagnostic<'a, FatalError>, @@ -1230,6 +1234,7 @@ impl DiagCtxt { fatal.into_diagnostic(self, Fatal) } + #[track_caller] pub fn emit_almost_fatal<'a>( &'a self, fatal: impl IntoDiagnostic<'a, FatalError>, @@ -1237,6 +1242,7 @@ impl DiagCtxt { self.create_almost_fatal(fatal).emit() } + #[track_caller] pub fn create_fatal<'a>( &'a self, fatal: impl IntoDiagnostic<'a, FatalAbort>, @@ -1244,10 +1250,12 @@ impl DiagCtxt { fatal.into_diagnostic(self, Fatal) } + #[track_caller] pub fn emit_fatal<'a>(&'a self, fatal: impl IntoDiagnostic<'a, FatalAbort>) -> ! { self.create_fatal(fatal).emit() } + #[track_caller] pub fn create_bug<'a>( &'a self, bug: impl IntoDiagnostic<'a, BugAbort>, @@ -1255,14 +1263,17 @@ impl DiagCtxt { bug.into_diagnostic(self, Bug) } - pub fn emit_bug<'a>(&'a self, bug: impl IntoDiagnostic<'a, BugAbort>) -> ! { + #[track_caller] + pub fn emit_bug<'a>(&'a self, bug: impl IntoDiagnostic<'a, diagnostic_builder::BugAbort>) -> ! { self.create_bug(bug).emit() } + #[track_caller] pub fn emit_note<'a>(&'a self, note: impl IntoDiagnostic<'a, ()>) { self.create_note(note).emit() } + #[track_caller] pub fn create_note<'a>( &'a self, note: impl IntoDiagnostic<'a, ()>, | 
