Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Use of assert!() and debug_assert!() #7

@Wrench56

Description

@Wrench56

Previously, we decided during charlotte_core development that assert!() macros are to be avoided. They are unambigious, coming from a C environment might make you think that they are compile time asserts, in reality, they are runtime checks in Rust. Additionally, they panic, the whole point of this repository is to provide a non-panicing alloc module. Note: debug_alloc!() is NOT included in release builds, but they are included in debug build. I believe we should not be using any of the assert!()-s to keep things simple. Especially in this library, since panicing here is fatal for the OS.

Files such as lib.rs do use debug_assert!() statements, please either remove them, or even better, somehow check them but without panicing. Returning a Result is one way of fixing these things, another would be to use the already discussed "callback logger".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions