]> git.lizzy.rs Git - rust.git/commit
std: Use correct lifetime parameter on str::raw::slice_bytes
authorblake2-ppc <blake2-ppc>
Mon, 5 Aug 2013 15:52:03 +0000 (17:52 +0200)
committerblake2-ppc <blake2-ppc>
Mon, 5 Aug 2013 15:55:06 +0000 (17:55 +0200)
commit476dfc24b311a837f931e678c4bdfbb99d29f4e4
treec0ec521e48d9b5cb370ca5c3a13bf92e28bee2b0
parentdbaca98d78f1458485b36b2565593d7d13e1c90f
std: Use correct lifetime parameter on str::raw::slice_bytes

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.
src/libstd/str.rs