-
Notifications
You must be signed in to change notification settings - Fork 717
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
Change return type of TemplateParameters' methods from Option to just… #1064
Conversation
Seems like this broke a bunch of tests... |
Hi @hgallagher1993, did you figure out how to run the tests locally? It looks like this PR changed a lot of the bindings generated for the test headers, which I wouldn't expect. |
@fitzgen I had a read through the contributing.md and do mean to just run |
I ran
changed to
And all the |
@hgallagher1993 yes. Make sure you have the latest nightly and The This is what if item.can_derive_copy(ctx) && !item.annotations().disallow_copy() &&
ctx.options().derive_copy
{
derives.push("Copy");
if used_template_params.is_some() {
// FIXME: This requires extra logic if you have a big array in a
// templated struct. The reason for this is that the magic:
// fn clone(&self) -> Self { *self }
// doesn't work for templates.
//
// It's not hard to fix though.
derives.push("Clone");
} else {
needs_clone_impl = true;
}
} Were we really getting |
src/codegen/mod.rs
Outdated
@@ -1450,7 +1449,7 @@ impl CodeGenerator for CompInfo { | |||
ctx.options().derive_copy | |||
{ | |||
derives.push("Copy"); | |||
if used_template_params.is_some() { | |||
if used_template_params.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we must have been hitting Some(v)
where v.is_empty()
fairly often.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be !used_template_params.is_empty()
? When the ! is put in, the impl clone
's are left alone when the tests are run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally. Should have caught this earlier! Good eye ;)
Ok, so next steps:
Thanks @hgallagher1993 ! |
☔ The latest upstream changes (presumably #1075) made this pull request unmergeable. Please resolve the merge conflicts. |
@fitzgen I've ran the tests and added in the |
Great! Let me know when you've rebased (or if you need any help rebasing) and then I'll take a final look and we can merge this thing :) |
4e3ffc8
to
8dcaa35
Compare
@fitzgen The merge conflict should be gone now |
I ran the tests locally and they all passed so I'm not really sure why it's failed here |
@hgallagher1993
These tests are special in the sense that they doesn't have the only one expected binding!
You can read more here. But unfortunatelly, this is not the only problem. If you take a look into
|
☔ The latest upstream changes (presumably #1084) made this pull request unmergeable. Please resolve the merge conflicts. |
@pepyakin Ya it was only |
Closing because this bitrotted a lot and is inactive, but thanks for the patch @hgallagher1993! :) |
… Vec
Fixes #960