2 // Test that we can use method notation to call methods based on a
3 // projection bound from a trait. Issue #20469.
5 ///////////////////////////////////////////////////////////////////////////
9 fn make_string(&self) -> String
;
12 impl MakeString
for isize {
13 fn make_string(&self) -> String
{
18 impl MakeString
for usize {
19 fn make_string(&self) -> String
{
24 ///////////////////////////////////////////////////////////////////////////
29 fn get(&self) -> &Self::F
;
32 fn foo
<F
:Foo
>(f
: &F
) -> String
{
36 ///////////////////////////////////////////////////////////////////////////
42 impl Foo
for SomeStruct
{
45 fn get(&self) -> &isize {
50 ///////////////////////////////////////////////////////////////////////////
52 struct SomeOtherStruct
{
56 impl Foo
for SomeOtherStruct
{
59 fn get(&self) -> &usize {
65 let x
= SomeStruct { field: 22 }
;
66 assert_eq
!(foo(&x
), format
!("22"));
68 let x
= SomeOtherStruct { field: 44 }
;
69 assert_eq
!(foo(&x
), format
!("44"));