Allow for regular non-arc borrowed types, use for StyleSet

This commit is contained in:
Manish Goregaokar 2016-08-23 19:18:00 +05:30
parent 9f6b772bbb
commit db7156526f
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98
5 changed files with 72 additions and 31 deletions

View file

@ -153,6 +153,12 @@ COMPILATION_TARGETS = {
"servo_arc_types": [
"ServoComputedValues", "RawServoStyleSheet",
"ServoDeclarationBlock"
],
"servo_borrowed_types": [
"RawServoStyleSet",
],
"servo_borrowed_mut_types": [
"RawServoStyleSet",
]
},
@ -325,6 +331,18 @@ def build(objdir, target_name, debug, debugger, kind_name=None,
flags.append("{}Borrowed".format(ty))
flags.append("--raw-line")
flags.append("pub type {0}Borrowed<'a> = ::sugar::refptr::Borrowed<'a, {0}>;".format(ty))
if "servo_borrowed_types" in current_target:
for ty in current_target["servo_borrowed_types"]:
flags.append("-blacklist-type")
flags.append("{}Borrowed".format(ty))
flags.append("-raw-line")
flags.append("pub type {0}Borrowed<'a> = &'a {0};".format(ty))
if "servo_borrowed_mut_types" in current_target:
for ty in current_target["servo_borrowed_mut_types"]:
flags.append("-blacklist-type")
flags.append("{}BorrowedMut".format(ty))
flags.append("-raw-line")
flags.append("pub type {0}BorrowedMut<'a> = &'a mut {0};".format(ty))
if "structs_types" in current_target:
for ty in current_target["structs_types"]:
ty_fragments = ty.split("::")