Skip to content

No way to reference primitives by absolute path #44865

Closed

Description

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.

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

Metadata

Assignees

No one assigned

    Labels

    C-feature-acceptedCategory: A feature request that has been accepted pending implementation.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions