summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-12-04 14:19:06 +0100
committerGitHub <noreply@github.com>2021-12-04 14:19:06 +0100
commitc59f90d01f06f995e335c6de76aab0b9ba2c98e5 (patch)
tree760bc0534fca502175749d9a7b719c0666f90543 /core
parent72e9720e91630bdf28b1660c20c67baa39bdb586 (diff)
chore: upgrade to Rust 1.57.0 (#12968)
Diffstat (limited to 'core')
-rw-r--r--core/async_cancel.rs6
-rw-r--r--core/modules.rs10
-rw-r--r--core/runtime.rs16
3 files changed, 16 insertions, 16 deletions
diff --git a/core/async_cancel.rs b/core/async_cancel.rs
index ab7ec2248..1cdddcdb5 100644
--- a/core/async_cancel.rs
+++ b/core/async_cancel.rs
@@ -511,7 +511,7 @@ mod internal {
/// the heap allocation that contains the `CancelHandle`. Without this
/// extra weak reference, `Rc::get_mut()` might succeed and allow the
/// `CancelHandle` to be moved when it isn't safe to do so.
- weak_pin: Weak<dyn Any>,
+ _weak_pin: Weak<dyn Any>,
},
/// All item nodes in a chain are associated with a `Cancelable` head node.
Item {
@@ -523,8 +523,8 @@ mod internal {
impl NodeKind {
fn head(rc_pin: &Rc<dyn Any>) -> Self {
- let weak_pin = Rc::downgrade(rc_pin);
- Self::Head { weak_pin }
+ let _weak_pin = Rc::downgrade(rc_pin);
+ Self::Head { _weak_pin }
}
fn item(waker: &Waker) -> Self {
diff --git a/core/modules.rs b/core/modules.rs
index bc3885a7b..067ee48e3 100644
--- a/core/modules.rs
+++ b/core/modules.rs
@@ -1487,7 +1487,7 @@ mod tests {
#[test]
fn slow_never_ready_modules() {
- run_in_task(|mut cx| {
+ run_in_task(|cx| {
let loader = MockLoader::new();
let loads = loader.loads.clone();
let mut runtime = JsRuntime::new(RuntimeOptions {
@@ -1498,7 +1498,7 @@ mod tests {
let mut recursive_load =
runtime.load_main_module(&spec, None).boxed_local();
- let result = recursive_load.poll_unpin(&mut cx);
+ let result = recursive_load.poll_unpin(cx);
assert!(result.is_pending());
// TODO(ry) Arguably the first time we poll only the following modules
@@ -1511,7 +1511,7 @@ mod tests {
// run_in_task.
for _ in 0..10 {
- let result = recursive_load.poll_unpin(&mut cx);
+ let result = recursive_load.poll_unpin(cx);
assert!(result.is_pending());
let l = loads.lock();
assert_eq!(
@@ -1537,7 +1537,7 @@ mod tests {
#[test]
fn loader_disappears_after_error() {
- run_in_task(|mut cx| {
+ run_in_task(|cx| {
let loader = MockLoader::new();
let mut runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(loader),
@@ -1545,7 +1545,7 @@ mod tests {
});
let spec = crate::resolve_url("file:///bad_import.js").unwrap();
let mut load_fut = runtime.load_main_module(&spec, None).boxed_local();
- let result = load_fut.poll_unpin(&mut cx);
+ let result = load_fut.poll_unpin(cx);
if let Poll::Ready(Err(err)) = result {
assert_eq!(
err.downcast_ref::<MockError>().unwrap(),
diff --git a/core/runtime.rs b/core/runtime.rs
index 5db11d9c5..15bb103ba 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -1950,7 +1950,7 @@ pub mod tests {
#[test]
fn test_pre_dispatch() {
- run_in_task(|mut cx| {
+ run_in_task(|cx| {
let (mut runtime, _dispatch_count) = setup(Mode::Async);
runtime
.execute_script(
@@ -1966,7 +1966,7 @@ pub mod tests {
"#,
)
.unwrap();
- if let Poll::Ready(Err(_)) = runtime.poll_event_loop(&mut cx, false) {
+ if let Poll::Ready(Err(_)) = runtime.poll_event_loop(cx, false) {
unreachable!();
}
});
@@ -1984,7 +1984,7 @@ pub mod tests {
#[test]
fn test_encode_decode() {
- run_in_task(|mut cx| {
+ run_in_task(|cx| {
let (mut runtime, _dispatch_count) = setup(Mode::Async);
runtime
.execute_script(
@@ -1992,7 +1992,7 @@ pub mod tests {
include_str!("encode_decode_test.js"),
)
.unwrap();
- if let Poll::Ready(Err(_)) = runtime.poll_event_loop(&mut cx, false) {
+ if let Poll::Ready(Err(_)) = runtime.poll_event_loop(cx, false) {
unreachable!();
}
});
@@ -2000,7 +2000,7 @@ pub mod tests {
#[test]
fn test_serialize_deserialize() {
- run_in_task(|mut cx| {
+ run_in_task(|cx| {
let (mut runtime, _dispatch_count) = setup(Mode::Async);
runtime
.execute_script(
@@ -2008,7 +2008,7 @@ pub mod tests {
include_str!("serialize_deserialize_test.js"),
)
.unwrap();
- if let Poll::Ready(Err(_)) = runtime.poll_event_loop(&mut cx, false) {
+ if let Poll::Ready(Err(_)) = runtime.poll_event_loop(cx, false) {
unreachable!();
}
});
@@ -2024,7 +2024,7 @@ pub mod tests {
"DOMExceptionOperationError"
}
- run_in_task(|mut cx| {
+ run_in_task(|cx| {
let mut runtime = JsRuntime::new(RuntimeOptions {
get_error_class_fn: Some(&get_error_class_name),
..Default::default()
@@ -2037,7 +2037,7 @@ pub mod tests {
include_str!("error_builder_test.js"),
)
.unwrap();
- if let Poll::Ready(Err(_)) = runtime.poll_event_loop(&mut cx, false) {
+ if let Poll::Ready(Err(_)) = runtime.poll_event_loop(cx, false) {
unreachable!();
}
});