Skip to content

fail and fail_bounds_checks lang items should take &'static str not *u8 #12378

Closed
@huonw

Description

@huonw

These lang items are currently defined as

pub fn fail_(expr: *u8, file: *u8, line: uint) -> !
pub fn fail_bounds_check(file: *u8, line: uint, index: uint, len: uint) -> !

We convert the expr and file arguments to &'static str via unsafe internally, but we could just avoid this and have the compiler emit them as slices rather than C strings.

cc #12357.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions