Rewrite path::Display to reduce unnecessary allocation
This commit is contained in:
parent
086c0dd33f
commit
1d17c2129e
6 changed files with 24 additions and 50 deletions
|
@ -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 => ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue