blob: f1947933d67074725646aec5cbfc339f5d461d4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); //~ ERROR temporary value dropped while borrowed
use std::borrow::Cow;
pub const X: [u8; 3] = *b"ABC";
pub const Y: Cow<'static, [ [u8; 3] ]> = Cow::Borrowed(&[X]);
pub const Z: Cow<'static, [ [u8; 3] ]> = Cow::Borrowed(&[*b"ABC"]);
//~^ ERROR temporary value dropped while borrowed
fn main() {}
|