Silence noncopyable typaram warnings

This commit is contained in:
Brian Anderson 2012-10-10 14:13:40 -07:00
parent f7396fabb2
commit fca9e9fa00
5 changed files with 12 additions and 0 deletions

View file

@ -13,6 +13,7 @@ use util::color::{Color, rgb};
use util::color::css_colors::{white, black};
use layout::context::LayoutContext;
#[allow(non_implicitly_copyable_typarams)]
type SpecifiedStyle = {mut background_color : CSSValue<CSSBackgroundColor>,
mut background_image : CSSValue<CSSBackgroundImage>,
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 for children of display:none objects.
*/
#[allow(non_implicitly_copyable_typarams)]
fn empty_style_for_node_kind(kind: &NodeKind) -> SpecifiedStyle {
let display_type = kind.default_display_type();

View file

@ -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)
-> JSBool unsafe {
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;
}
#[allow(non_implicitly_copyable_typarams)]
extern fn HTMLImageElement_setWidth(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
-> JSBool unsafe {
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;
}
#[allow(non_implicitly_copyable_typarams)]
extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
-> JSBool {
unsafe {
@ -147,6 +150,7 @@ extern fn getTagName(cx: *JSContext, _argc: c_uint, vp: *mut jsval)
return 1;
}
#[allow(non_implicitly_copyable_typarams)]
pub fn create(cx: *JSContext, node: Node, scope: NodeScope) -> jsobj unsafe {
let proto = scope.write(&node, |nd| {
match nd.kind {

View file

@ -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 {
do scope.write(&node) |nd| {
match nd.kind {
@ -77,6 +78,7 @@ unsafe fn unwrap(obj: *JSObject) -> *rust_box<NodeBundle> {
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 {
unsafe {
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;
}
#[allow(non_implicitly_copyable_typarams)]
extern fn getNextSibling(cx: *JSContext, _argc: c_uint, vp: *mut jsval) -> JSBool {
unsafe {
let obj = JS_THIS_OBJECT(cx, cast::reinterpret_cast(&vp));

View file

@ -10,6 +10,7 @@ struct ElementData {
attrs: DVec<~Attr>,
}
#[allow(non_implicitly_copyable_typarams)]
impl ElementData {
fn get_attr(name: &str) -> Option<~str> {
let found = do self.attrs.find |attr| { name == attr.name };

View file

@ -40,6 +40,8 @@ pub fn TimerData(argc: libc::c_uint, argv: *jsval) -> TimerData unsafe {
data
}
// FIXME: delayed_send shouldn't require Copy
#[allow(non_implicitly_copyable_typarams)]
impl Window {
fn alert(s: &str) {
// Right now, just print to the console