mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Add support for unsafe Rust-ABI functions to CGAbstractMethod.
This commit is contained in:
parent
1dcdc2859c
commit
e99054f731
1 changed files with 6 additions and 3 deletions
|
@ -2143,8 +2143,8 @@ class CGAbstractMethod(CGThing):
|
||||||
docs is None or documentation for the method in a string.
|
docs is None or documentation for the method in a string.
|
||||||
"""
|
"""
|
||||||
def __init__(self, descriptor, name, returnType, args, inline=False,
|
def __init__(self, descriptor, name, returnType, args, inline=False,
|
||||||
alwaysInline=False, extern=False, pub=False, templateArgs=None,
|
alwaysInline=False, extern=False, unsafe_fn=False, pub=False,
|
||||||
unsafe=False, docs=None, doesNotPanic=False):
|
templateArgs=None, unsafe=False, docs=None, doesNotPanic=False):
|
||||||
CGThing.__init__(self)
|
CGThing.__init__(self)
|
||||||
self.descriptor = descriptor
|
self.descriptor = descriptor
|
||||||
self.name = name
|
self.name = name
|
||||||
|
@ -2152,6 +2152,7 @@ class CGAbstractMethod(CGThing):
|
||||||
self.args = args
|
self.args = args
|
||||||
self.alwaysInline = alwaysInline
|
self.alwaysInline = alwaysInline
|
||||||
self.extern = extern
|
self.extern = extern
|
||||||
|
self.unsafe_fn = extern or unsafe_fn
|
||||||
self.templateArgs = templateArgs
|
self.templateArgs = templateArgs
|
||||||
self.pub = pub
|
self.pub = pub
|
||||||
self.unsafe = unsafe
|
self.unsafe = unsafe
|
||||||
|
@ -2181,8 +2182,10 @@ class CGAbstractMethod(CGThing):
|
||||||
if self.pub:
|
if self.pub:
|
||||||
decorators.append('pub')
|
decorators.append('pub')
|
||||||
|
|
||||||
if self.extern:
|
if self.unsafe_fn:
|
||||||
decorators.append('unsafe')
|
decorators.append('unsafe')
|
||||||
|
|
||||||
|
if self.extern:
|
||||||
decorators.append('extern')
|
decorators.append('extern')
|
||||||
|
|
||||||
if not decorators:
|
if not decorators:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue