зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #14686 - Improve dead_code handling a bit (from nox:dom); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: 2694463b08f8f37b8a5351fa3199b3283b90cb3d
This commit is contained in:
Родитель
50d34566d3
Коммит
864dd6aa8e
|
@ -5796,7 +5796,7 @@ class CGNonNamespacedEnum(CGThing):
|
||||||
entries = ["%s = %s" % (names[0], first)] + names[1:]
|
entries = ["%s = %s" % (names[0], first)] + names[1:]
|
||||||
|
|
||||||
# Append a Last.
|
# Append a Last.
|
||||||
entries.append('Last = ' + str(first + len(entries)))
|
entries.append('#[allow(dead_code)] Last = ' + str(first + len(entries)))
|
||||||
|
|
||||||
# Indent.
|
# Indent.
|
||||||
entries = [' ' + e for e in entries]
|
entries = [' ' + e for e in entries]
|
||||||
|
|
|
@ -399,6 +399,8 @@ class Descriptor(DescriptorProvider):
|
||||||
|
|
||||||
def shouldHaveGetConstructorObjectMethod(self):
|
def shouldHaveGetConstructorObjectMethod(self):
|
||||||
assert self.interface.hasInterfaceObject()
|
assert self.interface.hasInterfaceObject()
|
||||||
|
if self.interface.getExtendedAttribute("Inline"):
|
||||||
|
return False
|
||||||
return self.interface.isCallback() or self.interface.isNamespace() or self.hasDescendants()
|
return self.interface.isCallback() or self.interface.isNamespace() or self.hasDescendants()
|
||||||
|
|
||||||
def isExposedConditionally(self):
|
def isExposedConditionally(self):
|
||||||
|
|
|
@ -157,9 +157,9 @@ pub mod weakref;
|
||||||
pub mod xmlname;
|
pub mod xmlname;
|
||||||
|
|
||||||
/// Generated JS-Rust bindings.
|
/// Generated JS-Rust bindings.
|
||||||
#[allow(dead_code, missing_docs, non_snake_case)]
|
#[allow(missing_docs, non_snake_case)]
|
||||||
pub mod codegen {
|
pub mod codegen {
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(dead_code, unrooted_must_root)]
|
||||||
pub mod Bindings {
|
pub mod Bindings {
|
||||||
include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
|
include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ pub mod codegen {
|
||||||
pub mod InterfaceTypes {
|
pub mod InterfaceTypes {
|
||||||
include!(concat!(env!("OUT_DIR"), "/InterfaceTypes.rs"));
|
include!(concat!(env!("OUT_DIR"), "/InterfaceTypes.rs"));
|
||||||
}
|
}
|
||||||
#[allow(unused_imports)]
|
#[allow(dead_code, unused_imports)]
|
||||||
pub mod InheritTypes {
|
pub mod InheritTypes {
|
||||||
include!(concat!(env!("OUT_DIR"), "/InheritTypes.rs"));
|
include!(concat!(env!("OUT_DIR"), "/InheritTypes.rs"));
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче