Skip to content

Commit ec6b748

Browse files
authored
Rollup merge of #96149 - est31:remove_unused_macro_matchers, r=petrochenkov
Remove unused macro rules Removes rules of internal macros that weren't triggered.
2 parents 1e80b2a + 8e5cd9c commit ec6b748

File tree

3 files changed

+0
-37
lines changed

3 files changed

+0
-37
lines changed

core/src/internal_macros.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// implements the unary operator "op &T"
22
// based on "op T" where T is expected to be `Copy`able
33
macro_rules! forward_ref_unop {
4-
(impl $imp:ident, $method:ident for $t:ty) => {
5-
forward_ref_unop!(impl $imp, $method for $t,
6-
#[stable(feature = "rust1", since = "1.0.0")]);
7-
};
84
(impl const $imp:ident, $method:ident for $t:ty) => {
95
forward_ref_unop!(impl const $imp, $method for $t,
106
#[stable(feature = "rust1", since = "1.0.0")]);
@@ -38,10 +34,6 @@ macro_rules! forward_ref_unop {
3834
// implements binary operators "&T op U", "T op &U", "&T op &U"
3935
// based on "T op U" where T and U are expected to be `Copy`able
4036
macro_rules! forward_ref_binop {
41-
(impl $imp:ident, $method:ident for $t:ty, $u:ty) => {
42-
forward_ref_binop!(impl $imp, $method for $t, $u,
43-
#[stable(feature = "rust1", since = "1.0.0")]);
44-
};
4537
(impl const $imp:ident, $method:ident for $t:ty, $u:ty) => {
4638
forward_ref_binop!(impl const $imp, $method for $t, $u,
4739
#[stable(feature = "rust1", since = "1.0.0")]);
@@ -230,22 +222,6 @@ macro_rules! cfg_if {
230222
}
231223
};
232224

233-
// match if/else chains lacking a final `else`
234-
(
235-
if #[cfg( $i_meta:meta )] { $( $i_tokens:tt )* }
236-
$(
237-
else if #[cfg( $e_meta:meta )] { $( $e_tokens:tt )* }
238-
)*
239-
) => {
240-
cfg_if! {
241-
@__items () ;
242-
(( $i_meta ) ( $( $i_tokens )* )) ,
243-
$(
244-
(( $e_meta ) ( $( $e_tokens )* )) ,
245-
)*
246-
}
247-
};
248-
249225
// Internal and recursive macro to emit all the items
250226
//
251227
// Collects all the previous cfgs in a list at the beginning, so they can be

core/tests/num/ops.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,6 @@ macro_rules! impls_defined {
4343
}
4444

4545
macro_rules! test_op {
46-
($fn_name:ident, $op:ident::$method:ident($lhs:literal, $rhs:literal), $result:literal, $($t:ty),+) => {
47-
#[test]
48-
fn $fn_name() {
49-
impls_defined!($op, $method($lhs, $rhs), $result, $($t),+);
50-
}
51-
};
52-
($fn_name:ident, $op:ident::$method:ident(&mut $lhs:literal, $rhs:literal), $result:literal, $($t:ty),+) => {
53-
#[test]
54-
fn $fn_name() {
55-
impls_defined!($op, $method(&mut $lhs, $rhs), $result, $($t),+);
56-
}
57-
};
5846
($fn_name:ident, $op:ident::$method:ident($lhs:literal), $result:literal, $($t:ty),+) => {
5947
#[test]
6048
fn $fn_name() {

proc_macro/src/quote.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ macro_rules! quote_tt {
1212
({$($t:tt)*}) => { Group::new(Delimiter::Brace, quote!($($t)*)) };
1313
(,) => { Punct::new(',', Spacing::Alone) };
1414
(.) => { Punct::new('.', Spacing::Alone) };
15-
(:) => { Punct::new(':', Spacing::Alone) };
1615
(;) => { Punct::new(';', Spacing::Alone) };
1716
(!) => { Punct::new('!', Spacing::Alone) };
1817
(<) => { Punct::new('<', Spacing::Alone) };

0 commit comments

Comments
 (0)