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

WIP implement a machine readable print-type-info API #43761

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
8 participants
@Gankro
Copy link
Contributor

Gankro commented Aug 9, 2017

This is very messy, with some commented out stuff and some TODOs. I'm posting this now to get feedback on the approach, and so someone can tell me where stuff should go or if I'm doing some things fundamentally wrong. Note that I'm currently clobbering -Zprint-type-sizes to avoid doing driver plumbing atm.

Background Proposal (doesn't completely match impl, see below)

Draft Documentation

Sample output on gecko/gfx/webrender_bindings

Differences from background proposal:

  • Added Opaque, PrimitiveInt, and PrimtiveFloat kinds
  • Removed support for "General" enums, as binding to them in a stable way will be hard (can be done in later versions without breaking, per draft docs)
  • Backpedaled on "squashing" Rust concepts into C concepts; consumer is expected to do this themselves (see "builtin syntax" in docs)
    • Consequently suppressed more forms from being emitted (see "ommitted builtins" in docs)
  • Expected to emit every path a type can be found under (e.g. core::option::Option and std::option::Option)

TODO

  • get Visibility of types (help)
  • get type/path aliases (help!)
  • emit whether a given type is "transparent" for ABI purposes? (Box == *mut)
  • set this up as a "target format" flag, instead of -Zprint-type-sizes
  • capture public types that aren't used anywhere in the code?
  • ensure primtives are always output? (clike enums may be emitted with otherwise unused primitive base-types)
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Aug 9, 2017

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@Gankro

This comment has been minimized.

Copy link
Contributor Author

Gankro commented Aug 9, 2017

@Gankro Gankro force-pushed the Gankro:print-types branch from a411eff to a0e19fd Aug 11, 2017

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 11, 2017

☔️ The latest upstream changes (presumably #42932) made this pull request unmergeable. Please resolve the merge conflicts.

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Aug 22, 2017

What's the status of this PR? Do you need any help (I won't be available until this Monday)?

@Gankro

This comment has been minimized.

Copy link
Contributor Author

Gankro commented Aug 27, 2017

Hey @arielb1 sorry I pivoted off this a bit and then went on vacation. Tomorrow I get back to work and, unless I get some information stating otherwise, this should be my top priority.

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Sep 5, 2017

Hi @Gankro are you still working on this? Just a ping to make sure it isn't getting lost.

@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Sep 11, 2017

Hiii Ganksy, triage procedure says a PR with >14 days of no author activity gets closed as inactive. Feel free to reopen when you have a chance to get back to this!

@Gankro

This comment has been minimized.

Copy link
Contributor Author

Gankro commented Sep 11, 2017

Yeah I'll get back to this once I've got all the fires in webrender put out!

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Sep 11, 2017

I have a branch in progress which if I get out soon would provide a much better baseline for this.

@Gankro

This comment has been minimized.

Copy link
Contributor Author

Gankro commented Oct 18, 2017

@eddyb's branch became #45225, for reference.

@Gankro

This comment has been minimized.

Copy link
Contributor Author

Gankro commented Oct 18, 2017

(continuing this work is blocked on that PR)

@RReverser

This comment has been minimized.

Copy link
Contributor

RReverser commented Feb 24, 2018

@Gankro Given that the referenced PR was merged couple of months ago, are there any other blockers for this one left? (apart from free time, of course 😄 )

@Gankro

This comment has been minimized.

Copy link
Contributor Author

Gankro commented Feb 26, 2018

My enum RFC combined with cbindgen relieves a lot of pressure on this, and i'm recovering on indeterminate-length leave right now, so if you're interested I suggest taking this over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.