mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
Avoid an unnecessary clone in generic_extensions
.
This avoids ~800,000 allocations in html5ever.
This commit is contained in:
parent
a935481ae9
commit
e382267cfb
@ -139,9 +139,9 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
|
||||
macro_ident: name
|
||||
})
|
||||
}
|
||||
Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
|
||||
Failure(sp, msg) => if sp.lo >= best_fail_spot.lo {
|
||||
best_fail_spot = sp;
|
||||
best_fail_msg = (*msg).clone();
|
||||
best_fail_msg = msg;
|
||||
},
|
||||
Error(err_sp, ref msg) => {
|
||||
cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..])
|
||||
|
Loading…
Reference in New Issue
Block a user