Add ErrorGuaranteed to ast::ExprKind::Err
This commit is contained in:
@@ -9,16 +9,14 @@ pub fn expand_compile_error<'cx>(
|
||||
sp: Span,
|
||||
tts: TokenStream,
|
||||
) -> Box<dyn base::MacResult + 'cx> {
|
||||
let Some(var) = get_single_str_from_tts(cx, sp, tts, "compile_error!") else {
|
||||
return DummyResult::any(sp);
|
||||
let var = match get_single_str_from_tts(cx, sp, tts, "compile_error!") {
|
||||
Ok(var) => var,
|
||||
Err(guar) => return DummyResult::any(sp, guar),
|
||||
};
|
||||
|
||||
#[expect(
|
||||
rustc::diagnostic_outside_of_impl,
|
||||
reason = "diagnostic message is specified by user"
|
||||
)]
|
||||
#[expect(rustc::diagnostic_outside_of_impl, reason = "diagnostic message is specified by user")]
|
||||
#[expect(rustc::untranslatable_diagnostic, reason = "diagnostic message is specified by user")]
|
||||
cx.dcx().span_err(sp, var.to_string());
|
||||
let guar = cx.dcx().span_err(sp, var.to_string());
|
||||
|
||||
DummyResult::any(sp)
|
||||
DummyResult::any(sp, guar)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user