about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-22 00:03:57 +0000
committerbors <bors@rust-lang.org>2023-12-22 00:03:57 +0000
commitcee794ee98d49b45a55ba225680d98e0c4672736 (patch)
treecafc4a03ac43b31aa2dbf0e33d888ea19e444fa7 /compiler/rustc_expand/src
parent3d0e6bed600c0175628e96f1118293cf44fb97bd (diff)
parent006446e373eae84f585d17a9945fe75a5f56c37e (diff)
downloadrust-cee794ee98d49b45a55ba225680d98e0c4672736.tar.gz
rust-cee794ee98d49b45a55ba225680d98e0c4672736.zip
Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errors
Fix `EmissionGuarantee`

There are some problems with the `DiagCtxt` API related to `EmissionGuarantee`. This PR fixes them.

r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_expand/src')
-rw-r--r--compiler/rustc_expand/src/base.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs
index b63609c48e9..ee0b10edfda 100644
--- a/compiler/rustc_expand/src/base.rs
+++ b/compiler/rustc_expand/src/base.rs
@@ -1159,6 +1159,7 @@ impl<'a> ExtCtxt<'a> {
         // Fixme: does this result in errors?
         self.expansions.clear();
     }
+    #[rustc_lint_diagnostics]
     pub fn bug(&self, msg: &'static str) -> ! {
         self.sess.dcx().bug(msg);
     }
@@ -1204,11 +1205,10 @@ pub fn resolve_path(
                 .expect("attempting to resolve a file path in an external file"),
             FileName::DocTest(path, _) => path,
             other => {
-                return Err(errors::ResolveRelativePath {
+                return Err(parse_sess.dcx.create_err(errors::ResolveRelativePath {
                     span,
                     path: parse_sess.source_map().filename_for_diagnostics(&other).to_string(),
-                }
-                .into_diagnostic(&parse_sess.dcx));
+                }));
             }
         };
         result.pop();