File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -296,9 +296,11 @@ impl<'a> TyLoweringContext<'a> {
296
296
}
297
297
}
298
298
TypeRef :: Macro ( macro_call) => {
299
- let ( expander, recursion_start) = match self . expander . borrow_mut ( ) {
300
- expander if expander. is_some ( ) => ( Some ( expander) , false ) ,
301
- mut expander => {
299
+ let ( expander, recursion_start) = {
300
+ let mut expander = self . expander . borrow_mut ( ) ;
301
+ if expander. is_some ( ) {
302
+ ( Some ( expander) , false )
303
+ } else {
302
304
if let Some ( module_id) = self . resolver . module ( ) {
303
305
* expander = Some ( Expander :: new (
304
306
self . db . upcast ( ) ,
Original file line number Diff line number Diff line change @@ -1248,24 +1248,28 @@ fn macros_in_type_generics() {
1248
1248
fn infinitely_recursive_macro_type ( ) {
1249
1249
check_infer (
1250
1250
r#"
1251
- struct Bar<T>(T);
1251
+ struct Bar<T, X >(T, X );
1252
1252
1253
1253
macro_rules! Foo {
1254
1254
() => { Foo!() }
1255
1255
}
1256
1256
1257
+ macro_rules! U32 {
1258
+ () => { u32 }
1259
+ }
1260
+
1257
1261
type A = Foo!();
1258
- type B = Bar<Foo!()>;
1262
+ type B = Bar<Foo!(), U32!() >;
1259
1263
1260
1264
fn main() {
1261
1265
let a: A;
1262
1266
let b: B;
1263
1267
}
1264
1268
"# ,
1265
1269
expect ! [ [ r#"
1266
- 112..143 '{ ...: B; }': ()
1267
- 122..123 'a': {unknown}
1268
- 136..137 'b': Bar<{unknown}>
1270
+ 166..197 '{ ...: B; }': ()
1271
+ 176..177 'a': {unknown}
1272
+ 190..191 'b': Bar<{unknown}, u32 >
1269
1273
"# ] ] ,
1270
1274
) ;
1271
1275
}
You can’t perform that action at this time.
0 commit comments