str: Add method .into_owned(self) -> ~str to Str

The method .into_owned() is meant to be used as an optimization when you
need to get a ~str from a Str, but don't want to unnecessarily copy it
if it's already a ~str.

This is meant to ease functions that look like

  fn foo<S: Str>(strs: &[S])

Previously they could work with the strings as slices using .as_slice(),
but producing ~str required copying the string, even if the vector
turned out be a &[~str] already.
modified logging function to truncate output and adjusted error output formatting tests to be compatible with both the new and old runtimes
fixed the buffer to make it a more reasonable size
option: mutate() and mutate_default() should return bool

Fixes #8047.
std: use ptr.offset where possible in the vec iterator.

Closes #8212.
std: add benchmark for vec.mut_iter.
Explicitly impl Clone for RWArc

RWArc had a clone() method, but it was part of impl RWArc instead of
an implementation of Clone.

Stick with the explicit implementation instead of deriving Clone so we
can have a docstring.

Fixes #8052.
Remove unused variables.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Rename sum -> _sum.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
Move `use` statements.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
auto merge of #8257 : mozilla/rust/rollup, r=thestinger

1f9c392 r=brson
54e685d r=graydon
1992765 r=thestinger
75155cd r=bblum
def8891 r=graydon
auto merge of #8204 : kballard/rust/str-into-owned, r=graydon

The method .into_owned() is meant to be used as an optimization when you
need to get a ~str from a Str, but don't want to unnecessarily copy it
if it's already a ~str.

This is meant to ease functions that look like

  fn foo<S: Str>(strs: &[S])

Previously they could work with the strings as slices using .as_slice(),
but producing ~str required copying the string, even if the vector
turned out be a &[~str] already.

I don't have any concrete uses for this yet, since the one conversion I've done to `&[S]` so far (see PR #8203) didn't actually need owned strings. But having this here may make using `Str` more attractive.

It also may be worth adding an `into_managed()` function, but that one is less obviously useful than `into_owned()`.