Skip to content

Commit e382267

Browse files
committed
Avoid an unnecessary clone in generic_extensions.
This avoids ~800,000 allocations in html5ever.
1 parent a935481 commit e382267

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
139139
macro_ident: name
140140
})
141141
}
142-
Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
142+
Failure(sp, msg) => if sp.lo >= best_fail_spot.lo {
143143
best_fail_spot = sp;
144-
best_fail_msg = (*msg).clone();
144+
best_fail_msg = msg;
145145
},
146146
Error(err_sp, ref msg) => {
147147
cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..])

0 commit comments

Comments
 (0)