Skip to content
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

default methods are broken cross crate when defined on structs #7481

Closed
thestinger opened this issue Jun 29, 2013 · 7 comments
Closed

default methods are broken cross crate when defined on structs #7481

thestinger opened this issue Jun 29, 2013 · 7 comments

Comments

@thestinger
Copy link
Contributor

let xs = [1, 2, 3, 9, 11]; xs.iter().take_(2).size_hint()
<anon>:9:36: 10:5 error: internal compiler error: method not found in AST map?!
<anon>:9          let xs = [1, 2, 3, 9, 11]; xs.iter().take_(2).size_hint()
<anon>:10     };
@pnkfelix
Copy link
Member

Part of #2794

@Aatch
Copy link
Contributor

Aatch commented Jun 29, 2013

A quick check shows it happens during privacy checking and the error is emitted on line 127 of privacy.rs.

@thestinger
Copy link
Contributor Author

@Aatch: that's probably just the first thing to look for it

@Aatch
Copy link
Contributor

Aatch commented Jun 29, 2013

@thestinger looks like you're right. I did a little more digging and it looks like default methods are pulled out of the crate metadata in this instance. Inlining is strange because the definition is considered to be in the local crate, but also not, depending on who you ask...

@msullivan
Copy link
Contributor

It isn't clear to me that inline is actually related to this... I see what is going wrong and my biggest question at this point is how anything /ever/ works... Continuing to investigate.

@msullivan
Copy link
Contributor

Got it. If the type of the receiver is a struct, privacy checking breaks when you try to invoke a default method from another crate. Renamed the bug.

@msullivan
Copy link
Contributor

Have a fix that I'll push soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants