Commit Graph

4 Commits

Author SHA1 Message Date
Ingvar Stepanyan 8ea3b2d25f Respect visibility of constants (#314)
Fixes #123:
 - Adds visibility check for module-level constants.
 - Adds visibility check for associated constants.
 - Fixes bitflags expansion to produce public associated constants (as the real expansion does).
2019-04-16 11:25:23 +02:00
Emilio Cobos Álvarez e14f782743 constant: Handle Self in associated constants.
WebRender used to do this and it's not hard to handle.
2019-03-12 10:19:49 -05:00
Emilio Cobos Álvarez 61b3de43a3 constant: Don't generate constants for structs that don't exist or are not safe. 2019-03-06 14:14:02 -06:00
IGI-111 110c3e481c Add support for associated constants and struct literals (#170)
* handle associated constants and struct literals

This aims to fix #100 by adding parsing support for associated constants, and
struct literal expressions.

It duplicates some of the parsing for constants, but sadly ImplItemConst and
ImplConst (as well as their children) don't share a common trait
that would allow for genericity.

It also uses the same namespace for both constants and associated
constants, which could cause conflicts in valid Rust with shared const names in
different scopes.

The struct literals use the standard C99 syntax. Do mind that the
limitations on literal expressions still apply.

* added test cases

* fix formatting
2018-10-01 16:37:51 -05:00