mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
13 lines
351 B
Rust
13 lines
351 B
Rust
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() {}
|