Sign in
fuchsia
/
third_party
/
rust
/
9d09331e00b02f81c714b0c41ce3a38380dd36a2
/
.
/
src
/
test
/
ui
/
self
/
by-value-self-in-mut-slot.rs
blob: 267afd1dcad7fdc7571061d448f2f52c96bcd552 [
file
] [
log
] [
blame
]
// run-pass
struct
X
{
a
:
isize
}
trait
Changer
{
fn
change
(
self
)
->
Self
;
}
impl
Changer
for
X
{
fn
change
(
mut
self
)
->
X
{
self
.
a
=
55
;
self
}
}
pub
fn
main
()
{
let
x
=
X
{
a
:
32
};
let
new_x
=
x
.
change
();
assert_eq
!(
new_x
.
a
,
55
);
}