Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
autoref-autoderef
/
autoderef-method.rs
blob: faefdafb4c0246af448b2ca071e8956c00682466 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
#![
allow
(
non_camel_case_types
)]
trait
double
{
fn
double
(
self
:
Box
<
Self
>)
->
usize
;
}
impl
double
for
usize
{
fn
double
(
self
:
Box
<
usize
>)
->
usize
{
*
self
*
2
}
}
pub
fn
main
()
{
let
x
:
Box
<
_
>
=
Box
::
new
(
3
);
assert_eq
!(
x
.
double
(),
6
);
}