@@ -1514,3 +1514,47 @@ fn f<L: IntoIterator<Item=(&'a i32, &'a i32)>>(lhs: L) {}
1514
1514
// ^ punctuation.definition.generic.begin
1515
1515
// ^ punctuation.definition.generic.end
1516
1516
// ^ meta.function meta.function.parameters punctuation.definition.parameters.begin
1517
+
1518
+ // dyn trait
1519
+ fn f( x: dyn T , y: Box <dyn T + ' static >, z: & dyn T ,
1520
+ // ^^^ meta.function.parameters storage.type.trait
1521
+ // ^^^ meta.function.parameters meta.generic storage.type.trait
1522
+ // ^^^ meta.function.parameters storage.type.trait
1523
+ f: & dyn Fn ( CrateNum ) -> bool ) -> dyn T {
1524
+ // ^^^ meta.function.parameters storage.type.trait
1525
+ // ^^^ meta.function.return-type storage.type.trait
1526
+ let x: & ( dyn ' static + Display ) = & BYTE ;
1527
+ // ^^^ meta.group storage.type.trait
1528
+ let y: Box <dyn Display + ' static > = Box :: new( BYTE ) ;
1529
+ // ^^^ meta.generic storage.type.trait
1530
+ let _: & dyn ( Display ) = & BYTE ;
1531
+ // ^^^ storage.type.trait
1532
+ let _: & dyn ( :: std:: fmt:: Display ) = & BYTE ;
1533
+ // ^^^ storage.type.trait
1534
+ const DT : & ' static dyn C = & V ;
1535
+ // ^^^ storage.type.trait
1536
+ struct S {
1537
+ f: dyn T
1538
+ // ^^^ meta.struct storage.type.trait
1539
+ }
1540
+ type D4 = dyn ( :: module:: Trait ) ;
1541
+ // ^^^ storage.type.trait
1542
+ }
1543
+
1544
+ // dyn is not a keyword in all situations (a "weak" keyword).
1545
+ type A0 = dyn;
1546
+ // ^^^ -storage.type.trait
1547
+ type A1 = dyn:: dyn;
1548
+ // ^^^^^ meta.path -storage.type.trait
1549
+ // ^^^ -storage.type.trait
1550
+ type A2 = dyn<dyn, dyn>;
1551
+ // ^^^ meta.generic -storage.type.trait
1552
+ // ^^^ meta.generic -storage.type.trait
1553
+ // ^^^ meta.generic -storage.type.trait
1554
+ // This is incorrect. `identifier` should not match on the keyword `as`.
1555
+ // However, avoiding keywords is a little complicated and slow.
1556
+ type A3 = dyn<<dyn as dyn>:: dyn>;
1557
+ // ^^^ meta.generic -storage.type.trait
1558
+ // ^^^ meta.generic storage.type.trait
1559
+ // ^^^ meta.generic -storage.type.trait
1560
+ // ^^^ meta.generic -storage.type.trait
0 commit comments