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
unused_parens: False positive on parenthesized type-relative paths that would otherwise be interpreted as the start of a generic param list (impl<T>, for<T>, where<T>) #107235
warning: unnecessary parentheses around type
--> src/lib.rs:2:6
|
2 | impl (<Something>::Item) {}
| ^ ^
|
= note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
|
2 - impl (<Something>::Item) {}
2 + impl <Something>::Item {}
|
error[E0223]: ambiguous associated type
--> src/lib.rs:2:7
|
2 | impl (<Something>::Item) {}
| ^^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<Something as IntoIterator>::Item`
For more information about this error, try `rustc --explain E0223`.
warning: `playground` (lib) generated 1 warning
error: could not compile `playground` (lib) due to previous error; 1 warning emitted
on rustc nightly 2023-07-29
Desired output
Same thing without the unused_parens warning.
Rationale and extra context
Without the parentheses, it would be equivalent to
impl<Something>::Item{}
Note that Something is now a generic type and ::Item is a standalone item path.