Skip to content

Remove dead code and re-enable functions tests #664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 18, 2021

Conversation

AzureMarker
Copy link
Member

@AzureMarker AzureMarker commented Dec 11, 2020

This code is not attached to the crate's module tree and has since been moved to chalk-recursive.

I also noticed that tests/test/functions.rs is not attached to the module tree, but I'm not sure if that is intentional.

This code has since been moved to chalk-recursive.
@jackh726
Copy link
Member

I also noticed that tests/test/functions.rs is not attached to the module tree, but I'm not sure if that is intentional.

Not intentional. Can you fix that here?

@AzureMarker
Copy link
Member Author

Do you want functions.rs to be removed or re-added to the module tree?

@jackh726
Copy link
Member

Do you want functions.rs to be removed or re-added to the module tree?

Just added to the module tree.

The last two goal tests in function_implement_fn_traits fail. Instead of
floundering, they return no solutions.
@@ -61,6 +62,9 @@ fn function_implement_fn_traits() {
struct Ty { }

trait Clone { }

impl Clone for Ty { }

opaque type MyOpaque: Clone = Ty;
Copy link
Member Author

Choose a reason for hiding this comment

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

The last two tests in this set are supposed to flounder, but instead return "no more solutions". Maybe the floundering behavior has purposefully changed since this test was written?

Copy link
Member Author

@AzureMarker AzureMarker Dec 15, 2020

Choose a reason for hiding this comment

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

I think something like the following should be added here

TyKind::OpaqueType(opaque_ty_id, _) => {
db.opaque_ty_data(*opaque_ty_id)
.to_program_clauses(builder, environment);
}

if /* trait does not appear in opaque type bound */ {
    return Err(Floundered);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

New output looks correct here

@jackh726
Copy link
Member

Well, I had really hoped that the tests wouldn't fail when we readded functions.rs. Seems to have been accidently removed in f63aee5 and the failing test was moved back into that file in 039d0ba. These tests must have been broken at or after that PR. Let me think about the right solution.

@jackh726
Copy link
Member

@Mcat12 So this ends up being a bit of a mess. See master...jackh726:functions for a diff to fix the tests. Though, when doing that, I found that there are some weirdness to discuss.
So, two options:

  1. Go back to just removing the dead code and I can just merge that. Do the functions changes in another PR (you or I).
  2. Apply the diff I have. We'll have to wait on some input/discussion from @nikomatsakis and/or @detrumi wrt. the opaque type bits in function_implement_fn_traits. This means we probably won't merge until next year, since holidays and such.

@AzureMarker
Copy link
Member Author

AzureMarker commented Dec 16, 2020

I'm fine with working on the real fix for this, especially since the original change was just removing dead code (not blocking anything functional).

Edit: Hm, the tests fail on this branch (based on master) but pass on your branch (based on an older commit). I don't see any obvious issues from looking at the diff between the branches.

@jackh726
Copy link
Member

jackh726 commented Dec 16, 2020

I'm fine with working on the real fix for this, especially since the original change was just removing dead code (not blocking anything functional).

Edit: Hm, the tests fail on this branch (based on master) but pass on your branch (based on an older commit). I don't see any obvious issues from looking at the diff between the branches.

Ah oops, didn't realize I was using an outdated base. The problem is that we should also be floundering for general BoundVars too

Edit: that also explains why the recursive solver was giving different results for me

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

This LGTM, but I essentially wrote most of this, I'd like someone else to review. @matthewjasper does this look good to you?

@AzureMarker AzureMarker changed the title Remove dead (moved) recursive solver code Remove dead code and re-enable functions tests Dec 17, 2020
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 18, 2021

📌 Commit 4c2cb04 has been approved by matthewjasper

@bors
Copy link
Contributor

bors commented Jan 18, 2021

⌛ Testing commit 4c2cb04 with merge a222811...

@bors
Copy link
Contributor

bors commented Jan 18, 2021

☀️ Test successful - checks-actions
Approved by: matthewjasper
Pushing a222811 to master...

@bors bors merged commit a222811 into rust-lang:master Jan 18, 2021
@AzureMarker AzureMarker deleted the clean/old-recursive-code branch January 19, 2021 02:22
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.

4 participants