@@ -32,7 +32,7 @@ extern extern crate simd_rng_derive;*/
32
32
// This one is just to visually confirm the testing comments don't intefere
33
33
#[ macro_use]
34
34
extern crate std_web;
35
- /*#[macro_use]
35
+ /*#[macro_use]
36
36
extern extern crate simd_rng_derive;*/
37
37
38
38
let c = 'c' ;
@@ -1352,3 +1352,47 @@ impl<A> Thing for &'a mut A {}
1352
1352
// ^^ meta.impl storage.modifier.lifetime
1353
1353
// ^^^ meta.impl storage.modifier
1354
1354
// ^ meta.impl entity.name.impl
1355
+
1356
+ // dyn trait
1357
+ fn f( x: dyn T , y: Box <dyn T + ' static >, z: & dyn T ,
1358
+ // ^^^ meta.function.parameters storage.type.trait
1359
+ // ^^^ meta.function.parameters meta.generic storage.type.trait
1360
+ // ^^^ meta.function.parameters storage.type.trait
1361
+ f: & dyn Fn ( CrateNum ) -> bool ) -> dyn T {
1362
+ // ^^^ meta.function.parameters storage.type.trait
1363
+ // ^^^ meta.function.return-type storage.type.trait
1364
+ let x: & ( dyn ' static + Display ) = & BYTE ;
1365
+ // ^^^ meta.group storage.type.trait
1366
+ let y: Box <dyn Display + ' static > = Box :: new( BYTE ) ;
1367
+ // ^^^ meta.generic storage.type.trait
1368
+ let _: & dyn ( Display ) = & BYTE ;
1369
+ // ^^^ storage.type.trait
1370
+ let _: & dyn ( :: std:: fmt:: Display ) = & BYTE ;
1371
+ // ^^^ storage.type.trait
1372
+ const DT : & ' static dyn C = & V ;
1373
+ // ^^^ storage.type.trait
1374
+ struct S {
1375
+ f: dyn T
1376
+ // ^^^ meta.struct storage.type.trait
1377
+ }
1378
+ type D4 = dyn ( :: module:: Trait ) ;
1379
+ // ^^^ storage.type.trait
1380
+ }
1381
+
1382
+ // dyn is not a keyword in all situations (a "weak" keyword).
1383
+ type A0 = dyn;
1384
+ // ^^^ -storage.type.trait
1385
+ type A1 = dyn:: dyn;
1386
+ // ^^^^^ meta.path -storage.type.trait
1387
+ // ^^^ -storage.type.trait
1388
+ type A2 = dyn<dyn, dyn>;
1389
+ // ^^^ meta.generic -storage.type.trait
1390
+ // ^^^ meta.generic -storage.type.trait
1391
+ // ^^^ meta.generic -storage.type.trait
1392
+ // This is incorrect. `identifier` should not match on the keyword `as`.
1393
+ // However, avoiding keywords is a little complicated and slow.
1394
+ type A3 = dyn<<dyn as dyn>:: dyn>;
1395
+ // ^^^ meta.generic -storage.type.trait
1396
+ // ^^^ meta.generic storage.type.trait
1397
+ // ^^^ meta.generic -storage.type.trait
1398
+ // ^^^ meta.generic -storage.type.trait
0 commit comments