]> git.lizzy.rs Git - rust.git/commit
auto merge of #14275 : kballard/rust/bytes-return-static, r=huonw
authorbors <bors@rust-lang.org>
Sun, 18 May 2014 20:06:30 +0000 (13:06 -0700)
committerbors <bors@rust-lang.org>
Sun, 18 May 2014 20:06:30 +0000 (13:06 -0700)
commitea87f126bdf8de4acc4f74c14ac0ae10d95a2472
tree98c8d99c9429a56f99e739be540b5cff5fe8ddbb
parent63287eef27b1a23a1fc24a7b4453eb7bd8ec1f11
parentbcabcf53cfe2a86ebf02aa762b8ab7278060ce10
auto merge of #14275 : kballard/rust/bytes-return-static, r=huonw

Change `bytes!()` to return

    {
        static BYTES: &'static [u8] = &[...];
        BYTES
    }

This gives it the `'static` lifetime, whereas before it had an rvalue
lifetime. Until recently this would have prevented assigning `bytes!()`
to a static, as in

    static FOO: &'static [u8] = bytes!(1,2,3);

but #14183 fixed it so blocks are now allowed in constant expressions
(with restrictions).

Fixes #11641.