Skip to content

What do we do with "unconst" operations? #14

Open

Description

Spawned off rust-lang/rust#55009 (comment) (a PR making raw pointer to usize casts unsafe and making raw pointer operations unsafe.

These unconst operations are explained in https://github.com/rust-rfcs/const-eval/blob/master/const_safety.md

There is the question of whether we should overload unsafe to also mean unconst in const environments or whether we should create a new keyword like unconst, const unsafe or similar. The PR linked above uses the unsafe keyword (but all operations still require feature gates).

My view is that unsafe allows you to do things that the compiler can't prove as sound but are still sound. If you mess that up, your code is unsound. Adding another keyword like unconst which means essentially the same thing (but for a different set of operations), feels like it does not add any gains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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