mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update script to work with lint changes
This commit is contained in:
parent
7022bedba3
commit
8819f0d8b8
6 changed files with 12 additions and 5 deletions
|
@ -210,6 +210,7 @@ impl GlobalRoot {
|
|||
|
||||
impl GlobalField {
|
||||
/// Create a new `GlobalField` from a rooted reference.
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn from_rooted(global: &GlobalRef) -> GlobalField {
|
||||
match *global {
|
||||
GlobalRef::Window(window) => GlobalField::Window(JS::from_ref(window)),
|
||||
|
|
|
@ -67,12 +67,14 @@ impl<T: Reflectable> JS<T> {
|
|||
}
|
||||
/// Create a JS<T> from a Root<T>
|
||||
/// XXX Not a great API. Should be a call on Root<T> instead
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn from_rooted(root: &Root<T>) -> JS<T> {
|
||||
JS {
|
||||
ptr: unsafe { NonZero::new(&**root) }
|
||||
}
|
||||
}
|
||||
/// Create a JS<T> from a &T
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn from_ref(obj: &T) -> JS<T> {
|
||||
JS {
|
||||
ptr: unsafe { NonZero::new(&*obj) }
|
||||
|
@ -125,6 +127,7 @@ impl<T> PartialEq for LayoutJS<T> {
|
|||
|
||||
impl <T> Clone for JS<T> {
|
||||
#[inline]
|
||||
#[allow(unrooted_must_root)]
|
||||
fn clone(&self) -> JS<T> {
|
||||
JS {
|
||||
ptr: self.ptr.clone()
|
||||
|
@ -288,6 +291,7 @@ impl<T: Reflectable> MutNullableHeap<JS<T>> {
|
|||
}
|
||||
|
||||
impl<T: HeapGCValue + Copy> Default for MutNullableHeap<T> {
|
||||
#[allow(unrooted_must_root)]
|
||||
fn default() -> MutNullableHeap<T> {
|
||||
MutNullableHeap {
|
||||
ptr: Cell::new(None)
|
||||
|
|
|
@ -1352,10 +1352,12 @@ impl Node {
|
|||
Node::new_(flags, Some(doc))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new_document_node() -> Node {
|
||||
Node::new_(NodeFlags::new() | IS_IN_DOC, None)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
fn new_(flags: NodeFlags, doc: Option<&Document>) -> Node {
|
||||
Node {
|
||||
eventtarget: EventTarget::new_inherited(),
|
||||
|
|
|
@ -43,6 +43,7 @@ pub struct Sink {
|
|||
}
|
||||
|
||||
impl Sink {
|
||||
#[allow(unrooted_must_root)] // method is only run at parse time
|
||||
pub fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Root<Node> {
|
||||
match child {
|
||||
NodeOrText::AppendNode(n) => n.root(),
|
||||
|
|
|
@ -147,10 +147,10 @@ impl WebGLRenderingContext {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn bound_texture_for(&self, target: u32) -> Option<JS<WebGLTexture>> {
|
||||
pub fn bound_texture_for(&self, target: u32) -> Option<Root<WebGLTexture>> {
|
||||
match target {
|
||||
constants::TEXTURE_2D => self.bound_texture_2d.get(),
|
||||
constants::TEXTURE_CUBE_MAP => self.bound_texture_cube_map.get(),
|
||||
constants::TEXTURE_2D => self.bound_texture_2d.get().map(|t| t.root()),
|
||||
constants::TEXTURE_CUBE_MAP => self.bound_texture_cube_map.get().map(|t| t.root()),
|
||||
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
@ -906,7 +906,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
constants::TEXTURE_2D |
|
||||
constants::TEXTURE_CUBE_MAP => {
|
||||
if let Some(texture) = self.bound_texture_for(target) {
|
||||
let texture = texture.root();
|
||||
let result = texture.r().tex_parameter(target, name, TexParameterValue::Float(value));
|
||||
handle_potential_webgl_error!(self, result);
|
||||
} else {
|
||||
|
@ -924,7 +923,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
constants::TEXTURE_2D |
|
||||
constants::TEXTURE_CUBE_MAP => {
|
||||
if let Some(texture) = self.bound_texture_for(target) {
|
||||
let texture = texture.root();
|
||||
let result = texture.r().tex_parameter(target, name, TexParameterValue::Int(value));
|
||||
handle_potential_webgl_error!(self, result);
|
||||
} else {
|
||||
|
|
|
@ -119,6 +119,7 @@ impl Page {
|
|||
old
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn set_frame(&self, frame: Option<Frame>) {
|
||||
*self.frame.borrow_mut() = frame;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue