Because two want completely different things.
The type of self inside A::foo is &Self , not &A That is, it is a pointer to the type of implementation, not a pointer to an object-object. The call to A::bar fine because it simply passes a pointer without requiring extra work.
The call ::bar is a completely different brew vessel for marine life.
The problem boils down to how the compiler presents things. We first consider the case when self is a Sized type of type i32 . This means that self is &i32 . Recall that &A is an attribute object, and, therefore, effectively has the following layout:
struct ATraitObject { ptr: *const (), vtable: *const AVtable, }
ATraitObject.ptr should indicate the actual value and ATraitObject.vtable on the implementation of the attribute for this type. The compiler can populate this with the ptr existing self pointer, and the vtable populated with a pointer to where impl A for i32 vtable lives in memory. In doing so, it can call ::bar .
Now consider the case where self not Sized , for example str . This means that self is a "thick" pointer and contains information about the value of the pointer: a pointer to the underlying data and the length of the string. When the compiler is sent to create an ATraitObject , it can set ptr to self.as_ptr() , and it can set vtable ... but there is nowhere to store the length of the string!
All non- Sized types have this problem, since they all have additional information contained in pointers. By the way, this includes objects such as &A , which means that you also cannot turn an object-attribute into another object-object, since now you need two vtables.
This problem: the compiler simply does not have the ability to turn &Self , where Self: !Sized into &A There is too much information contained in self and not enough storage space in &A
To get the method to compile, add the where Self: Sized clause to the method definition. This guarantees the compiler that the method will never be called for non- Sized types, and therefore it can be assumed that conversion from &Self to &A always possible.