Skip to content

parenthesized_params_in_types_and_modules future-compatibility warnings #42238

Closed
@qnighy

Description

@qnighy

This is the summary issue for the PARENTHESIZED_PARAMS_IN_TYPES_AND_MODULES future-compatibility warning and other related errors. The goal of this page is describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made.

What is the warning for?

The parenthesized_params_in_types_and_modules warning is issued when you use parenthesized generic parameters in modules, primitive types, type parameters, or Self. For structs, enums, enum variants, unions, and type aliases, the syntax has already issued an error. Typical example of this warning is a code like this:

fn something(&self) -> i32 () {
  //                       ^^ parenthesized params

  ..
  let x = self.foo() as usize();
  //                         ^^ parenthesized params
  ..
}

This warning can always be fixed by removing the parentheses.

When will this warning become a hard error?

At the beginning of each 6-week release cycle, the Rust compiler team will review the set of outstanding future compatibility warnings and nominate some of them for Final Comment Period. Toward the end of
the cycle, we will review any comments and make a final determination whether to convert the warning into a hard error or remove it entirely.

Current status

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-unstableBlocker: Implemented in the nightly compiler and unstable.C-future-incompatibilityCategory: Future-incompatibility lintsT-compilerRelevant to the compiler 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