diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-31 09:11:59 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-02-13 11:25:33 +0100 |
| commit | fcce5fa6e7ba67db63674dc7369125875c7f39a2 (patch) | |
| tree | 48f9d57e006e223c9a062b294a5b35b44aaf4d38 | |
| parent | 7518492315346ac3821ad9264e08721a571742c8 (diff) | |
| download | rust-fcce5fa6e7ba67db63674dc7369125875c7f39a2.tar.gz rust-fcce5fa6e7ba67db63674dc7369125875c7f39a2.zip | |
expand: simplify classify_*
| -rw-r--r-- | src/librustc_expand/expand.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/librustc_expand/expand.rs b/src/librustc_expand/expand.rs index 136cc1d94a0..91195d379d7 100644 --- a/src/librustc_expand/expand.rs +++ b/src/librustc_expand/expand.rs @@ -1041,13 +1041,10 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { } /// If `item` is an attr invocation, remove and return the macro attribute and derive traits. - fn classify_item<T>( + fn classify_item( &mut self, - item: &mut T, - ) -> (Option<ast::Attribute>, Vec<Path>, /* after_derive */ bool) - where - T: HasAttrs, - { + item: &mut impl HasAttrs, + ) -> (Option<ast::Attribute>, Vec<Path>, /* after_derive */ bool) { let (mut attr, mut traits, mut after_derive) = (None, Vec::new(), false); item.visit_attrs(|mut attrs| { @@ -1061,9 +1058,9 @@ impl<'a, 'b> InvocationCollector<'a, 'b> { /// Alternative to `classify_item()` that ignores `#[derive]` so invocations fallthrough /// to the unused-attributes lint (making it an error on statements and expressions /// is a breaking change) - fn classify_nonitem<T: HasAttrs>( + fn classify_nonitem( &mut self, - nonitem: &mut T, + nonitem: &mut impl HasAttrs, ) -> (Option<ast::Attribute>, /* after_derive */ bool) { let (mut attr, mut after_derive) = (None, false); |
