Add ErrorGuaranteed to ast::LitKind::Err, token::LitKind::Err.
This mostly works well, and eliminates a couple of delayed bugs. One annoying thing is that we should really also add an `ErrorGuaranteed` to `proc_macro::bridge::LitKind::Err`. But that's difficult because `proc_macro` doesn't have access to `ErrorGuaranteed`, so we have to fake it.
This commit is contained in:
@@ -70,11 +70,11 @@ pub fn parse_meta<'a>(sess: &'a ParseSess, attr: &Attribute) -> PResult<'a, Meta
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
report_lit_error(sess, err, token_lit, expr.span);
|
||||
let guar = report_lit_error(sess, err, token_lit, expr.span);
|
||||
let lit = ast::MetaItemLit {
|
||||
symbol: token_lit.symbol,
|
||||
suffix: token_lit.suffix,
|
||||
kind: ast::LitKind::Err,
|
||||
kind: ast::LitKind::Err(guar),
|
||||
span: expr.span,
|
||||
};
|
||||
MetaItemKind::NameValue(lit)
|
||||
|
||||
Reference in New Issue
Block a user