diff options
| author | bors <bors@rust-lang.org> | 2023-12-22 00:03:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-22 00:03:57 +0000 |
| commit | cee794ee98d49b45a55ba225680d98e0c4672736 (patch) | |
| tree | cafc4a03ac43b31aa2dbf0e33d888ea19e444fa7 /compiler/rustc_expand/src | |
| parent | 3d0e6bed600c0175628e96f1118293cf44fb97bd (diff) | |
| parent | 006446e373eae84f585d17a9945fe75a5f56c37e (diff) | |
| download | rust-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.rs | 6 |
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(); |
