about summary refs log tree commit diff
path: root/src/test/compile-fail/lint-unconditional-recursion.rs
AgeCommit message (Collapse)AuthorLines
2017-12-14Move compile-fail tests with NOTE/HELP annotations to UIVadim Petrochenkov-145/+0
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-13/+1
2016-03-16Stop ignoring expected note/help messages in compiletest suite.Corey Farwell-0/+14
Original issue: https://github.com/rust-lang/rust/issues/21195 Relevant PR: https://github.com/rust-lang/rust/pull/30778 Prior to this commit, if a compiletest testcase included the text "HELP:" or "NOTE:" (note the colons), then it would indicate to the compiletest suite that we should verify "help" and "note" expected messages. This commit updates this check to also check "HELP" and "NOTE" (not the absense of colons) so that we always verify "help" and "note" expected messages.
2015-08-04rustc_lint: handle more method calls in unconditional_recursion.Eduard Burtescu-0/+66
2015-06-29lint: default methods must be called on Self to unconditionally recur.Huon Wilson-0/+7
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.
2015-06-29lint: only consider actual calls as unconditional recursion.Huon Wilson-0/+4
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.
2015-01-25Add a lint to detect unconditional recursion.Huon Wilson-0/+66
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.