]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-2063.rs
Rollup merge of #62663 - llogiq:more-questionmark-docs, r=GuillaumeGomez
[rust.git] / src / test / ui / issues / issue-2063.rs
1 // run-pass
2 // test that autoderef of a type like this does not
3 // cause compiler to loop.  Note that no instances
4 // of such a type could ever be constructed.
5
6 struct T(Box<T>);
7
8 trait ToStr2 {
9     fn my_to_string(&self) -> String;
10 }
11
12 impl ToStr2 for T {
13     fn my_to_string(&self) -> String { "t".to_string() }
14 }
15
16 #[allow(dead_code)]
17 fn new_t(x: T) {
18     x.my_to_string();
19 }
20
21 fn main() {
22 }