about summary refs log tree commit diff
path: root/compiler/rustc_session/src/parse.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-22 08:32:41 +0000
committerbors <bors@rust-lang.org>2022-08-22 08:32:41 +0000
commitee8c31e64d229cac4eba6d8f03bb70e16f34a14b (patch)
tree0c9ff6127f19cacf68070cea3a978ca3a01d9c4d /compiler/rustc_session/src/parse.rs
parenta9bb589cd678e034d194193fa892942315b10e2a (diff)
parent88e39b2c2e875d78f8c04fe8c6a52a6a48632af5 (diff)
downloadrust-ee8c31e64d229cac4eba6d8f03bb70e16f34a14b.tar.gz
rust-ee8c31e64d229cac4eba6d8f03bb70e16f34a14b.zip
Auto merge of #100868 - Dylan-DPC:rollup-a1hfi1r, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #93162 (Std module docs improvements)
 - #99386 (Add tests that check `Vec::retain` predicate execution order.)
 - #99915 (Recover keywords in trait bounds)
 - #100694 (Migrate rustc_ast_passes diagnostics to `SessionDiagnostic` and translatable messages (first part))
 - #100757 (Catch overflow early)

Failed merges:

 - #99917 (Move Error trait into core)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_session/src/parse.rs')
-rw-r--r--compiler/rustc_session/src/parse.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs
index b9b2356130a..17866dc6bdd 100644
--- a/compiler/rustc_session/src/parse.rs
+++ b/compiler/rustc_session/src/parse.rs
@@ -360,6 +360,17 @@ impl ParseSess {
         self.create_warning(warning).emit()
     }
 
+    pub fn create_fatal<'a>(
+        &'a self,
+        fatal: impl SessionDiagnostic<'a, !>,
+    ) -> DiagnosticBuilder<'a, !> {
+        fatal.into_diagnostic(self)
+    }
+
+    pub fn emit_fatal<'a>(&'a self, fatal: impl SessionDiagnostic<'a, !>) -> ! {
+        self.create_fatal(fatal).emit()
+    }
+
     #[rustc_lint_diagnostics]
     pub fn struct_err(
         &self,
@@ -374,6 +385,11 @@ impl ParseSess {
     }
 
     #[rustc_lint_diagnostics]
+    pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> {
+        self.span_diagnostic.struct_fatal(msg)
+    }
+
+    #[rustc_lint_diagnostics]
     pub fn struct_diagnostic<G: EmissionGuarantee>(
         &self,
         msg: impl Into<DiagnosticMessage>,