Skip to content

Commit fcce5fa

Browse files
committed
expand: simplify classify_*
1 parent 7518492 commit fcce5fa

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/librustc_expand/expand.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,10 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
10411041
}
10421042

10431043
/// If `item` is an attr invocation, remove and return the macro attribute and derive traits.
1044-
fn classify_item<T>(
1044+
fn classify_item(
10451045
&mut self,
1046-
item: &mut T,
1047-
) -> (Option<ast::Attribute>, Vec<Path>, /* after_derive */ bool)
1048-
where
1049-
T: HasAttrs,
1050-
{
1046+
item: &mut impl HasAttrs,
1047+
) -> (Option<ast::Attribute>, Vec<Path>, /* after_derive */ bool) {
10511048
let (mut attr, mut traits, mut after_derive) = (None, Vec::new(), false);
10521049

10531050
item.visit_attrs(|mut attrs| {
@@ -1061,9 +1058,9 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
10611058
/// Alternative to `classify_item()` that ignores `#[derive]` so invocations fallthrough
10621059
/// to the unused-attributes lint (making it an error on statements and expressions
10631060
/// is a breaking change)
1064-
fn classify_nonitem<T: HasAttrs>(
1061+
fn classify_nonitem(
10651062
&mut self,
1066-
nonitem: &mut T,
1063+
nonitem: &mut impl HasAttrs,
10671064
) -> (Option<ast::Attribute>, /* after_derive */ bool) {
10681065
let (mut attr, mut after_derive) = (None, false);
10691066

0 commit comments

Comments
 (0)