Skip to content

Fix exports in core::libc #2006

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
catamorphism opened this issue Mar 16, 2012 · 3 comments
Closed

Fix exports in core::libc #2006

catamorphism opened this issue Mar 16, 2012 · 3 comments
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Milestone

Comments

@catamorphism
Copy link
Contributor

core::libc has FIXMEs about cleaning up exports. I'm not sure I exactly understand what needs to be done, so am just filing it.

@graydon
Copy link
Contributor

graydon commented Mar 21, 2012

This is probably blocked on rewriting resolve. I want the exports from libc to have the following characteristics:

  • There is a list of explicit exports-from-libc that is statically checked to ensure those definitions are present on all platforms. In the rewrite this will probably take the form of a list of pub import ... directives.
  • There are a bunch of residual globs that pick up and re-export everything else beyond the intersection list, so that when you're on platform foo that has a libc definition funcs::os::extras::bar() you can just call libc::bar() and it'll build on that platform. But you will have made platform-specific code by doing so. This will be a list of pub import ...* globs.

Currently, export globs don't work terribly well. They kinda work for exporting a bunch of items, but not for re-exporting a glob-import from somewhere else. And I think there was an ordering problem of some sort. I eventually gave up and left it as-is, with the few platform-specific cases explicitly glob-importing definitions from the inner modules of libc. Which is undesirable in the longer term.

@ghost ghost assigned graydon Mar 21, 2012
@catamorphism
Copy link
Contributor Author

No longer blocked on resolve.

@graydon
Copy link
Contributor

graydon commented Sep 13, 2012

So minor! Yet blocked on pub use not quite working right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

2 participants