| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This catches the case when a trait defines a default method that calls
itself, but on a type that isn't necessarily `Self`, e.g. there's no
reason that `T = Self` in the following, so the call isn't necessarily
recursive (`T` may override the call).
trait Bar {
fn method<T: Bar>(&self, x: &T) {
x.method(x)
}
}
Fixes #26333.
|
|
Specifically, just mentioning the function name as a value is fine, as
long as it isn't called, e.g. `fn main() { let _ = main; }`.
Closes #21705.
|
|
E.g. `fn foo() { foo() }`, or, more subtlely
impl Foo for Box<Foo+'static> {
fn bar(&self) {
self.bar();
}
}
The compiler will warn and point out the points where recursion occurs,
if it determines that the function cannot return without calling itself.
Closes #17899.
|