Sign in
android
/
toolchain
/
rustc
/
ff3f07ae99a30006dd85b9d73084edd9355c9db6
/
.
/
src
/
test
/
run-pass
/
consts
/
const-fn-method.rs
blob: 002646db92a4fcfba9bf43ad34f42472135d09bb [
file
] [
log
] [
blame
]
// run-pass
struct
Foo
{
value
:
u32
}
impl
Foo
{
const
fn
new
()
->
Foo
{
Foo
{
value
:
22
}
}
}
const
FOO
:
Foo
=
Foo
::
new
();
pub
fn
main
()
{
assert_eq
!(
FOO
.
value
,
22
);
let
_
:
[&
'
static
str
;
Foo
::
new
().
value
as
usize
]
=
[
"hey"
;
22
];
}