Fix cross-crate inlining of static methods#4098
Conversation
|
"some random number"? that's somewhat worrying. can we trap that condition? |
|
Sorry, I didn't literally mean 'random', I just mean that all method AST nodes have a def_id for the 'self' parameter, even if they are static methods. |
|
Huh. Ok. I guess I was asking whether that ought to be But that's kinda janitorial and shouldn't block this. This looks fine for now. |
|
It seems like it should, yes. I guess I should have asked plainly in the pull request whether I should make the proper refactoring. Since you are uncomfortable with it too, I'll keep at it and try to fix the AST. |
add warning explaining the limitations of the native code mode
r? @pcwalton
This fixes translation of static methods with inline attributes, sourced from non-local crates. The problem is that maybe_instantiate_inline tries to look up the self type according to the self_did of the encoded inline method, and for static methods that did is just some random number unassociated with any type (afaict).