You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
fnsomething(&self) -> i32(){// ^^ parenthesized params
..
let x = self.foo()asusize();// ^^ 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.
I don't know if this should go here, I am new to Rust and I still make mistakes such as confuse ":" and "=" for struct. Today, the compiler brought me here through a link because of this error. Is this the standard behavior for this kind of error.
error: parenthesized parameters may only be used with a trait --> src/main.rs:100:28 | 100 | let mut ally : Pod::new(); | ^^ | = note: #[deny(parenthesized_params_in_types_and_modules)] on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>
Activity
Add warning cycle rust-lang#42238.
qnighy commentedon Jun 12, 2017
I noticed there is a case where
()cannot just be removed.The cause is the well-known ambiguity between "less-than" and "open angle bracket". In this case, you can fix the problem like this:
tchamelot commentedon Jan 3, 2019
I don't know if this should go here, I am new to Rust and I still make mistakes such as confuse ":" and "=" for struct. Today, the compiler brought me here through a link because of this error. Is this the standard behavior for this kind of error.
error: parenthesized parameters may only be used with a trait --> src/main.rs:100:28 | 100 | let mut ally : Pod::new(); | ^^ | = note: #[deny(parenthesized_params_in_types_and_modules)] on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #42238 <https://github.com/rust-lang/rust/issues/42238>Auto merge of #63247 - Centril:compat-to-error, r=<try>
Rollup merge of rust-lang#65785 - Centril:compat-to-error-2, r=oli-obk
Rollup merge of rust-lang#65785 - Centril:compat-to-error-2, r=oli-obk