Skip to content

const_err warns about casting bytestring to raw pointer #33452

@Ms2ger

Description

@Ms2ger
Contributor

In particular, b"TouchList\0" as *const u8. We can't use as_ptr() because it's in a const context.

Activity

oli-obk

oli-obk commented on May 6, 2016

@oli-obk
Contributor

whoops, on it

added a commit that references this issue on May 9, 2016
faca79f
nox

nox commented on May 10, 2016

@nox
Contributor
error: internal compiler error: ../src/librustc_mir/transform/promote_consts.rs:204: tmp4 not promotable: Unpromotable
   --> /Users/nox/src/servo/components/script/dom/bindings/interface.rs:122:23
122 |>                 name: b"Function\0" as *const _ as *const libc::c_char,
    |>                       ^^^^^^^^^^^^^
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

Please reopen.

oli-obk

oli-obk commented on May 10, 2016

@oli-obk
Contributor

hmm... that's a different issue. @eddyb this looks like your new constant code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Ms2ger@nox@oli-obk

      Issue actions

        const_err warns about casting bytestring to raw pointer · Issue #33452 · rust-lang/rust