2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2012-03-28 20:42:33 +00:00
|
|
|
// test that autoderef of a type like this does not
|
|
|
|
// cause compiler to loop. Note that no instances
|
|
|
|
// of such a type could ever be constructed.
|
2015-06-28 17:38:28 +00:00
|
|
|
|
2022-07-25 20:36:03 +00:00
|
|
|
struct T(#[allow(unused_tuple_struct_fields)] Box<T>);
|
2015-06-28 17:38:28 +00:00
|
|
|
|
|
|
|
trait ToStr2 {
|
|
|
|
fn my_to_string(&self) -> String;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ToStr2 for T {
|
|
|
|
fn my_to_string(&self) -> String { "t".to_string() }
|
2012-03-28 20:42:33 +00:00
|
|
|
}
|
2012-09-05 22:58:43 +00:00
|
|
|
|
2015-06-28 17:38:28 +00:00
|
|
|
#[allow(dead_code)]
|
|
|
|
fn new_t(x: T) {
|
|
|
|
x.my_to_string();
|
|
|
|
}
|
2012-03-28 20:42:33 +00:00
|
|
|
|
2015-06-28 17:38:28 +00:00
|
|
|
fn main() {
|
|
|
|
}
|