Sign in
fuchsia
/
third_party
/
rust
/
9ae1a664f7b947dadb9e97eea7703831d9cd5d31
/
.
/
src
/
test
/
ui
/
regions
/
regions-return-stack-allocated-vec.rs
blob: 97fbdbf46851e91b9b57f23ffb926e04a957c401 [
file
] [
log
] [
blame
]
// Test that we cannot return a stack allocated slice
fn
function
(
x
:
isize
)
->
&
'
static
[
isize
]
{
&[
x
]
//~ ERROR cannot return reference to temporary value
}
fn
main
()
{
let
x
=
function
(
1
);
let
y
=
x
[
0
];
}