Skip to content

Conversation

@flodiebold
Copy link
Member

Fixes #3883.

}

#[test]
fn it_should_panic_because_of_direct_cycle() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fn it_should_panic_because_of_direct_cycle() {
fn it_should_not_panic_because_of_direct_cycle() {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm yeah I was just copying the other test name, not sure if that's the intended interpretation but I guess I'll just give both better names...


if target == from {
return true;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, when writing dfses it always make sense to check conditions on entry, not before the recursive calls.... It bugs me a bit that a problem is known (as I've been bitten by this oh so many times), but that it slipped through code review... I guess, there's nothing actionable process-wise we can make better here :(

also cc @gfreezy for a "check condition on dfs entry" rule-of-thumb :)

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 19, 2020

@bors bors bot merged commit af0dcc5 into rust-lang:master Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on "Internal error, cycle detected:"

3 participants