}
*x
};
+
+ trait WithAssoc {
+ type Assoc: ?Sized;
+ }
+ impl WithAssoc for String {
+ type Assoc = str;
+ }
+ fn takes_assoc<T: WithAssoc>(_: &T::Assoc) -> T {
+ unimplemented!()
+ }
+ let _: String = takes_assoc(&*String::new());
+
+ // Issue #9901
+ fn takes_ref(_: &i32) {}
+ takes_ref(*Box::new(&0i32));
}