Switch most crates to the 2018 edition

This commit is contained in:
Simon Sapin 2018-11-01 19:15:13 +01:00
parent 76e59a46d3
commit 9f9bf8f6bc
57 changed files with 82 additions and 28 deletions

View file

@ -3,6 +3,7 @@ name = "servo_allocator"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "servo_atoms"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
build = "build.rs"

View file

@ -3,6 +3,7 @@ name = "bluetooth"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "bluetooth_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "canvas"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "canvas_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "servo_channel"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "compositing"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
build = "build.rs"

View file

@ -20,7 +20,7 @@ use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
use net_traits::image::base::Image;
#[cfg(feature = "gleam")]
use net_traits::image::base::PixelFormat;
use profile_traits::time::{self, ProfilerCategory, profile};
use profile_traits::time::{self as profile_time, ProfilerCategory, profile};
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
use script_traits::{MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId};
use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType};
@ -150,7 +150,7 @@ pub struct IOCompositor<Window: WindowMethods> {
constellation_chan: Sender<ConstellationMsg>,
/// The channel on which messages can be sent to the time profiler.
time_profiler_chan: time::ProfilerChan,
time_profiler_chan: profile_time::ProfilerChan,
/// Touch input state machine
touch_handler: TouchHandler,
@ -366,7 +366,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
// Tell the profiler, memory profiler, and scrolling timer to shut down.
if let Ok((sender, receiver)) = ipc::channel() {
self.time_profiler_chan
.send(time::ProfilerMsg::Exit(sender));
.send(profile_time::ProfilerMsg::Exit(sender));
let _ = receiver.recv();
}

View file

@ -3,6 +3,7 @@ name = "servo_config"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "constellation"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "debugger"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "deny_public_fields"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "devtools"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "devtools_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "domobject_derive"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "embedder_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "servo_geometry"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -4,6 +4,7 @@ name = "gfx"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "gfx_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "jstraceable_derive"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "layout"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "layout_thread"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "layout_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "metrics"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "msg"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "net"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
autotests = false # Inhibit lookup for tests/*.rs without [[test]] sections

View file

@ -544,7 +544,7 @@ fn scheme_fetch(
*done_chan = Some((done_sender.clone(), done_receiver));
*response.body.lock().unwrap() = ResponseBody::Receiving(vec![]);
let mut res_body = response.body.clone();
let res_body = response.body.clone();
let cancellation_listener = context.cancellation_listener.clone();
@ -589,7 +589,7 @@ fn scheme_fetch(
return;
}
let length = {
let mut buffer = reader.fill_buf().unwrap().to_vec();
let buffer = reader.fill_buf().unwrap().to_vec();
let mut buffer_len = buffer.len();
if let ResponseBody::Receiving(ref mut body) =
*res_body.lock().unwrap()

View file

@ -3,6 +3,7 @@ name = "net_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "pixels"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "profile"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "profile_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "servo_rand"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -4,6 +4,7 @@ name = "range"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "servo_remutex"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -5,6 +5,7 @@ name = "script"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
build = "build.rs"

View file

@ -321,9 +321,8 @@ impl AudioBufferMethods for AudioBuffer {
typedarray!(in(cx) let js_channel: Float32Array = js_channel);
if let Ok(mut js_channel) = js_channel {
let bytes_to_copy = min(self.length - start_in_channel, source.len() as u32) as usize;
let mut js_channel_data = unsafe { js_channel.as_mut_slice() };
let (_, mut js_channel_data) =
js_channel_data.split_at_mut(start_in_channel as usize);
let js_channel_data = unsafe { js_channel.as_mut_slice() };
let (_, js_channel_data) = js_channel_data.split_at_mut(start_in_channel as usize);
unsafe {
js_channel_data[0..bytes_to_copy].copy_from_slice(&source.as_slice()[0..bytes_to_copy])
};

View file

@ -5686,7 +5686,11 @@ class CGInterfaceTrait(CGThing):
yield name, arguments, rettype
def fmt(arguments):
return "".join(", %s: %s" % argument for argument in arguments)
keywords = {"async"}
return "".join(
", %s: %s" % (name if name not in keywords else "r#" + name, type_)
for name, type_ in arguments
)
def contains_unsafe_arg(arguments):
if not arguments or len(arguments) == 0:
@ -6250,7 +6254,7 @@ class CGDictionary(CGThing):
d = self.dictionary
if d.parent:
initParent = ("{\n"
" match try!(%s::%s::new(cx, val)) {\n"
" match r#try!(%s::%s::new(cx, val)) {\n"
" ConversionResult::Success(v) => v,\n"
" ConversionResult::Failure(error) => {\n"
" throw_type_error(cx, &error);\n"
@ -6396,7 +6400,7 @@ class CGDictionary(CGThing):
conversion = (
"{\n"
" rooted!(in(cx) let mut rval = UndefinedValue());\n"
" match try!(get_dictionary_property(cx, object.handle(), \"%s\", rval.handle_mut())) {\n"
" match r#try!(get_dictionary_property(cx, object.handle(), \"%s\", rval.handle_mut())) {\n"
" true => {\n"
"%s\n"
" },\n"
@ -7167,7 +7171,7 @@ class CallbackOperationBase(CallbackMethod):
"methodName": self.methodName
}
getCallableFromProp = string.Template(
'try!(self.parent.get_callable_property(cx, "${methodName}"))'
'r#try!(self.parent.get_callable_property(cx, "${methodName}"))'
).substitute(replacements)
if not self.singleOperation:
return 'rooted!(in(cx) let callable =\n' + getCallableFromProp + ');\n'

View file

@ -53,7 +53,7 @@ use js::rust::wrappers::Evaluate2;
use libc;
use msg::constellation_msg::PipelineId;
use net_traits::{CoreResourceThread, ResourceThreads, IpcSend};
use profile_traits::{mem, time};
use profile_traits::{mem as profile_mem, time as profile_time};
use script_traits::{MsDuration, ScriptToConstellationChan, TimerEvent};
use script_traits::{TimerEventId, TimerSchedulerMsg, TimerSource};
use servo_url::{MutableOrigin, ServoUrl};
@ -97,11 +97,11 @@ pub struct GlobalScope {
/// For sending messages to the memory profiler.
#[ignore_malloc_size_of = "channels are hard"]
mem_profiler_chan: mem::ProfilerChan,
mem_profiler_chan: profile_mem::ProfilerChan,
/// For sending messages to the time profiler.
#[ignore_malloc_size_of = "channels are hard"]
time_profiler_chan: time::ProfilerChan,
time_profiler_chan: profile_time::ProfilerChan,
/// A handle for communicating messages to the constellation thread.
#[ignore_malloc_size_of = "channels are hard"]
@ -160,8 +160,8 @@ impl GlobalScope {
pub fn new_inherited(
pipeline_id: PipelineId,
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,
mem_profiler_chan: mem::ProfilerChan,
time_profiler_chan: time::ProfilerChan,
mem_profiler_chan: profile_mem::ProfilerChan,
time_profiler_chan: profile_time::ProfilerChan,
script_to_constellation_chan: ScriptToConstellationChan,
scheduler_chan: IpcSender<TimerSchedulerMsg>,
resource_threads: ResourceThreads,
@ -337,12 +337,12 @@ impl GlobalScope {
}
/// Get a sender to the memory profiler thread.
pub fn mem_profiler_chan(&self) -> &mem::ProfilerChan {
pub fn mem_profiler_chan(&self) -> &profile_mem::ProfilerChan {
&self.mem_profiler_chan
}
/// Get a sender to the time profiler thread.
pub fn time_profiler_chan(&self) -> &time::ProfilerChan {
pub fn time_profiler_chan(&self) -> &profile_time::ProfilerChan {
&self.time_profiler_chan
}
@ -513,17 +513,17 @@ impl GlobalScope {
rval: MutableHandleValue,
line_number: u32,
) -> bool {
let metadata = time::TimerMetadata {
let metadata = profile_time::TimerMetadata {
url: if filename.is_empty() {
self.get_url().as_str().into()
} else {
filename.into()
},
iframe: time::TimerMetadataFrameType::RootWindow,
incremental: time::TimerMetadataReflowType::FirstReflow,
iframe: profile_time::TimerMetadataFrameType::RootWindow,
incremental: profile_time::TimerMetadataReflowType::FirstReflow,
};
time::profile(
time::ProfilerCategory::ScriptEvaluate,
profile_time::profile(
profile_time::ProfilerCategory::ScriptEvaluate,
Some(metadata),
self.time_profiler_chan().clone(),
|| {

View file

@ -99,8 +99,8 @@ use net_traits::{Metadata, NetworkError, ReferrerPolicy, ResourceThreads};
use net_traits::image_cache::{ImageCache, PendingImageResponse};
use net_traits::request::{CredentialsMode, Destination, RedirectMode, RequestInit};
use net_traits::storage_thread::StorageType;
use profile_traits::mem::{self, OpaqueSender, ReportsChan};
use profile_traits::time::{self, ProfilerCategory, profile};
use profile_traits::mem::{self as profile_mem, OpaqueSender, ReportsChan};
use profile_traits::time::{self as profile_time, ProfilerCategory, profile};
use script_layout_interface::message::{self, Msg, NewLayoutThreadInfo, ReflowGoal};
use script_traits::{CompositorEvent, ConstellationControlMsg};
use script_traits::{DiscardBrowsingContext, DocumentActivity, EventResult};
@ -538,10 +538,10 @@ pub struct ScriptThread {
/// The channel on which the image cache can send messages to ourself.
image_cache_channel: Sender<ImageCacheMsg>,
/// For providing contact with the time profiler.
time_profiler_chan: time::ProfilerChan,
time_profiler_chan: profile_time::ProfilerChan,
/// For providing contact with the memory profiler.
mem_profiler_chan: mem::ProfilerChan,
mem_profiler_chan: profile_mem::ProfilerChan,
/// For providing instructions to an optional devtools server.
devtools_chan: Option<IpcSender<ScriptToDevtoolsControlMsg>>,

View file

@ -3,6 +3,7 @@ name = "script_layout_interface"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "script_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -4,6 +4,7 @@ name = "libservo"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "servo_url"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "webdriver_server"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "webvr"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "webvr_traits"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -3,6 +3,7 @@ name = "libmlservo"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -4,6 +4,7 @@ version = "0.0.1"
build = "build.rs"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
[lib]

View file

@ -4,6 +4,7 @@ name = "servo"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
build = "build.rs"
publish = false

View file

@ -4,6 +4,7 @@ name = "task_info"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
build = "build.rs"

View file

@ -3,6 +3,7 @@ name = "deny_public_fields_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
[lib]
path = "lib.rs"

View file

@ -3,6 +3,7 @@ name = "malloc_size_of_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
[lib]
path = "lib.rs"

View file

@ -3,6 +3,7 @@ name = "metrics_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
[lib]
name = "metrics_tests"

View file

@ -3,6 +3,7 @@ name = "profile_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
[lib]
name = "profile_tests"

View file

@ -3,6 +3,7 @@ name = "script_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
[lib]
name = "script_tests"

View file

@ -3,6 +3,7 @@ name = "script_plugins_tests"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
[lib]
path = "lib.rs"