Skip to content

No way to reference primitives by absolute path #44865

Description

@sgrif

I got a bug report on Diesel from someone who has a database column called bool. This lead to us attempting to generate the following code:

pub struct bool;

impl QueryId for bool {
    type QueryId = Self;
    const HAS_STATIC_QUERY_ID: bool = true;
}

which causes a type mismatch because their struct is shadowing the primitive. I'd like to change the generated code to be const HAS_STATIC_QUERY_ID: ::std::bool, which is the path that the rustdoc for libstd indicates it should be, but the type doesn't exist there, or anywhere else I can find. I would assume the same issue exists for str, char, and all the numeric types.

Activity

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

    C-feature-acceptedCategory: A feature request that has been accepted pending implementation.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions