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

Missing parentheses around trait object in rustdoc #42299

Closed
dtolnay opened this issue May 29, 2017 · 1 comment
Closed

Missing parentheses around trait object in rustdoc #42299

dtolnay opened this issue May 29, 2017 · 1 comment
Assignees

Comments

@dtolnay
Copy link
Member

dtolnay commented May 29, 2017

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)`
@GuillaumeGomez
Copy link
Member

Well found! Taking a look.

@GuillaumeGomez GuillaumeGomez self-assigned this May 30, 2017
bors added a commit that referenced this issue May 31, 2017
…isdreavus

Fix signature by adding parens when needed

Fixes #42299.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants