Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
consts
/
const-fn-method.rs
blob: 689b8576e4b78a4d4fa5545ed07e2bcace56eac8 [
file
] [
log
] [
blame
] [
edit
]
//@ 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
];
}