Skip to content

Commit e056cb8

Browse files
committed
Use question mark to avoid ambiguity
1 parent 86edc29 commit e056cb8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_middle/src/ty/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ macro_rules! query_storage {
116116
([storage($ty:ty) $($rest:tt)*][$K:ty, $V:ty]) => {
117117
<$ty as CacheSelector<$K, $V>>::Cache
118118
};
119-
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*][$($args:tt)*]) => {
119+
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)?][$($args:tt)*]) => {
120120
query_storage!([$($($modifiers)*)*][$($args)*])
121121
};
122122
}

compiler/rustc_query_impl/src/plumbing.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ macro_rules! handle_cycle_error {
228228
$error.delay_as_bug();
229229
Value::from_cycle_error($tcx)
230230
}};
231-
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*][$($args:tt)*]) => {
231+
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)?][$($args:tt)*]) => {
232232
handle_cycle_error!([$($($modifiers)*)*][$($args)*])
233233
};
234234
}
@@ -240,7 +240,7 @@ macro_rules! is_anon {
240240
([anon $($rest:tt)*]) => {{
241241
true
242242
}};
243-
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*]) => {
243+
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)?]) => {
244244
is_anon!([$($($modifiers)*)*])
245245
};
246246
}
@@ -252,7 +252,7 @@ macro_rules! is_eval_always {
252252
([eval_always $($rest:tt)*]) => {{
253253
true
254254
}};
255-
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*]) => {
255+
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)?]) => {
256256
is_eval_always!([$($($modifiers)*)*])
257257
};
258258
}
@@ -264,7 +264,7 @@ macro_rules! hash_result {
264264
([no_hash $($rest:tt)*][$hcx:expr, $result:expr]) => {{
265265
None
266266
}};
267-
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)*][$($args:tt)*]) => {
267+
([$other:ident $(($($other_args:tt)*))* $(, $($modifiers:tt)*)?][$($args:tt)*]) => {
268268
hash_result!([$($($modifiers)*)*][$($args)*])
269269
};
270270
}

0 commit comments

Comments
 (0)