mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +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."]
|
#[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>) {
|
fn join_layout(scope: NodeScope, to_layout: chan<layout_task::Msg>) {
|
||||||
|
|
||||||
if scope.is_reader_forked() {
|
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> {
|
fn content(to_layout: chan<layout_task::Msg>) -> chan<ControlMsg> {
|
||||||
task::spawn_listener::<ControlMsg> {
|
task::spawn_listener::<ControlMsg> {
|
||||||
|from_master|
|
|from_master|
|
||||||
|
|
|
@ -72,12 +72,14 @@ fn NodeScope() -> NodeScope {
|
||||||
rcu::Scope()
|
rcu::Scope()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
impl NodeScope for NodeScope {
|
impl NodeScope for NodeScope {
|
||||||
fn new_node(-k: NodeKind) -> Node {
|
fn new_node(-k: NodeKind) -> Node {
|
||||||
self.handle(NodeData({tree: tree::empty(), kind: ~k}))
|
self.handle(NodeData({tree: tree::empty(), kind: ~k}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
impl TreeReadMethods of tree::ReadMethods<Node> for NodeScope {
|
impl TreeReadMethods of tree::ReadMethods<Node> for NodeScope {
|
||||||
fn each_child(node: Node, f: fn(Node) -> bool) {
|
fn each_child(node: Node, f: fn(Node) -> bool) {
|
||||||
tree::each_child(self, node, f)
|
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 {
|
impl TreeWriteMethods of tree::WriteMethods<Node> for NodeScope {
|
||||||
fn add_child(node: Node, child: Node) {
|
fn add_child(node: Node, child: Node) {
|
||||||
tree::add_child(self, node, child)
|
tree::add_child(self, node, child)
|
||||||
|
|
|
@ -205,6 +205,7 @@ impl WriterMethods<T:copy send,A> for Scope<T,A> {
|
||||||
f(*h.write_ptr())
|
f(*h.write_ptr())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
fn handle(v: T) -> Handle<T,A> unsafe {
|
fn handle(v: T) -> Handle<T,A> unsafe {
|
||||||
let d: *HandleData<T,A> =
|
let d: *HandleData<T,A> =
|
||||||
unsafe::reinterpret_cast(
|
unsafe::reinterpret_cast(
|
||||||
|
@ -220,6 +221,7 @@ impl WriterMethods<T:copy send,A> for Scope<T,A> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
mod test {
|
mod test {
|
||||||
|
|
||||||
type animal = {name: str, species: species};
|
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.
|
* `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] {
|
fn box_to_display_items(box: @Box, origin: Point2D<au>) -> [dl::display_item] {
|
||||||
let mut items = [];
|
let mut items = [];
|
||||||
|
|
||||||
|
|
|
@ -205,6 +205,7 @@ mod test {
|
||||||
import dvec::{dvec, extensions};
|
import dvec::{dvec, extensions};
|
||||||
import io::println;
|
import io::println;
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
fn new_node_from_attr(scope: NodeScope, -name: str, -val: str) -> Node {
|
fn new_node_from_attr(scope: NodeScope, -name: str, -val: str) -> Node {
|
||||||
let elmt = ElementData("div", ~HTMLDivElement);
|
let elmt = ElementData("div", ~HTMLDivElement);
|
||||||
let attr = ~Attr(name, val);
|
let attr = ~Attr(name, val);
|
||||||
|
|
|
@ -26,8 +26,8 @@ impl text_layout_methods for @Box {
|
||||||
|
|
||||||
let font = create_test_font();
|
let font = create_test_font();
|
||||||
let run = text_run(&font, subbox.text);
|
let run = text_run(&font, subbox.text);
|
||||||
subbox.run = some(run);
|
|
||||||
self.bounds.size = run.size();
|
self.bounds.size = run.size();
|
||||||
|
subbox.run = some(run);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ enum render_mode {
|
||||||
png(str)
|
png(str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
fn from_cmdline_args(args: [str]) -> opts {
|
fn from_cmdline_args(args: [str]) -> opts {
|
||||||
import std::getopts;
|
import std::getopts;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import parser::token;
|
||||||
|
|
||||||
import dvec::extensions;
|
import dvec::extensions;
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
fn link_up_attribute(scope: NodeScope, node: Node, -key: str, -value: str) {
|
fn link_up_attribute(scope: NodeScope, node: Node, -key: str, -value: str) {
|
||||||
// TODO: Implement atoms so that we don't always perform string comparisons.
|
// TODO: Implement atoms so that we don't always perform string comparisons.
|
||||||
scope.read(node) {
|
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 };
|
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> {
|
fn spawn_html_parser_task(-filename: ~str) -> port<html::token> {
|
||||||
let result_port = port();
|
let result_port = port();
|
||||||
let result_chan = chan(result_port);
|
let result_chan = chan(result_port);
|
||||||
|
@ -496,6 +497,7 @@ fn spawn_html_parser_task(-filename: ~str) -> port<html::token> {
|
||||||
ret result_port;
|
ret result_port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
fn spawn_css_lexer_task(-filename: ~str) -> port<css::token> {
|
fn spawn_css_lexer_task(-filename: ~str) -> port<css::token> {
|
||||||
let result_port = port();
|
let result_port = port();
|
||||||
let result_chan = chan(result_port);
|
let result_chan = chan(result_port);
|
||||||
|
|
|
@ -8,8 +8,8 @@ fn main(args: [str]) {
|
||||||
run(opts::from_cmdline_args(args))
|
run(opts::from_cmdline_args(args))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
fn run(opts: opts::opts) {
|
fn run(opts: opts::opts) {
|
||||||
|
|
||||||
alt opts.render_mode {
|
alt opts.render_mode {
|
||||||
opts::screen {
|
opts::screen {
|
||||||
run_pipeline_screen(opts.urls)
|
run_pipeline_screen(opts.urls)
|
||||||
|
|
|
@ -24,17 +24,18 @@ import azure::cairo::bindgen::{
|
||||||
A font handle. Layout can use this to calculate glyph metrics
|
A font handle. Layout can use this to calculate glyph metrics
|
||||||
and the renderer can use it to render text.
|
and the renderer can use it to render text.
|
||||||
"]
|
"]
|
||||||
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
class font/& {
|
class font/& {
|
||||||
let fontbuf: [u8];
|
let fontbuf: [u8];
|
||||||
let cairo_font: *cairo_scaled_font_t;
|
let cairo_font: *cairo_scaled_font_t;
|
||||||
let font_dtor: fn@();
|
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();
|
assert cairo_font.is_not_null();
|
||||||
|
|
||||||
self.fontbuf = fontbuf;
|
self.fontbuf <- fontbuf;
|
||||||
self.cairo_font = cairo_font;
|
self.cairo_font = cairo_font;
|
||||||
self.font_dtor = font_dtor;
|
self.font_dtor = font_dtor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue