Skip to content

Disallow importing from types when reexport is involved #15733

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

Closed
wants to merge 1 commit into from

Conversation

sanxiyn
Copy link
Member

@sanxiyn sanxiyn commented Jul 17, 2014

Importing from types was disallowed in #6462. Flag was set for paths whether it is a module or a type. Type flag was set when impl was seen. The problem is, for cross-crate situations, when reexport is involved, it is possible that impl is seen too late because metadata is loaded lazily.

Fix #15664.

@huonw
Copy link
Member

huonw commented Jul 17, 2014

Does this fix #15528 too - after this lands, it should be impossible to trigger that bug?

@sanxiyn
Copy link
Member Author

sanxiyn commented Jul 17, 2014

Yes, it should be impossible to trigger that bug using the provided testcase. I am not sure in general though.

bors added a commit that referenced this pull request Jul 18, 2014
Importing from types was disallowed in #6462. Flag was set for paths whether it is a module or a type. Type flag was set when impl was seen. The problem is, for cross-crate situations, when reexport is involved, it is possible that impl is seen too late because metadata is loaded lazily.

Fix #15664.
@bors bors closed this Jul 18, 2014
@edwardw
Copy link
Contributor

edwardw commented Jul 18, 2014

I can confirm that #15528 has been fixed by this.

@sanxiyn sanxiyn deleted the use-from-type branch July 18, 2014 16:05
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

Successfully merging this pull request may close these issues.

Inconsistent behavior when importing type implementation from local crate vs. cross-crate
5 participants