Skip to content

Missing parentheses around trait object in rustdoc #42299

Closed
@dtolnay

Description

@dtolnay
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)`

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

Issue actions