Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
use
/
use-after-move-self.rs
blob: f7a3c0ecce5ba49dc3bd80d03e089959c523d029 [
file
] [
log
] [
blame
] [
edit
]
struct
S
{
x
:
Box
<
isize
>,
}
impl
S
{
pub
fn
foo
(
self
)
->
isize
{
self
.
bar
();
return
*
self
.
x
;
//~ ERROR use of moved value: `self`
}
pub
fn
bar
(
self
)
{}
}
fn
main
()
{
let
x
=
S
{
x
:
1.into
()
};
println
!(
"{}"
,
x
.
foo
());
}