Fix tests being non-deterministic

This commit is contained in:
Lukas Wirth 2024-04-19 11:43:16 +02:00
parent 0485a85ee2
commit cdb8c3a327
10 changed files with 221 additions and 175 deletions

View file

@ -407,8 +407,7 @@ impl ProcMacroExpander for Expander {
call_site: Span,
mixed_site: Span,
) -> Result<tt::Subtree<Span>, ProcMacroExpansionError> {
let env = env.iter().map(|(k, v)| (k.to_owned(), v.to_owned())).collect();
match self.0.expand(subtree, attrs, env, def_site, call_site, mixed_site) {
match self.0.expand(subtree, attrs, env.clone(), def_site, call_site, mixed_site) {
Ok(Ok(subtree)) => Ok(subtree),
Ok(Err(err)) => Err(ProcMacroExpansionError::Panic(err.0)),
Err(err) => Err(ProcMacroExpansionError::System(err.to_string())),