]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #8308 : blake2-ppc/rust/str-slice-bytes, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 6 Aug 2013 12:26:01 +0000 (05:26 -0700)
committerbors <bors@rust-lang.org>
Tue, 6 Aug 2013 12:26:01 +0000 (05:26 -0700)
`fn slice_bytes` is marked unsafe since it allows violating the valid
string encoding property; but the function did also allow extending the
lifetime of the slice by mistake, since it's returning `&str`.

Use the annotation `slice_bytes<'a>(&'a str, ...) -> &'a str` so
that all uses of `slice_bytes` are region checked correctly.

1  2 
src/libstd/str.rs

Simple merge