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
|
@ -337,7 +337,11 @@ pub enum LitKind {
|
|||
ByteStrRaw(u8),
|
||||
CStr,
|
||||
CStrRaw(u8),
|
||||
Err,
|
||||
// This should have an `ErrorGuaranteed`, except that type isn't available
|
||||
// in this crate. (Imagine it is there.) Hence the `WithGuar` suffix. Must
|
||||
// only be constructed in `LitKind::from_internal`, where an
|
||||
// `ErrorGuaranteed` is available.
|
||||
ErrWithGuar,
|
||||
}
|
||||
|
||||
rpc_encode_decode!(
|
||||
|
@ -352,7 +356,7 @@ rpc_encode_decode!(
|
|||
ByteStrRaw(n),
|
||||
CStr,
|
||||
CStrRaw(n),
|
||||
Err,
|
||||
ErrWithGuar,
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -1451,7 +1451,7 @@ impl Literal {
|
|||
f(&["cr", hashes, "\"", symbol, "\"", hashes, suffix])
|
||||
}
|
||||
|
||||
bridge::LitKind::Integer | bridge::LitKind::Float | bridge::LitKind::Err => {
|
||||
bridge::LitKind::Integer | bridge::LitKind::Float | bridge::LitKind::ErrWithGuar => {
|
||||
f(&[symbol, suffix])
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue