mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Shrink mbe::ExpandError
and mbe::ParseError
This commit is contained in:
parent
2310908df7
commit
2ad71f1350
8 changed files with 78 additions and 92 deletions
|
@ -6,15 +6,6 @@ use tt::buffer::TokenBuffer;
|
|||
|
||||
use crate::{to_parser_input::to_parser_input, ExpandError, ExpandResult};
|
||||
|
||||
macro_rules! err {
|
||||
() => {
|
||||
ExpandError::BindingError(format!(""))
|
||||
};
|
||||
($($tt:tt)*) => {
|
||||
ExpandError::BindingError(format!($($tt)*))
|
||||
};
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct TtIter<'a> {
|
||||
pub(crate) inner: std::slice::Iter<'a, tt::TokenTree>,
|
||||
|
@ -115,7 +106,7 @@ impl<'a> TtIter<'a> {
|
|||
}
|
||||
|
||||
let err = if error || !cursor.is_root() {
|
||||
Some(err!("expected {:?}", entry_point))
|
||||
Some(ExpandError::BindingError(format!("expected {entry_point:?}").into()))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue