Skip to content

Commit

Permalink
Update rust-toolchain to 2023-11-16 (vercel#58558)
Browse files Browse the repository at this point in the history
This updates the rust toolchain to 2023-11-16 and:

- Removes now-unnecessary `#![feature(async_fn_in_trait)]`
- Applies auto-fixable lint fixes
- Uses `Cargo.toml` new `lint` section instead of command line rustc flags

Test Plan: Tested with updated turbo in a create-next-app


Closes PACK-1979

Co-authored-by: OJ Kwon <[email protected]>
  • Loading branch information
wbinnssmith and kwonoj authored Nov 18, 2023
1 parent c0e5d65 commit 024a0ef
Show file tree
Hide file tree
Showing 23 changed files with 79 additions and 52 deletions.
1 change: 0 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ rustflags = [
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
]
66 changes: 33 additions & 33 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ members = [
"packages/next-swc/crates/next-transform-strip-page-exports",
]

[workspace.lints.clippy]
too_many_arguments = "allow"

# This is a workaround for wasm timeout issue
[profile.dev.package."*"]
debug-assertions = false
Expand All @@ -40,11 +43,11 @@ next-transform-strip-page-exports = { path = "packages/next-swc/crates/next-tran
testing = { version = "0.35.7" }

# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231114.2" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231117.4" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231114.2" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231117.4" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231114.2" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-231117.4" }

# General Deps

Expand Down
3 changes: 3 additions & 0 deletions packages/next-swc/crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ publish = false
[features]
plugin = ["turbopack-binding/__swc_core_binding_napi_plugin"]

[lints]
workspace = true

[dependencies]
chrono = "0.4"
convert_case = "0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/core/src/auto_cjs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Visit for CjsFinder {
(&*member_expr.obj, &member_expr.prop)
{
if &*obj.sym == "Object" && &*prop.sym == "defineProperty" {
if let Some(ExprOrSpread { expr: expr0, .. }) = e.args.get(0) {
if let Some(ExprOrSpread { expr: expr0, .. }) = e.args.first() {
if let Expr::Ident(arg0) = &**expr0 {
if &*arg0.sym == "exports" {
if let Some(ExprOrSpread { expr: expr1, .. }) = e.args.get(1) {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/core/src/cjs_optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ impl VisitMut for CjsOptimizer {
{
if let Expr::Ident(ident) = &**callee {
if ident.span.ctxt == self.unresolved_ctxt && ident.sym == *"require" {
if let Some(arg) = args.get(0) {
if let Some(arg) = args.first() {
if let Expr::Lit(Lit::Str(v)) = &*arg.expr {
// TODO: Config

Expand Down
3 changes: 3 additions & 0 deletions packages/next-swc/crates/napi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ __internal_dhat-heap = ["dhat"]
# effectively does nothing.
__internal_dhat-ad-hoc = ["dhat"]

[lints]
workspace = true

[dependencies]
anyhow = "1.0.66"
backtrace = "0.3"
Expand Down
1 change: 0 additions & 1 deletion packages/next-swc/crates/napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ DEALINGS IN THE SOFTWARE.
#![recursion_limit = "2048"]
//#![deny(clippy::all)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]

#[macro_use]
extern crate napi_derive;
Expand Down
3 changes: 3 additions & 0 deletions packages/next-swc/crates/next-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ custom_allocator = [
"turbopack-binding/__turbo_tasks_malloc_custom_allocator",
]

[lints]
workspace = true

[dependencies]
anyhow = { workspace = true, features = ["backtrace"] }
futures = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion packages/next-swc/crates/next-api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(future_join)]
#![feature(arbitrary_self_types)]
#![feature(async_fn_in_trait)]

mod app;
mod dynamic_imports;
Expand Down
Loading

0 comments on commit 024a0ef

Please sign in to comment.