Skip to content

Missing parentheses around trait object in rustdoc #42299

@dtolnay

Description

@dtolnay
Member
pub fn f(_: &(ToString + 'static)) {}

This function is documented as:

selection_055

The parentheses are missing and the function would not compile without them:

error[E0178]: expected a path on the left-hand side of `+`, not `&ToString`
 --> src/main.rs:1:13
  |
1 | pub fn f(_: &ToString + 'static) {}
  |             ^^^^^^^^^^^^^^^^^^^ help: try adding parentheses: `&(ToString + 'static)`

Activity

GuillaumeGomez

GuillaumeGomez commented on May 30, 2017

@GuillaumeGomez
Member

Well found! Taking a look.

added a commit that references this issue on May 31, 2017
fd7b44b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @dtolnay@GuillaumeGomez

      Issue actions

        Missing parentheses around trait object in rustdoc · Issue #42299 · rust-lang/rust