Skip to content

pr_ macros evaluate arguments in unsafe blocks #479

@wedsonaf

Description

@wedsonaf

So something like:

let x = &10u32 as *const u32;
pr_info!("{}", *x);

compiles when it should require an explicit unsafe block around *x.

This is actually a recurring problem we've been finding with our macros. Is there anything we can do to detect this automatically?

Metadata

Metadata

Assignees

No one assigned

    Labels

    unsoundThe possibility of UB in safe code.• libRelated to the `rust/` library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions