1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00

upgrade: Rust 1.49.0 (#8955)

This commit is contained in:
Bartek Iwańczuk 2021-01-02 13:52:42 +01:00 committed by GitHub
parent 88855b5d95
commit 41a4a34aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 13 deletions

View file

@ -66,7 +66,7 @@ jobs:
- name: Install rust - name: Install rust
uses: hecrj/setup-rust-action@v1 uses: hecrj/setup-rust-action@v1
with: with:
rust-version: 1.48.0 rust-version: 1.49.0
- name: Install clippy and rustfmt - name: Install clippy and rustfmt
if: matrix.kind == 'lint' if: matrix.kind == 'lint'

View file

@ -2300,10 +2300,11 @@ pub mod tests {
.expect("should have checked"); .expect("should have checked");
assert!(result_info.maybe_ignored_options.is_none()); assert!(result_info.maybe_ignored_options.is_none());
assert!(result_info.diagnostics.is_empty()); assert!(result_info.diagnostics.is_empty());
let h = handler.lock().unwrap(); let (ver0, ver1) = {
assert_eq!(h.version_calls.len(), 2); let h = handler.lock().unwrap();
let ver0 = h.version_calls[0].1.clone(); assert_eq!(h.version_calls.len(), 2);
let ver1 = h.version_calls[1].1.clone(); (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's do it all over again to ensure that the versions are determinstic
let (graph, handler) = setup(specifier).await; let (graph, handler) = setup(specifier).await;

View file

@ -107,10 +107,12 @@ impl ModuleLoader for EmbeddedModuleLoader {
} }
async fn run(source_code: String, args: Vec<String>) -> Result<(), AnyError> { async fn run(source_code: String, args: Vec<String>) -> Result<(), AnyError> {
let mut flags = Flags::default(); let flags = Flags {
flags.argv = args[1..].to_vec(); argv: args[1..].to_vec(),
// TODO(lucacasonato): remove once you can specify this correctly through embedded metadata // TODO(lucacasonato): remove once you can specify this correctly through embedded metadata
flags.unstable = true; unstable: true,
..Default::default()
};
let main_module = ModuleSpecifier::resolve_url(SPECIFIER)?; let main_module = ModuleSpecifier::resolve_url(SPECIFIER)?;
let permissions = Permissions::allow_all(); let permissions = Permissions::allow_all();
let module_loader = Rc::new(EmbeddedModuleLoader(source_code)); let module_loader = Rc::new(EmbeddedModuleLoader(source_code));

View file

@ -334,7 +334,7 @@ mod internal {
impl PartialEq for Node { impl PartialEq for Node {
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
self as *const _ == other as *const _ std::ptr::eq(self, other)
} }
} }

View file

@ -1660,15 +1660,14 @@ async fn op_utime_async(
args: Value, args: Value,
_zero_copy: BufVec, _zero_copy: BufVec,
) -> Result<Value, AnyError> { ) -> Result<Value, AnyError> {
let state = state.borrow(); super::check_unstable(&state.borrow(), "Deno.utime");
super::check_unstable(&state, "Deno.utime");
let args: UtimeArgs = serde_json::from_value(args)?; let args: UtimeArgs = serde_json::from_value(args)?;
let path = PathBuf::from(&args.path); let path = PathBuf::from(&args.path);
let atime = filetime::FileTime::from_unix_time(args.atime.0, args.atime.1); 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); 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 || { tokio::task::spawn_blocking(move || {
filetime::set_file_times(path, atime, mtime)?; filetime::set_file_times(path, atime, mtime)?;