-
Notifications
You must be signed in to change notification settings - Fork 182
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
add Unsize
trait implementation
#427
Conversation
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've looked through just a piece of this. Some comments/questions. Not sure how much you can answer @Areredify, they're more for @nikomatsakis.
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.
More comments
} | ||
.cast(interner); | ||
|
||
// FIXME(areredify) we need a `source_ty: 'lifetime` goal here |
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.
Let's file these FIXME
s in a followup issue so they don't potentially get lost. They're pretty important.
The other thing to maybe think about is how this might change based on trait upcasting (see rust-lang/rust#60900) |
Or (this one is unclear on whether it will be implemented), how this could interact with trait objects of multiple traits: rust-lang/rfcs#2035 |
Also, while going through these rules, I made this playground to help me thing about these rules. Might be helpful for others: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=cb638a1efd849d7dc64a8617eec5c1ab |
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.
OK, I did a first pass,and my first thought is that it would be nice to break this PR up into three PRs.
- add
dyn Trait + 'x
lifetime parameter - add
ObjectSafe
goal + integration - add the
Unsize
trait
it would make it much easier to review.
That said, I read everything apart from the details of unsize.rs
and it seems good.
So it safe to conclude that this PR is in "needs rebase" territory to reduce some duplication? |
(I'm still in favor of branching out the lifetime changes as well) |
Yes, this needs a rebase. And the tests I mentioned. I'm also in favor of splitting the lifetime changes. |
@nikomatsakis @jackh726 yes, I'll rebase it and split it and all tomorrow (ideally), sorry for the delay |
@Areredify no hurry =) let's land #393 first, it seems almost ready (just needs a few tweaks to the tests?) |
@nikomatsakis that's right, a slight tweak to the tests and a rebase |
@Areredify Any updates here? Would like to get this in, since it's pretty close. |
Sorry, I prioritized sem-syn lowering, but I plan to get this in before the next design meeting |
4588fe6
to
1d16b9e
Compare
@nikomatsakis @jackh726 Ready for review, I think. I didn't add trait order tests because I feel like supporting it is out of scope of this pr. |
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 think the trait order is important. If it doesn't work correctly, then I would definitely like to see tests with FIXMEs. I'll do a more extensive review later
793348f
to
171998f
Compare
@jackh726 added |
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.
A couple small things, but this looks good to me otherwise. I would like to see some comments on the individual test goals about what they're for (similar to in the Fn
PR). I think getting in this habit will be good :) There are a lot of tests here and it can be hard to keep track of what they are for/what they cover.
@Areredify once you've made these changes, feel free to merge unless @nikomatsakis has any comments
Oh, and please file followup issue(s) for the FIXMEs on merge :) |
done with the changes 🙂 |
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.
Test comment. But other than that, good to merge.
DynTy
and Unsize
trait implementationUnsize
trait implementation
WhereClause, | ||
}; | ||
|
||
struct UnsizeParameterCollector<'a, I: Interner> { |
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.
Ooof but this file needs some comments. =) But I don't think it has to block landing necessarily. But we should file an issue or something to follow-up and explain what is going on.
No description provided.