@@ -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' ;
@@ -1221,3 +1221,47 @@ pub union Foo<'a, Y: Baz>
1221
1221
// that we don't accidentally interpret it as a keyword.
1222
1222
fn union ( ) { }
1223
1223
// ^^^^^ meta.function entity.name.function
1224
+
1225
+ // dyn trait
1226
+ fn f( x: dyn T , y: Box <dyn T + ' static >, z: & dyn T ,
1227
+ // ^^^ meta.function.parameters storage.type.trait
1228
+ // ^^^ meta.function.parameters meta.generic storage.type.trait
1229
+ // ^^^ meta.function.parameters storage.type.trait
1230
+ f: & dyn Fn ( CrateNum ) -> bool ) -> dyn T {
1231
+ // ^^^ meta.function.parameters storage.type.trait
1232
+ // ^^^ meta.function.return-type storage.type.trait
1233
+ let x: & ( dyn ' static + Display ) = & BYTE ;
1234
+ // ^^^ meta.group storage.type.trait
1235
+ let y: Box <dyn Display + ' static > = Box :: new( BYTE ) ;
1236
+ // ^^^ meta.generic storage.type.trait
1237
+ let _: & dyn ( Display ) = & BYTE ;
1238
+ // ^^^ storage.type.trait
1239
+ let _: & dyn ( :: std:: fmt:: Display ) = & BYTE ;
1240
+ // ^^^ storage.type.trait
1241
+ const DT : & ' static dyn C = & V ;
1242
+ // ^^^ storage.type.trait
1243
+ struct S {
1244
+ f: dyn T
1245
+ // ^^^ meta.struct storage.type.trait
1246
+ }
1247
+ type D4 = dyn ( :: module:: Trait ) ;
1248
+ // ^^^ storage.type.trait
1249
+ }
1250
+
1251
+ // dyn is not a keyword in all situations (a "weak" keyword).
1252
+ type A0 = dyn;
1253
+ // ^^^ -storage.type.trait
1254
+ type A1 = dyn:: dyn;
1255
+ // ^^^^^ meta.path -storage.type.trait
1256
+ // ^^^ -storage.type.trait
1257
+ type A2 = dyn<dyn, dyn>;
1258
+ // ^^^ meta.generic -storage.type.trait
1259
+ // ^^^ meta.generic -storage.type.trait
1260
+ // ^^^ meta.generic -storage.type.trait
1261
+ // This is incorrect. `identifier` should not match on the keyword `as`.
1262
+ // However, avoiding keywords is a little complicated and slow.
1263
+ type A3 = dyn<<dyn as dyn>:: dyn>;
1264
+ // ^^^ meta.generic -storage.type.trait
1265
+ // ^^^ meta.generic storage.type.trait
1266
+ // ^^^ meta.generic -storage.type.trait
1267
+ // ^^^ meta.generic -storage.type.trait
0 commit comments