mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Remove remaining implicit copy warnings
This commit is contained in:
parent
a322542825
commit
4ee7e57eea
11 changed files with 19 additions and 5 deletions
|
@ -29,6 +29,7 @@ enum PingMsg {
|
|||
}
|
||||
|
||||
#[doc="Sends a ping to layout and waits for the response."]
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn join_layout(scope: NodeScope, to_layout: chan<layout_task::Msg>) {
|
||||
|
||||
if scope.is_reader_forked() {
|
||||
|
@ -41,6 +42,7 @@ fn join_layout(scope: NodeScope, to_layout: chan<layout_task::Msg>) {
|
|||
}
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn content(to_layout: chan<layout_task::Msg>) -> chan<ControlMsg> {
|
||||
task::spawn_listener::<ControlMsg> {
|
||||
|from_master|
|
||||
|
|
|
@ -72,12 +72,14 @@ fn NodeScope() -> NodeScope {
|
|||
rcu::Scope()
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
impl NodeScope for NodeScope {
|
||||
fn new_node(-k: NodeKind) -> Node {
|
||||
self.handle(NodeData({tree: tree::empty(), kind: ~k}))
|
||||
}
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
impl TreeReadMethods of tree::ReadMethods<Node> for NodeScope {
|
||||
fn each_child(node: Node, f: fn(Node) -> bool) {
|
||||
tree::each_child(self, node, f)
|
||||
|
@ -92,6 +94,7 @@ impl TreeReadMethods of tree::ReadMethods<Node> for NodeScope {
|
|||
}
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
impl TreeWriteMethods of tree::WriteMethods<Node> for NodeScope {
|
||||
fn add_child(node: Node, child: Node) {
|
||||
tree::add_child(self, node, child)
|
||||
|
|
|
@ -205,6 +205,7 @@ impl WriterMethods<T:copy send,A> for Scope<T,A> {
|
|||
f(*h.write_ptr())
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn handle(v: T) -> Handle<T,A> unsafe {
|
||||
let d: *HandleData<T,A> =
|
||||
unsafe::reinterpret_cast(
|
||||
|
@ -220,6 +221,7 @@ impl WriterMethods<T:copy send,A> for Scope<T,A> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
mod test {
|
||||
|
||||
type animal = {name: str, species: species};
|
||||
|
|
|
@ -62,6 +62,7 @@ Creates a display list item for a single block.
|
|||
* `origin` - The coordinates of upper-left corner of the passed in box.
|
||||
|
||||
"]
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn box_to_display_items(box: @Box, origin: Point2D<au>) -> [dl::display_item] {
|
||||
let mut items = [];
|
||||
|
||||
|
|
|
@ -205,6 +205,7 @@ mod test {
|
|||
import dvec::{dvec, extensions};
|
||||
import io::println;
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn new_node_from_attr(scope: NodeScope, -name: str, -val: str) -> Node {
|
||||
let elmt = ElementData("div", ~HTMLDivElement);
|
||||
let attr = ~Attr(name, val);
|
||||
|
|
|
@ -26,8 +26,8 @@ impl text_layout_methods for @Box {
|
|||
|
||||
let font = create_test_font();
|
||||
let run = text_run(&font, subbox.text);
|
||||
subbox.run = some(run);
|
||||
self.bounds.size = run.size();
|
||||
subbox.run = some(run);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ enum render_mode {
|
|||
png(str)
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn from_cmdline_args(args: [str]) -> opts {
|
||||
import std::getopts;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import parser::token;
|
|||
|
||||
import dvec::extensions;
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn link_up_attribute(scope: NodeScope, node: Node, -key: str, -value: str) {
|
||||
// TODO: Implement atoms so that we don't always perform string comparisons.
|
||||
scope.read(node) {
|
||||
|
|
|
@ -475,6 +475,7 @@ fn parser(reader: io::reader, state : parse_state) -> parser {
|
|||
ret { mut lookahead: none, mut state: state, reader: reader };
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn spawn_html_parser_task(-filename: ~str) -> port<html::token> {
|
||||
let result_port = port();
|
||||
let result_chan = chan(result_port);
|
||||
|
@ -496,6 +497,7 @@ fn spawn_html_parser_task(-filename: ~str) -> port<html::token> {
|
|||
ret result_port;
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn spawn_css_lexer_task(-filename: ~str) -> port<css::token> {
|
||||
let result_port = port();
|
||||
let result_chan = chan(result_port);
|
||||
|
|
|
@ -8,8 +8,8 @@ fn main(args: [str]) {
|
|||
run(opts::from_cmdline_args(args))
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
fn run(opts: opts::opts) {
|
||||
|
||||
alt opts.render_mode {
|
||||
opts::screen {
|
||||
run_pipeline_screen(opts.urls)
|
||||
|
|
|
@ -24,17 +24,18 @@ import azure::cairo::bindgen::{
|
|||
A font handle. Layout can use this to calculate glyph metrics
|
||||
and the renderer can use it to render text.
|
||||
"]
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
class font/& {
|
||||
let fontbuf: [u8];
|
||||
let cairo_font: *cairo_scaled_font_t;
|
||||
let font_dtor: fn@();
|
||||
|
||||
new(+fontbuf: [u8]) {
|
||||
new(-fontbuf: [u8]) {
|
||||
|
||||
let (cairo_font, font_dtor) = get_cairo_font(&fontbuf);
|
||||
let (cairo_font, font_dtor) = get_cairo_font(© fontbuf);
|
||||
assert cairo_font.is_not_null();
|
||||
|
||||
self.fontbuf = fontbuf;
|
||||
self.fontbuf <- fontbuf;
|
||||
self.cairo_font = cairo_font;
|
||||
self.font_dtor = font_dtor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue