Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustdoc generates invalid code for struct-like enums #9587

Closed
sfackler opened this issue Sep 28, 2013 · 3 comments
Closed

Rustdoc generates invalid code for struct-like enums #9587

sfackler opened this issue Sep 28, 2013 · 3 comments
Assignees
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@sfackler
Copy link
Member

For example, the enum

pub enum FrontendMessage<'self> {
    Bind {
        portal: &'self str,
        statement: &'self str,
        formats: &'self [i16],
        values: &'self [Option<~[u8]>],
        result_formats: &'self [i16]
    },
    Close {
        variant: u8,
        name: &'self str
    },
    Describe {
        variant: u8,
        name: &'self str
    },
    Execute {
        portal: &'self str,
        max_rows: i32
    },
    Parse {
        name: &'self str,
        query: &'self str,
        param_types: &'self [i32]
    },
    PasswordMessage {
        password: &'self str
    },
    Query {
        query: &'self str
    },
    StartupMessage {
        version: i32,
        parameters: &'self [(~str, ~str)]
    },
    Sync,
    Terminate
}

shows up in rustdoc as

pub enum FrontendMessage<'self> {
struct Bind {
    portal: &'self str,
        statement: &'self str,
        formats: &'self [i16],
        values: &'self [std::option::Option],
        result_formats: &'self [i16],
    }struct Close {
    variant: u8,
        name: &'self str,
    }struct Describe {
    variant: u8,
        name: &'self str,
    }struct Execute {
    portal: &'self str,
        max_rows: i32,
    }struct Parse {
    name: &'self str,
        query: &'self str,
        param_types: &'self [i32],
    }struct PasswordMessage {
    password: &'self str,
    }struct Query {
    query: &'self str,
    }struct StartupMessage {
    version: i32,
        parameters: &'self [(~str, ~str)],
    }    Sync,
    Terminate,
}
@sfackler
Copy link
Member Author

cc @alexcrichton

@huonw
Copy link
Member

huonw commented Sep 28, 2013

Hah, nice. (cc @alexcrichton, @Seldaek, @cmr.)

@alexcrichton
Copy link
Member

That would indeed be my fault, assigning myself.

@ghost ghost assigned alexcrichton Sep 28, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 6, 2022
[arithmetic-side-effects] Do not ignore literal references

To my utter surprise, `rustc` does does not warn stuff like `let n: u8 = &255 + &1` or `let n: u8 = 255 + &1`.

changelog: [arithmetic-side-effects] Do not ignore literal references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants