rust/tests/ui/issues/issue-2063.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
429 B
Rust
Raw Normal View History

// run-pass
// 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.
2022-07-25 20:36:03 +00:00
struct T(#[allow(unused_tuple_struct_fields)] Box<T>);
trait ToStr2 {
fn my_to_string(&self) -> String;
}
impl ToStr2 for T {
fn my_to_string(&self) -> String { "t".to_string() }
}
2012-09-05 22:58:43 +00:00
#[allow(dead_code)]
fn new_t(x: T) {
x.my_to_string();
}
fn main() {
}