Sign in
fuchsia
/
third_party
/
rust
/
a7a6dedfe661a6d9d181afeb0fbaa894fcb7362b
/
.
/
src
/
test
/
ui
/
self
/
arbitrary_self_types_unsized_struct.rs
blob: b78223fd57cf680726fea7b5fd81e8298284c4cd [
file
] [
log
] [
blame
]
// run-pass
#![
feature
(
arbitrary_self_types
)]
use
std
::
rc
::
Rc
;
struct
Foo
<
T
:
?
Sized
>(
T
);
impl
Foo
<[
u8
]>
{
fn
len
(
self
:
Rc
<
Self
>)
->
usize
{
self
.
0.len
()
}
}
fn
main
()
{
let
rc
=
Rc
::
new
(
Foo
([
1u8
,
2
,
3
]))
as
Rc
<
Foo
<[
u8
]>>;
assert_eq
!(
3
,
rc
.
len
());
}