Skip to content

Invalid cast to pointer should be allowed #1226

@philberty

Description

@philberty

I tried this code:

const TEST: *mut u8 = 123 as *mut u8;

I expected to see this happen: compile without error

Instead, this happened:

<source>:1:30: error: invalid cast [<integer>] to [* mut u8]
    1 | const TEST: *mut u8 = 123 as *mut u8;
      |                       ~      ^

Meta

  • What version of Rust GCC were you using, git sha if possible. 74e8365

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions