Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
box
/
unit
/
expr-if-unique.rs
blob: 344c9dc4f6ae42a05515186847bef55ff0599426 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
// Tests for if as expressions returning boxed types
fn
test_box
()
{
let
rs
:
Box
<
_
>
=
if
true
{
Box
::
new
(
100
)
}
else
{
Box
::
new
(
101
)
};
assert_eq
!(*
rs
,
100
);
}
pub
fn
main
()
{
test_box
();
}