summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-01-02 13:52:42 +0100
committerGitHub <noreply@github.com>2021-01-02 13:52:42 +0100
commit41a4a34aee57a4690e5c1b9ba54b27a7035bac37 (patch)
tree11d9ec87232947515e8c68488119dc1670833e68
parent88855b5d95be04747ec0ff67d8b33dfde3189641 (diff)
upgrade: Rust 1.49.0 (#8955)
-rw-r--r--.github/workflows/ci.yml2
-rw-r--r--cli/module_graph.rs9
-rw-r--r--cli/standalone.rs10
-rw-r--r--core/async_cancel.rs2
-rw-r--r--runtime/ops/fs.rs5
5 files changed, 15 insertions, 13 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 662808af9..f57513d3e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -66,7 +66,7 @@ jobs:
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
- rust-version: 1.48.0
+ rust-version: 1.49.0
- name: Install clippy and rustfmt
if: matrix.kind == 'lint'
diff --git a/cli/module_graph.rs b/cli/module_graph.rs
index d1e51bd4c..e86732b24 100644
--- a/cli/module_graph.rs
+++ b/cli/module_graph.rs
@@ -2300,10 +2300,11 @@ pub mod tests {
.expect("should have checked");
assert!(result_info.maybe_ignored_options.is_none());
assert!(result_info.diagnostics.is_empty());
- let h = handler.lock().unwrap();
- assert_eq!(h.version_calls.len(), 2);
- let ver0 = h.version_calls[0].1.clone();
- let ver1 = h.version_calls[1].1.clone();
+ let (ver0, ver1) = {
+ let h = handler.lock().unwrap();
+ assert_eq!(h.version_calls.len(), 2);
+ (h.version_calls[0].1.clone(), h.version_calls[1].1.clone())
+ };
// let's do it all over again to ensure that the versions are determinstic
let (graph, handler) = setup(specifier).await;
diff --git a/cli/standalone.rs b/cli/standalone.rs
index fea42fc96..af38fd4eb 100644
--- a/cli/standalone.rs
+++ b/cli/standalone.rs
@@ -107,10 +107,12 @@ impl ModuleLoader for EmbeddedModuleLoader {
}
async fn run(source_code: String, args: Vec<String>) -> Result<(), AnyError> {
- let mut flags = Flags::default();
- flags.argv = args[1..].to_vec();
- // TODO(lucacasonato): remove once you can specify this correctly through embedded metadata
- flags.unstable = true;
+ let flags = Flags {
+ argv: args[1..].to_vec(),
+ // TODO(lucacasonato): remove once you can specify this correctly through embedded metadata
+ unstable: true,
+ ..Default::default()
+ };
let main_module = ModuleSpecifier::resolve_url(SPECIFIER)?;
let permissions = Permissions::allow_all();
let module_loader = Rc::new(EmbeddedModuleLoader(source_code));
diff --git a/core/async_cancel.rs b/core/async_cancel.rs
index 90cb0c41f..51ed4c647 100644
--- a/core/async_cancel.rs
+++ b/core/async_cancel.rs
@@ -334,7 +334,7 @@ mod internal {
impl PartialEq for Node {
fn eq(&self, other: &Self) -> bool {
- self as *const _ == other as *const _
+ std::ptr::eq(self, other)
}
}
diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs
index d6d7d7e78..d088880f7 100644
--- a/runtime/ops/fs.rs
+++ b/runtime/ops/fs.rs
@@ -1660,15 +1660,14 @@ async fn op_utime_async(
args: Value,
_zero_copy: BufVec,
) -> Result<Value, AnyError> {
- let state = state.borrow();
- super::check_unstable(&state, "Deno.utime");
+ super::check_unstable(&state.borrow(), "Deno.utime");
let args: UtimeArgs = serde_json::from_value(args)?;
let path = PathBuf::from(&args.path);
let atime = filetime::FileTime::from_unix_time(args.atime.0, args.atime.1);
let mtime = filetime::FileTime::from_unix_time(args.mtime.0, args.mtime.1);
- state.borrow::<Permissions>().check_write(&path)?;
+ state.borrow().borrow::<Permissions>().check_write(&path)?;
tokio::task::spawn_blocking(move || {
filetime::set_file_times(path, atime, mtime)?;