mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Silence noncopyable typaram warnings
This commit is contained in:
parent
f7396fabb2
commit
fca9e9fa00
5 changed files with 12 additions and 0 deletions
|
@ -13,6 +13,7 @@ use util::color::{Color, rgb};
|
||||||
use util::color::css_colors::{white, black};
|
use util::color::css_colors::{white, black};
|
||||||
use layout::context::LayoutContext;
|
use layout::context::LayoutContext;
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
type SpecifiedStyle = {mut background_color : CSSValue<CSSBackgroundColor>,
|
type SpecifiedStyle = {mut background_color : CSSValue<CSSBackgroundColor>,
|
||||||
mut background_image : CSSValue<CSSBackgroundImage>,
|
mut background_image : CSSValue<CSSBackgroundImage>,
|
||||||
mut display_type : CSSValue<CSSDisplay>,
|
mut display_type : CSSValue<CSSDisplay>,
|
||||||
|
@ -72,6 +73,7 @@ impl NodeKind : DefaultStyleMethods {
|
||||||
* style is computed so that it can be used to short-circuit selector matching to avoid computing
|
* style is computed so that it can be used to short-circuit selector matching to avoid computing
|
||||||
* style for children of display:none objects.
|
* style for children of display:none objects.
|
||||||
*/
|
*/
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
fn empty_style_for_node_kind(kind: &NodeKind) -> SpecifiedStyle {
|
fn empty_style_for_node_kind(kind: &NodeKind) -> SpecifiedStyle {
|
||||||
let display_type = kind.default_display_type();
|
let display_type = kind.default_display_type();
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ pub fn init(compartment: &bare_compartment) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
||||||
-> JSBool unsafe {
|
-> JSBool unsafe {
|
||||||
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
||||||
|
@ -97,6 +98,7 @@ extern fn HTMLImageElement_getWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsva
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
||||||
-> JSBool unsafe {
|
-> JSBool unsafe {
|
||||||
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
||||||
|
@ -122,6 +124,7 @@ extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsva
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
||||||
-> JSBool {
|
-> JSBool {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -147,6 +150,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
pub fn create(cx: *JSContext, node: Node, scope: NodeScope) -> jsobj unsafe {
|
pub fn create(cx: *JSContext, node: Node, scope: NodeScope) -> jsobj unsafe {
|
||||||
let proto = scope.write(&node, |nd| {
|
let proto = scope.write(&node, |nd| {
|
||||||
match nd.kind {
|
match nd.kind {
|
||||||
|
|
|
@ -41,6 +41,7 @@ pub fn init(compartment: &bare_compartment) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
pub fn create(cx: *JSContext, node: Node, scope: NodeScope) -> jsobj unsafe {
|
pub fn create(cx: *JSContext, node: Node, scope: NodeScope) -> jsobj unsafe {
|
||||||
do scope.write(&node) |nd| {
|
do scope.write(&node) |nd| {
|
||||||
match nd.kind {
|
match nd.kind {
|
||||||
|
@ -77,6 +78,7 @@ unsafe fn unwrap(obj: *JSObject) -> *rust_box<NodeBundle> {
|
||||||
cast::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val))
|
cast::reinterpret_cast(&RUST_JSVAL_TO_PRIVATE(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
extern fn getFirstChild(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
|
extern fn getFirstChild(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
|
||||||
unsafe {
|
unsafe {
|
||||||
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
||||||
|
@ -100,6 +102,7 @@ extern fn getFirstChild(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
extern fn getNextSibling(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
|
extern fn getNextSibling(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
|
||||||
unsafe {
|
unsafe {
|
||||||
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));
|
||||||
|
|
|
@ -10,6 +10,7 @@ struct ElementData {
|
||||||
attrs: DVec<~Attr>,
|
attrs: DVec<~Attr>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
impl ElementData {
|
impl ElementData {
|
||||||
fn get_attr(name: &str) -> Option<~str> {
|
fn get_attr(name: &str) -> Option<~str> {
|
||||||
let found = do self.attrs.find |attr| { name == attr.name };
|
let found = do self.attrs.find |attr| { name == attr.name };
|
||||||
|
|
|
@ -40,6 +40,8 @@ pub fn TimerData(argc: libc::c_uint, argv: *jsval) -> TimerData unsafe {
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: delayed_send shouldn't require Copy
|
||||||
|
#[allow(non_implicitly_copyable_typarams)]
|
||||||
impl Window {
|
impl Window {
|
||||||
fn alert(s: &str) {
|
fn alert(s: &str) {
|
||||||
// Right now, just print to the console
|
// Right now, just print to the console
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue