mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-28 11:38:01 +00:00
Fix unused_parens false positive Resolves rust-lang/rust#143653. The "no bounds exception" was indiscriminately set to `OneBound` for referents and pointees. However, if the reference or pointer type itself appears in no-bounds position, any constraints it has must be propagated. ```rust // unused parens: not in no-bounds position fn foo(_: Box<(dyn Send)>) {} // unused parens: in no-bounds position, but one-bound exception applies fn bar(_: Box<dyn Fn(&u32) -> &(dyn Send)>) {} // *NOT* unused parens: in no-bounds position, but no exceptions to be made fn baz(_: Box<dyn Fn(&u32) -> &(dyn Send) + Send>) {} ```