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:
parent
332c57723a
commit
25ed6e43b0
26 changed files with 85 additions and 64 deletions
|
@ -40,7 +40,7 @@ pub fn expand_concat(
|
|||
cx.dcx().emit_err(errors::ConcatBytestr { span: e.span });
|
||||
has_errors = true;
|
||||
}
|
||||
Ok(ast::LitKind::Err) => {
|
||||
Ok(ast::LitKind::Err(_)) => {
|
||||
has_errors = true;
|
||||
}
|
||||
Err(err) => {
|
||||
|
|
|
@ -44,7 +44,7 @@ fn invalid_type_err(
|
|||
Ok(ast::LitKind::Bool(_)) => {
|
||||
dcx.emit_err(ConcatBytesInvalid { span, lit_kind: "boolean", sugg: None });
|
||||
}
|
||||
Ok(ast::LitKind::Err) => {}
|
||||
Ok(ast::LitKind::Err(_)) => {}
|
||||
Ok(ast::LitKind::Int(_, _)) if !is_nested => {
|
||||
let sugg =
|
||||
snippet.map(|snippet| ConcatBytesInvalidSuggestion::IntLit { span: span, snippet });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue