]> git.lizzy.rs Git - rust.git/commitdiff
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)
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.


Trivial merge