Skip to content

Commit

Permalink
build(cargo): Update rustc to nightly-2024-04-16 (#8870)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Apr 17, 2024
1 parent 036414a commit f9459a8
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 53 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions bindings/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bindings/binding_core_node/Cargo.toml
Expand Up @@ -44,7 +44,6 @@ napi-derive = { version = "2", default-features = false, features = [
] }
node_macro_deps = { path = "../node_macro_deps" }
path-clean = "0.1"
proc-macro2 = "=1.0.79"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["unbounded_depth"] }
tracing = { version = "0.1.37", features = ["release_max_level_info"] }
Expand Down
1 change: 0 additions & 1 deletion bindings/binding_core_wasm/Cargo.toml
Expand Up @@ -33,7 +33,6 @@ plugin = []
[dependencies]
anyhow = "1.0.66"
getrandom = { version = "0.2.10", features = ["js"] }
proc-macro2 = "=1.0.79"
serde = { version = "1", features = ["derive"] }
serde-wasm-bindgen = "0.4.5"
swc_core = { version = "0.90.33", features = [
Expand Down
1 change: 0 additions & 1 deletion bindings/binding_minifier_node/Cargo.toml
Expand Up @@ -27,7 +27,6 @@ napi-derive = { version = "2", default-features = false, features = [
] }
node_macro_deps = { path = "../node_macro_deps" }
path-clean = "0.1"
proc-macro2 = "=1.0.79"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["unbounded_depth"] }
sourcemap = "8.0.0"
Expand Down
1 change: 0 additions & 1 deletion bindings/binding_minifier_wasm/Cargo.toml
Expand Up @@ -33,7 +33,6 @@ plugin = []
[dependencies]
anyhow = "1.0.66"
getrandom = { version = "0.2.10", features = ["js"] }
proc-macro2 = "=1.0.79"
serde = { version = "1", features = ["derive"] }
serde-wasm-bindgen = "0.4.5"
swc_core = { version = "0.90.33", features = [
Expand Down
3 changes: 1 addition & 2 deletions bindings/node_macro_deps/Cargo.toml
Expand Up @@ -12,5 +12,4 @@ bench = false
proc-macro = true

[dependencies]
proc-macro2 = "=1.0.79"
quote = "1"
quote = "1"
1 change: 0 additions & 1 deletion bindings/swc_cli/Cargo.toml
Expand Up @@ -19,5 +19,4 @@ plugin = ["swc_cli_impl/plugin"]

[dependencies]
anyhow = "1.0.66"
proc-macro2 = "=1.0.79"
swc_cli_impl = "0.8.25"
1 change: 0 additions & 1 deletion crates/swc/src/config/mod.rs
Expand Up @@ -3,7 +3,6 @@ use std::{
env,
path::{Path, PathBuf},
sync::Arc,
usize,
};

use anyhow::{bail, Context, Error};
Expand Down
4 changes: 1 addition & 3 deletions crates/swc_common/src/source_map.rs
Expand Up @@ -874,9 +874,7 @@ impl SourceMap {

// Disregard indexes that are at the start or end of their spans, they can't fit
// bigger characters.
if (!forwards && end_index == usize::min_value())
|| (forwards && start_index == usize::max_value())
{
if (!forwards && end_index == usize::MIN) || (forwards && start_index == usize::MAX) {
debug!("find_width_of_character_at_span: start or end of span, cannot be multibyte");
return 1;
}
Expand Down
1 change: 0 additions & 1 deletion crates/swc_core/tests/fixture/stub_napi/Cargo.toml
Expand Up @@ -39,7 +39,6 @@ napi-derive = { version = "2", default-features = false, features = [
"type-def",
] }
path-clean = "0.1"
proc-macro2 = "=1.0.79"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["unbounded_depth"] }
tracing = { version = "0.1.37", features = ["release_max_level_info"] }
Expand Down
1 change: 0 additions & 1 deletion crates/swc_core/tests/fixture/stub_wasm/Cargo.toml
Expand Up @@ -17,7 +17,6 @@ swc_v1 = []
[dependencies]
anyhow = "1.0.66"
browserslist-rs = { version = "0.13.0", features = ["wasm_bindgen"] }
proc-macro2 = "=1.0.79"
serde = { version = "1", features = ["derive"] }
serde-wasm-bindgen = "0.4.5"
swc_core = { path = "../../../../swc_core", features = [
Expand Down
1 change: 1 addition & 0 deletions crates/swc_css_codegen/src/lib.rs
@@ -1,5 +1,6 @@
#![deny(clippy::all)]
#![allow(clippy::needless_update)]
#![allow(non_local_definitions)]

pub use std::fmt::Result;
use std::{borrow::Cow, str, str::from_utf8};
Expand Down
4 changes: 2 additions & 2 deletions crates/swc_css_utils/src/lib.rs
Expand Up @@ -317,7 +317,7 @@ pub fn hsl_to_rgb(hsl: [f64; 3]) -> [f64; 3] {
let k = (n + h / 30.0) % 12.0;
let a = s * f64::min(l, 1.0 - l);

l - a * f64::max(-1.0, f64::min(f64::min(k - 3.0, 9.0 - k), 1.0))
l - a * f64::min(k - 3.0, 9.0 - k).clamp(-1.0, 1.0)
};

r = f(0.0);
Expand All @@ -339,7 +339,7 @@ pub fn to_rgb255(abc: [f64; 3]) -> [f64; 3] {
}

pub fn clamp_unit_f64(val: f64) -> u8 {
(val * 255.).round().max(0.).min(255.) as u8
(val * 255.).round().clamp(0., 255.) as u8
}

pub fn round_alpha(alpha: f64) -> f64 {
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_codegen/src/lib.rs
Expand Up @@ -3,6 +3,7 @@
#![deny(unused)]
#![allow(clippy::match_like_matches_macro)]
#![allow(clippy::nonminimal_bool)]
#![allow(non_local_definitions)]

use std::{borrow::Cow, fmt::Write, io};

Expand Down
4 changes: 2 additions & 2 deletions crates/swc_ecma_compat_es2015/src/destructuring.rs
Expand Up @@ -228,7 +228,7 @@ impl AssignFolder {
},
Some(init),
Some(if has_rest_pat(&elems) {
std::usize::MAX
usize::MAX
} else {
elems.len()
}),
Expand Down Expand Up @@ -721,7 +721,7 @@ impl VisitMut for AssignFolder {
&mut self.vars,
None,
Some(if has_rest_pat(elems) {
std::usize::MAX
usize::MAX
} else {
elems.len()
}),
Expand Down
6 changes: 3 additions & 3 deletions crates/swc_ecma_parser/src/lexer/number.rs
Expand Up @@ -536,7 +536,7 @@ impl<'a> Lexer<'a> {

#[cfg(test)]
mod tests {
use std::{f64::INFINITY, panic};
use std::panic;

use super::*;

Expand Down Expand Up @@ -576,7 +576,7 @@ mod tests {
0000000000000000000000000000000000000000000000000000";
#[test]
fn num_inf() {
assert_eq!(num(LONG), (INFINITY, LONG.into()));
assert_eq!(num(LONG), (f64::INFINITY, LONG.into()));
}

/// Number >= 2^53
Expand Down Expand Up @@ -625,7 +625,7 @@ mod tests {

assert_eq!(
num(LARGE_POSITIVE_EXP),
(INFINITY, LARGE_POSITIVE_EXP.into())
(f64::INFINITY, LARGE_POSITIVE_EXP.into())
);
assert_eq!(num(LARGE_NEGATIVE_EXP), (0.0, LARGE_NEGATIVE_EXP.into()));
assert_eq!(
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_ecma_transforms_optimization/src/json_parse.rs
@@ -1,5 +1,3 @@
use std::usize;

use serde_json::Value;
use swc_common::{util::take::Take, Spanned, DUMMY_SP};
use swc_ecma_ast::*;
Expand Down
26 changes: 10 additions & 16 deletions crates/swc_ecma_utils/src/lib.rs
Expand Up @@ -11,13 +11,7 @@ pub extern crate swc_ecma_ast;
#[doc(hidden)]
pub extern crate swc_common;

use std::{
borrow::Cow,
f64::{INFINITY, NAN},
hash::Hash,
num::FpCategory,
ops::Add,
};
use std::{borrow::Cow, hash::Hash, num::FpCategory, ops::Add};

use rustc_hash::FxHashMap;
use swc_atoms::JsWord;
Expand Down Expand Up @@ -891,8 +885,8 @@ pub trait ExprExt {
_ => return (Pure, Unknown),
},
Expr::Ident(Ident { sym, span, .. }) => match &**sym {
"undefined" | "NaN" if span.ctxt == ctx.unresolved_ctxt => NAN,
"Infinity" if span.ctxt == ctx.unresolved_ctxt => INFINITY,
"undefined" | "NaN" if span.ctxt == ctx.unresolved_ctxt => f64::NAN,
"Infinity" if span.ctxt == ctx.unresolved_ctxt => f64::INFINITY,
_ => return (Pure, Unknown),
},
Expr::Unary(UnaryExpr {
Expand All @@ -908,7 +902,7 @@ pub trait ExprExt {
}) if &**sym == "Infinity" && span.ctxt == ctx.unresolved_ctxt
) =>
{
-INFINITY
-f64::INFINITY
}
Expr::Unary(UnaryExpr {
op: op!("!"),
Expand All @@ -930,9 +924,9 @@ pub trait ExprExt {
..
}) => {
if arg.may_have_side_effects(ctx) {
return (MayBeImpure, Known(NAN));
return (MayBeImpure, Known(f64::NAN));
} else {
NAN
f64::NAN
}
}

Expand Down Expand Up @@ -1578,19 +1572,19 @@ pub fn num_from_str(s: &str) -> Value<f64> {
b"0x" | b"0X" => {
return match u64::from_str_radix(&s[2..], 16) {
Ok(n) => Known(n as f64),
Err(_) => Known(NAN),
Err(_) => Known(f64::NAN),
}
}
b"0o" | b"0O" => {
return match u64::from_str_radix(&s[2..], 8) {
Ok(n) => Known(n as f64),
Err(_) => Known(NAN),
Err(_) => Known(f64::NAN),
};
}
b"0b" | b"0B" => {
return match u64::from_str_radix(&s[2..], 2) {
Ok(n) => Known(n as f64),
Err(_) => Known(NAN),
Err(_) => Known(f64::NAN),
};
}
_ => {}
Expand All @@ -1611,7 +1605,7 @@ pub fn num_from_str(s: &str) -> Value<f64> {
_ => {}
}

Known(s.parse().ok().unwrap_or(NAN))
Known(s.parse().ok().unwrap_or(f64::NAN))
}

impl ExprExt for Box<Expr> {
Expand Down
1 change: 1 addition & 0 deletions crates/swc_html_codegen/src/lib.rs
@@ -1,6 +1,7 @@
#![deny(clippy::all)]
#![allow(clippy::needless_update)]
#![allow(clippy::match_like_matches_macro)]
#![allow(non_local_definitions)]

pub use std::fmt::Result;
use std::{borrow::Cow, iter::Peekable, str::Chars};
Expand Down
Expand Up @@ -10,7 +10,6 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
proc-macro2 = "=1.0.79"
serde = "1"
swc_core = { path = "../../../../swc_core", features = [
"css_ast",
Expand Down
Expand Up @@ -10,7 +10,6 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
proc-macro2 = "=1.0.79"
serde = "1"
swc_core = { path = "../../../../swc_core", features = [
"ecma_plugin_transform",
Expand Down
Expand Up @@ -10,7 +10,6 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
proc-macro2 = "=1.0.79"
serde = "1"
swc_core = { path = "../../../../swc_core", features = [
"ecma_plugin_transform",
Expand Down
Expand Up @@ -10,7 +10,6 @@ version = "0.1.0"
crate-type = ["cdylib"]

[dependencies]
proc-macro2 = "=1.0.79"
serde = "1"
swc_core = { path = "../../../../swc_core", features = [
"ecma_plugin_transform",
Expand Down
1 change: 1 addition & 0 deletions crates/swc_xml_codegen/src/lib.rs
@@ -1,5 +1,6 @@
#![deny(clippy::all)]
#![allow(clippy::needless_update)]
#![allow(non_local_definitions)]

pub use std::fmt::Result;
use std::{iter::Peekable, str::Chars};
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
@@ -1 +1 @@
nightly-2024-04-03
nightly-2024-04-16

0 comments on commit f9459a8

Please sign in to comment.