Uh oh!
There was an error while loading. Please reload this page.
resolve: collect trait aliases along with traits - #59166
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d3a21a9 to
b63230fComparealexreg
commented
Mar 13, 2019
@seanmonstar Okay, all looks good. Thanks for the PR! I'll r+ when CI passes. Is there any case concerning the importing of trait aliases that you think should be supported but still isn't, after this PR? |
alexreg
commented
Mar 13, 2019
@bors r+ |
bors
commented
Mar 13, 2019
📌 Commit b63230fa4e7b13e98cc62629a0116eeb986c548b has been approved by |
rust-highfive
commented
Mar 13, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
seanmonstar
commented
Mar 13, 2019
I'd love some sort of late bounds on associated types that are themselves generic. Like this example: traitSvc<Req>{typeRes;}mod http {structReq;structRes<B>(pubB);traitBody{}traitHttpSvc = <B> super::Svc<Req,Res = Res<B>> {typeRes = B;}}I'd need some way to propagate the body generic out of the |
seanmonstar
commented
Mar 13, 2019
Oh noes, those errors... too bad the tests aren't run with |
alexreg
commented
Mar 14, 2019
Weird... Bors didn't auto-cancel this PR. @bors r- |
alexreg
commented
Mar 14, 2019
@seanmonstar Poke me once you have the backtraces for those errors. |
alexreg
commented
Mar 14, 2019
I think you're talking generic associated types, unless I'm mistaken? This feature has been in the works for a while now, and should be in nightly in the coming months, we hope, though it's hard to predict exactly. |
@seanmonstar |
petrochenkov
commented
Mar 14, 2019
(The unassignment is unintentional and looks like it's performed automatically by GitHub as a side effect of blocking.) |
davidbarsky
commented
Mar 14, 2019
@seanmonstar I was able to build and test your branch. I've pasted the test failures into a gist. |
Thanks for that, @davidbarsky. Yes, the error is clearly occurring in @seanmonstar So, I think the issue is that during the assembly of the map of all traits, trait aliases is being ignored. Take a look at Specifically, I think you want to modify fnvisit_item(&mutself,i:&'v hir::Item){iflet hir::ItemKind::Trait(..) = i.node{let def_id = self.map.local_def_id_from_hir_id(i.hir_id);self.traits.push(def_id);}}as well as the |
seanmonstar
commented
Mar 15, 2019
So I've managed to get the compiler building, and have since gone down a rabbit hole figuring this out:
So I'm thinking about next steps, possibly one of these is better:
Are both of those too crazy? |
seanmonstar
commented
Mar 15, 2019
I went for the second option, which got the one new run-pass test passing. I'm still a little iffy about it, and there should probably be some more compile-fail tests added. That come to mind:
|
rust-highfive
commented
Mar 15, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
alexreg
left a comment
There was a problem hiding this comment.
Good work. I think this is roughly the right approach, though I'll wait for someone else to confirm. See my suggestions in any case.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I think this call is right, but I'm no expert on this area, so perhaps someone else can confirm.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
alexreg
commented
Mar 15, 2019
Oh, and not sure if you noticed, but your previous build failed early because of tidy checks -- so just wrap these lines. |
seanmonstar
commented
Mar 18, 2019
Updated. |
alexreg
commented
Mar 19, 2019
@seanmonstar Thanks. This basically looks okay to me. Would someone else who is more familiar with this bit of code mind confirming everything is good? |
…lexreg resolve: collect trait aliases along with traits It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...) Fixesrust-lang#56485 r? @alexreg
bors
commented
Apr 2, 2019
⌛ Testing commit 3ccd35c with merge 2ad603c82a9a5ea9cc0b28b0c850e80587148a5d... |
bors
commented
Apr 2, 2019
💔 Test failed - checks-travis |
rust-highfive
commented
Apr 2, 2019
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Centril
commented
Apr 2, 2019
@bors retry |
bors
commented
Apr 2, 2019
⌛ Testing commit 3ccd35c with merge 23fa5c9586a98c9681ea76d6217f702e6ab473fb... |
…lexreg resolve: collect trait aliases along with traits It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...) Fixesrust-lang#56485 r? @alexreg
Centril
commented
Apr 2, 2019
@bors retry |
Rollup of 4 pull requests Successful merges: - #59166 (resolve: collect trait aliases along with traits) - #59341 (Fix custom relative libdir) - #59446 (Fix stack overflow when generating debuginfo for 'recursive' type) - #59529 (Added documentation on the remainder (Rem) operator for floating points.) Failed merges: r? @ghost
It seems trait aliases weren't being collected as
TraitCandidatesin resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...)Fixes#56485
r? @alexreg