156
156
],
157
157
"servo_owned_types" : [
158
158
"RawServoStyleSet" ,
159
- "RawGeckoNode" ,
160
159
],
161
160
"servo_maybe_owned_types" : [
162
161
"ServoNodeData" ,
163
162
],
163
+ "servo_immutable_borrow_types" : [
164
+ "RawGeckoNode" ,
165
+ "RawGeckoElement" ,
166
+ "RawGeckoDocument" ,
167
+ ],
164
168
},
165
169
166
170
"atoms" : {
@@ -329,9 +333,19 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
329
333
flags .append ("--raw-line" )
330
334
flags .append ("pub type {0}Strong = ::sugar::ownership::Strong<{0}>;" .format (ty ))
331
335
flags .append ("--blacklist-type" )
336
+ flags .append ("{}MaybeBorrowed" .format (ty ))
337
+ flags .append ("-raw-line" )
338
+ flags .append ("pub type {0}MaybeBorrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;" .format (ty ))
339
+ if "servo_immutable_borrow_types" in current_target :
340
+ for ty in current_target ["servo_immutable_borrow_types" ]:
341
+ flags .append ("-blacklist-type" )
332
342
flags .append ("{}Borrowed" .format (ty ))
333
343
flags .append ("--raw-line" )
334
- flags .append ("pub type {0}Borrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;" .format (ty ))
344
+ flags .append ("pub type {0}Borrowed<'a> = &'a {0};" .format (ty ))
345
+ flags .append ("--blacklist-type" )
346
+ flags .append ("{}MaybeBorrowed" .format (ty ))
347
+ flags .append ("--raw-line" )
348
+ flags .append ("pub type {0}MaybeBorrowed<'a> = ::sugar::ownership::Borrowed<'a, {0}>;" .format (ty ))
335
349
if "servo_owned_types" in current_target :
336
350
for ty in current_target ["servo_owned_types" ]:
337
351
flags .append ("--blacklist-type" )
@@ -349,19 +363,19 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
349
363
if "servo_maybe_owned_types" in current_target :
350
364
for ty in current_target ["servo_maybe_owned_types" ]:
351
365
flags .append ("--blacklist-type" )
352
- flags .append ("{}Borrowed " .format (ty ))
366
+ flags .append ("{}MaybeBorrowed " .format (ty ))
353
367
flags .append ("--raw-line" )
354
- flags .append ("pub type {0}Borrowed <'a> = ::sugar::ownership::Borrowed<'a, {0}>;"
368
+ flags .append ("pub type {0}MaybeBorrowed <'a> = ::sugar::ownership::Borrowed<'a, {0}>;"
355
369
.format (ty ))
356
370
flags .append ("--blacklist-type" )
357
- flags .append ("{}BorrowedMut " .format (ty ))
371
+ flags .append ("{}MaybeBorrowedMut " .format (ty ))
358
372
flags .append ("--raw-line" )
359
- flags .append ("pub type {0}BorrowedMut <'a> = ::sugar::ownership::BorrowedMut<'a, {0}>;"
373
+ flags .append ("pub type {0}MaybeBorrowedMut <'a> = ::sugar::ownership::BorrowedMut<'a, {0}>;"
360
374
.format (ty ))
361
375
flags .append ("--blacklist-type" )
362
- flags .append ("{}Owned " .format (ty ))
376
+ flags .append ("{}MaybeOwned " .format (ty ))
363
377
flags .append ("--raw-line" )
364
- flags .append ("pub type {0}Owned = ::sugar::ownership::MaybeOwned<{0}>;" .format (ty ))
378
+ flags .append ("pub type {0}MaybeOwned = ::sugar::ownership::MaybeOwned<{0}>;" .format (ty ))
365
379
if "structs_types" in current_target :
366
380
for ty in current_target ["structs_types" ]:
367
381
ty_fragments = ty .split ("::" )
0 commit comments