Rewrite path::Display to reduce unnecessary allocation

This commit is contained in:
Kevin Ballard 2014-02-07 19:45:48 -08:00
parent 086c0dd33f
commit 1d17c2129e
6 changed files with 24 additions and 50 deletions

View file

@ -4200,10 +4200,10 @@ impl Parser {
let mut err = ~"circular modules: ";
let len = included_mod_stack.get().len();
for p in included_mod_stack.get().slice(i, len).iter() {
p.display().with_str(|s| err.push_str(s));
err.push_str(p.display().as_maybe_owned().as_slice());
err.push_str(" -> ");
}
path.display().with_str(|s| err.push_str(s));
err.push_str(path.display().as_maybe_owned().as_slice());
self.span_fatal(id_sp, err);
}
None => ()