Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
associated-consts
/
associated-const-const-eval.rs
blob: 5dc94b87ff96b9a03172e0cd9b5493a7ba46e311 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
trait
Foo
{
const
NUM
:
usize
;
}
impl
Foo
for
i32
{
const
NUM
:
usize
=
1
;
}
const
FOO
:
usize
=
<
i32
as
Foo
>::
NUM
;
fn
main
()
{
assert_eq
!(
1
,
FOO
);
match
1
{
<
i32
as
Foo
>::
NUM
=>
{},
_
=>
assert
!(
false
)
}
}