1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

chore: upgrade to rust 1.80 (#24778)

(cherry picked from commit 8c2f1f5a55)
This commit is contained in:
Satya Rohith 2024-07-29 22:28:04 +05:30 committed by crowlkats
parent a3fb3bc3d8
commit ec2c30e4c9
No known key found for this signature in database
GPG key ID: A82C9D461FC483E8
18 changed files with 34 additions and 44 deletions

View file

@ -17,7 +17,6 @@ use deno_graph::ModuleGraphError;
use deno_graph::ModuleLoadError; use deno_graph::ModuleLoadError;
use deno_graph::ResolutionError; use deno_graph::ResolutionError;
use import_map::ImportMapError; use import_map::ImportMapError;
use std::fmt::Write;
fn get_import_map_error_class(_: &ImportMapError) -> &'static str { fn get_import_map_error_class(_: &ImportMapError) -> &'static str {
"URIError" "URIError"
@ -112,17 +111,5 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str {
e.downcast_ref::<ResolutionError>() e.downcast_ref::<ResolutionError>()
.map(get_resolution_error_class) .map(get_resolution_error_class)
}) })
.unwrap_or_else(|| { .unwrap_or("Error")
if cfg!(debug) {
log::warn!(
"Error '{}' contains boxed error of unknown type:{}",
e,
e.chain().fold(String::new(), |mut output, e| {
let _ = write!(output, "\n {e:?}");
output
})
);
}
"Error"
})
} }

View file

@ -215,6 +215,8 @@ pub enum SemicolonPreference {
Remove, Remove,
} }
// Allow due to false positive https://github.com/rust-lang/rust-clippy/issues/13170
#[allow(clippy::needless_borrows_for_generic_args)]
fn normalize_diagnostic( fn normalize_diagnostic(
diagnostic: &mut crate::tsc::Diagnostic, diagnostic: &mut crate::tsc::Diagnostic,
specifier_map: &TscSpecifierMap, specifier_map: &TscSpecifierMap,

View file

@ -1048,7 +1048,7 @@ fn junction_or_symlink_dir(
match junction::create(old_path, new_path) { match junction::create(old_path, new_path) {
Ok(()) => Ok(()), Ok(()) => Ok(()),
Err(junction_err) => { Err(junction_err) => {
if cfg!(debug) { if cfg!(debug_assertions) {
// When running the tests, junctions should be created, but if not then // When running the tests, junctions should be created, but if not then
// surface this error. // surface this error.
log::warn!("Error creating junction. {:#}", junction_err); log::warn!("Error creating junction. {:#}", junction_err);

View file

@ -27,3 +27,6 @@ serde_json = "1.0"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { workspace = true, features = ["errhandlingapi", "minwindef", "ntdef", "winbase", "winnt"] } winapi = { workspace = true, features = ["errhandlingapi", "minwindef", "ntdef", "winbase", "winnt"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_aarch, values("x86_64", "aarch64"))'] }

View file

@ -13,6 +13,10 @@ description = "WebGPU implementation for Deno"
[lib] [lib]
path = "lib.rs" path = "lib.rs"
[features]
angle = []
vulkan-portability = []
# We make all dependencies conditional on not being wasm, # We make all dependencies conditional on not being wasm,
# so the whole workspace can built as wasm. # so the whole workspace can built as wasm.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View file

@ -28,6 +28,9 @@ hmr = ["include_js_files_for_snapshotting"]
# assertion that a snapshot is provided. # assertion that a snapshot is provided.
only_snapshotted_js_sources = ["include_js_files_for_snapshotting"] only_snapshotted_js_sources = ["include_js_files_for_snapshotting"]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
[lib] [lib]
name = "deno_runtime" name = "deno_runtime"
path = "lib.rs" path = "lib.rs"

View file

@ -8,11 +8,9 @@ use deno_core::error::AnyError;
use deno_core::op2; use deno_core::op2;
use deno_core::OpState; use deno_core::OpState;
use deno_core::ResourceId; use deno_core::ResourceId;
use deno_core::ToJsBuffer;
use deno_http::http_create_conn_resource; use deno_http::http_create_conn_resource;
use deno_net::io::TcpStreamResource; use deno_net::io::TcpStreamResource;
use deno_net::ops_tls::TlsStreamResource; use deno_net::ops_tls::TlsStreamResource;
use serde::Serialize;
pub const UNSTABLE_FEATURE_NAME: &str = "http"; pub const UNSTABLE_FEATURE_NAME: &str = "http";
@ -74,11 +72,3 @@ fn op_http_start(
Err(bad_resource_id()) Err(bad_resource_id())
} }
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HttpUpgradeResult {
conn_rid: ResourceId,
conn_type: &'static str,
read_buf: ToJsBuffer,
}

View file

@ -514,7 +514,7 @@ impl WebWorker {
ops::web_worker::deno_web_worker::init_ops_and_esm(), ops::web_worker::deno_web_worker::init_ops_and_esm(),
]; ];
#[cfg(hmr)] #[cfg(feature = "hmr")]
assert!( assert!(
cfg!(not(feature = "only_snapshotted_js_sources")), cfg!(not(feature = "only_snapshotted_js_sources")),
"'hmr' is incompatible with 'only_snapshotted_js_sources'." "'hmr' is incompatible with 'only_snapshotted_js_sources'."

View file

@ -448,7 +448,7 @@ impl MainWorker {
ops::web_worker::deno_web_worker::init_ops_and_esm().disable(), ops::web_worker::deno_web_worker::init_ops_and_esm().disable(),
]; ];
#[cfg(hmr)] #[cfg(feature = "hmr")]
assert!( assert!(
cfg!(not(feature = "only_snapshotted_js_sources")), cfg!(not(feature = "only_snapshotted_js_sources")),
"'hmr' is incompatible with 'only_snapshotted_js_sources'." "'hmr' is incompatible with 'only_snapshotted_js_sources'."

View file

@ -1,3 +1,3 @@
[toolchain] [toolchain]
channel = "1.79.0" channel = "1.80.0"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]

View file

@ -14,6 +14,7 @@ path = "lib.rs"
[features] [features]
run = [] run = []
upgrade = []
[[test]] [[test]]
name = "integration_tests" name = "integration_tests"

View file

@ -2621,7 +2621,7 @@ mod permissions {
fn with_allow() { fn with_allow() {
for permission in &util::PERMISSION_VARIANTS { for permission in &util::PERMISSION_VARIANTS {
let status = util::deno_cmd() let status = util::deno_cmd()
.current_dir(&util::testdata_path()) .current_dir(util::testdata_path())
.arg("run") .arg("run")
.arg("--unstable") .arg("--unstable")
.arg(format!("--allow-{permission}")) .arg(format!("--allow-{permission}"))
@ -2655,7 +2655,7 @@ mod permissions {
const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"];
for permission in &PERMISSION_VARIANTS { for permission in &PERMISSION_VARIANTS {
let status = util::deno_cmd() let status = util::deno_cmd()
.current_dir(&util::testdata_path()) .current_dir(util::testdata_path())
.arg("run") .arg("run")
.arg(format!( .arg(format!(
"--allow-{0}={1}", "--allow-{0}={1}",
@ -2698,7 +2698,7 @@ mod permissions {
const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"];
for permission in &PERMISSION_VARIANTS { for permission in &PERMISSION_VARIANTS {
let status = util::deno_cmd() let status = util::deno_cmd()
.current_dir(&util::testdata_path()) .current_dir(util::testdata_path())
.arg("run") .arg("run")
.arg(format!( .arg(format!(
"--allow-{0}={1}", "--allow-{0}={1}",
@ -2746,7 +2746,7 @@ mod permissions {
let js_dir = util::root_path().join("js"); let js_dir = util::root_path().join("js");
for permission in &PERMISSION_VARIANTS { for permission in &PERMISSION_VARIANTS {
let status = util::deno_cmd() let status = util::deno_cmd()
.current_dir(&util::testdata_path()) .current_dir(util::testdata_path())
.arg("run") .arg("run")
.arg(format!("--allow-{permission}={test_dir},{js_dir}")) .arg(format!("--allow-{permission}={test_dir},{js_dir}"))
.arg("run/complex_permissions_test.ts") .arg("run/complex_permissions_test.ts")
@ -2765,7 +2765,7 @@ mod permissions {
const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"];
for permission in &PERMISSION_VARIANTS { for permission in &PERMISSION_VARIANTS {
let status = util::deno_cmd() let status = util::deno_cmd()
.current_dir(&util::testdata_path()) .current_dir(util::testdata_path())
.arg("run") .arg("run")
.arg(format!("--allow-{permission}=.")) .arg(format!("--allow-{permission}=."))
.arg("run/complex_permissions_test.ts") .arg("run/complex_permissions_test.ts")
@ -2784,7 +2784,7 @@ mod permissions {
const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"]; const PERMISSION_VARIANTS: [&str; 2] = ["read", "write"];
for permission in &PERMISSION_VARIANTS { for permission in &PERMISSION_VARIANTS {
let status = util::deno_cmd() let status = util::deno_cmd()
.current_dir(&util::testdata_path()) .current_dir(util::testdata_path())
.arg("run") .arg("run")
.arg(format!("--allow-{permission}=tls/../")) .arg(format!("--allow-{permission}=tls/../"))
.arg("run/complex_permissions_test.ts") .arg("run/complex_permissions_test.ts")

View file

@ -153,7 +153,7 @@ async fn registry_server_handler(
// serve the registry package files // serve the registry package files
let mut file_path = tests_path().join("registry").join("jsr").to_path_buf(); let mut file_path = tests_path().join("registry").join("jsr").to_path_buf();
file_path.push( file_path.push(
&req.uri().path()[1..] req.uri().path()[1..]
.replace("%2f", "/") .replace("%2f", "/")
.replace("%2F", "/"), .replace("%2F", "/"),
); );

View file

@ -1135,7 +1135,7 @@ async fn main_server(
_ => { _ => {
let uri_path = req.uri().path(); let uri_path = req.uri().path();
let mut file_path = testdata_path().to_path_buf(); let mut file_path = testdata_path().to_path_buf();
file_path.push(&uri_path[1..].replace("%2f", "/")); file_path.push(uri_path[1..].replace("%2f", "/"));
if let Ok(file) = tokio::fs::read(&file_path).await { if let Ok(file) = tokio::fs::read(&file_path).await {
let file_resp = custom_headers(uri_path, file); let file_resp = custom_headers(uri_path, file);
return Ok(file_resp); return Ok(file_resp);

View file

@ -150,7 +150,7 @@ async fn handle_req_for_registry(
// serve the registry package files // serve the registry package files
let uri_path = req.uri().path(); let uri_path = req.uri().path();
let mut file_path = root_dir.to_path_buf(); let mut file_path = root_dir.to_path_buf();
file_path.push(&uri_path[1..].replace("%2f", "/").replace("%2F", "/")); file_path.push(uri_path[1..].replace("%2f", "/").replace("%2F", "/"));
// serve if the filepath exists // serve if the filepath exists
if let Ok(file) = tokio::fs::read(&file_path).await { if let Ok(file) = tokio::fs::read(&file_path).await {