Open
Description
Code
I tried this code:
#![deny(unused_parens)]
#![allow(warnings)]
trait MyTrait {}
fn foo(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait) + Send + Sync>) {}
fn main() {}
I expected compile with no warnings, but instead, the current nightly yields:
error: unnecessary parentheses around type
--> src/main.rs:5:43
|
5 | fn foo(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait) + Send + Sync>) {}
| ^ ^
|
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![deny(unused_parens)]
| ^^^^^^^^^^^^^
help: remove these parentheses
|
5 - fn foo(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait) + Send + Sync>) {}
5 + fn foo(_: Box<dyn FnMut(&mut u32) -> &mut dyn MyTrait + Send + Sync>) {}
|
error: aborting due to 1 previous error
Version with regression
Bisecting via cargo-bisect-rustc yields:
searched nightlies: from nightly-2025-07-02 to nightly-2025-07-08
regressed nightly: nightly-2025-07-04
searched commit range: 6677875...da58c05
regressed commit: 25face9
bisected with cargo-bisect-rustc v0.6.10
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
cargo bisect-rustc
where my guess is that #142237 is the cause (cc @benschulz as the author)
Metadata
Metadata
Assignees
Labels
Area: Lints (warnings about flaws in source code) such as unused_mut.Category: This is a bug.Issue: Indicates that prioritization has been requested for this issue.Lint: False positive (should not have fired).Lint: unused_parensRelevant to the compiler team, which will review and decide on the PR/issue.Untriaged performance or correctness regression.