Skip to content

Limitations #1

Closed
Closed
@nvzqz

Description

@nvzqz

Currently the following macros are only available from within the context of a function:

  • assert_eq_size (commit f3da7e4)
    • Relies on forget, transmute, and uninitialized as provided by core::mem. transmute and uninitialized are marked as unsafe, which makes it unlikely for them to become const.
    • Could provide an assertion built on const_assert if mem::size_of were a const fn. To resolve the limitation, const_assert would need to be resolved first.
  • const_assert (commit b7ca44e)
  • const_assert_eq (commit b7ca44e)
    • Dependent on const_assert, so resolving that macro would resolve this one.

Commits b7ca44e and f3da7e4 have somewhat resolved this.

The following macros now require labels (identifiers) unique to their namespace to be used in a non-function context:

  • assert_eq_size
  • assert_obj_safe
  • assert_impl
  • const_assert
  • const_assert_eq

This, along with having more assertions available (#2), would allow for a 1.0.0 release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions