1 #![deny(unconditional_recursion)]
4 fn foo() { //~ ERROR function cannot return without recursing
14 fn baz() { //~ ERROR function cannot return without recursing
26 fn quz() -> bool { //~ ERROR function cannot return without recursing
35 // Trait method calls.
37 fn bar(&self) { //~ ERROR function cannot return without recursing
42 impl Foo for Box<dyn Foo + 'static> {
43 fn bar(&self) { //~ ERROR function cannot return without recursing
50 // Trait method call with integer fallback after method resolution.
52 fn bar(&self) { //~ ERROR function cannot return without recursing
63 // Trait method calls via paths.
65 fn bar(&self) { //~ ERROR function cannot return without recursing
70 impl Foo2 for Box<dyn Foo2 + 'static> {
71 fn bar(&self) { //~ ERROR function cannot return without recursing
80 // Inherent method call.
81 fn qux(&self) { //~ ERROR function cannot return without recursing
85 // Inherent method call via path.
86 fn as_ref(&self) -> &Self { //~ ERROR function cannot return without recursing
91 // Trait method calls to impls via paths.
92 impl Default for Baz {
93 fn default() -> Baz { //~ ERROR function cannot return without recursing
94 let x = Default::default();
99 // Overloaded operators.
100 impl std::ops::Deref for Baz {
102 fn deref(&self) -> &() { //~ ERROR function cannot return without recursing
107 impl std::ops::Index<usize> for Baz {
109 fn index(&self, x: usize) -> &Baz { //~ ERROR function cannot return without recursing
114 // Overloaded autoderef.
116 impl std::ops::Deref for Quux {
118 fn deref(&self) -> &Baz { //~ ERROR function cannot return without recursing
129 fn method<T: Bar>(&self, x: &T) {