Uh oh!
There was an error while loading. Please reload this page.
Introduce trait engine - #49202
Conversation
rust-highfive
commented
Mar 20, 2018
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
3e8979d to
d442a98CompareThere was a problem hiding this comment.
This needs to be:
impl<'a, 'gcx, 'tcx> dyn TraitEngine<'tcx> + 'tcx {
..
}
Whenever you create a trait object type dyn Trait, if that trait object may close over references, then the lifetime of those references needs to be part of its bound. In this case, FulfillmentContext closes over data of type with lifetime 'tcx, so we need dyn TraitEngine<'tcx> + 'tcx.
nikomatsakis
commented
Mar 22, 2018
There was a problem hiding this comment.
This needs to be Box<Self> or Box<dyn TraitEngine<'tcx> +'tcx>
Here, Self = dyn TraitEngine<'tcx> + tcx (that is a single type). It might be mildly clearer formatted like so dyn (TraitEngine<'tcx> + tcx). That is, it is a dynamic type (not statically known) that implements TraitEngine<'tcx> and which outlives 'tcx (i.e., meets the bound TraitEngine<'tcx> + 'tcx).
csmoe
commented
Mar 22, 2018
@nikomatsakis The main code modification was already done a week ago, but I have been being trapped here. I have tried many ways to resolve the lifetime, but they never works. |
nikomatsakis
commented
Mar 22, 2018
@csmoe ok that was trickier than I thought :) I pushed various commits. |
nikomatsakis
commented
Mar 22, 2018
Let's see what travis thinks. |
bors
commented
Mar 22, 2018
☔ The latest upstream changes (presumably #49264) made this pull request unmergeable. Please resolve the merge conflicts. |
This way, we don't have to repeat it.
The use of tcx/gcx in this function is subtle.
This helps to make clear where *global* lifetimes are needed in `coerce_unsized_info`
nikomatsakis
commented
Mar 26, 2018
@bors r+ |
bors
commented
Mar 26, 2018
📌 Commit 39712e5 has been approved by |
nikomatsakis
commented
Mar 26, 2018
Sorry for the delay, was waiting until travis was happy =) |
bors
commented
Mar 27, 2018
⌛ Testing commit 39712e5 with merge 6b50e0fc7ac915609d9821865cb191aea128e9ac... |
bors
commented
Mar 27, 2018
💔 Test failed - status-travis |
@bors retry 3 hour time-out in Details |
kennytm
commented
Mar 27, 2018
@bors p=15 |
bors
commented
Mar 27, 2018
⌛ Testing commit 39712e5 with merge 83bcdc9af15af7b689ceba0e1772e037dc546c85... |
bors
commented
Mar 27, 2018
💔 Test failed - status-travis |
kennytm
commented
Mar 27, 2018
@bors retry Spuriously canceled ¿❓⸮❔😕?❓❔ |
bors
commented
Mar 27, 2018
Introduce trait engine address #48895 step 1: introduce trait engine
bors
commented
Mar 27, 2018
☀️ Test successful - status-appveyor, status-travis |
address #48895 step 1: introduce trait engine