Option begone part 2

This commit is contained in:
Lukas Wirth 2023-04-16 19:20:48 +02:00
parent 96a774261f
commit a2a3fecae3
31 changed files with 113 additions and 152 deletions

View file

@ -38,7 +38,7 @@ impl ProcMacroExpander {
Some(Ok(proc_macros)) => proc_macros,
Some(Err(_)) | None => {
never!("Non-dummy expander even though there are no proc macros");
return ExpandResult::with_err(
return ExpandResult::new(
tt::Subtree::empty(),
ExpandError::Other("Internal error".into()),
);
@ -52,7 +52,7 @@ impl ProcMacroExpander {
proc_macros.len(),
id.0
);
return ExpandResult::with_err(
return ExpandResult::new(
tt::Subtree::empty(),
ExpandError::Other("Internal error".into()),
);
@ -75,17 +75,15 @@ impl ProcMacroExpander {
}
}
ProcMacroExpansionError::System(text)
| ProcMacroExpansionError::Panic(text) => ExpandResult::with_err(
tt::Subtree::empty(),
ExpandError::Other(text.into()),
),
| ProcMacroExpansionError::Panic(text) => {
ExpandResult::new(tt::Subtree::empty(), ExpandError::Other(text.into()))
}
},
}
}
None => ExpandResult::with_err(
tt::Subtree::empty(),
ExpandError::UnresolvedProcMacro(def_crate),
),
None => {
ExpandResult::new(tt::Subtree::empty(), ExpandError::UnresolvedProcMacro(def_crate))
}
}
}
}