27 Commits

Author SHA1 Message Date
Will Binns-Smith 1c39fcafdb Update Rust toolchain to nightly-2026-07-29 (#96365)
This updates to nightly-2026-07-29

---------

Co-authored-by: vercel-fleet[bot] <308483924+vercel-fleet[bot]@users.noreply.github.com>
Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>
2026-07-30 15:11:40 -07:00
Luke Sandberg b2add075ae Bump Rust toolchain (#95205)
Bump rust nightly version

Critically this fixes a bug in Rust Analyzer where it didn't understand
'pattern_types' a new rust feature that is used by `NonZero<T>` types
for example)


![image.png](https://app.graphite.com/user-attachments/assets/04c3a119-d08b-457a-bd55-6fe94da24806.png)

So now we can get feedback on the size of types containing vc!

From scanning release notes there is nothing major that i can see.
Clippy did flag one new warning that is being addressed as well.
2026-06-26 10:11:02 -07:00
Niklas Mischkulnig 55b2d3c744 Upgrade rustc to nightly-2026-05-15 (#94021) 2026-05-21 20:26:11 +02:00
Will Binns-Smith d6906eabd6 Update Rust toolchain to nightly-2026-04-02 (#92288) 2026-04-03 17:27:59 -07:00
Sebastian "Sebbie" Silbermann e160f03f96 [ci] Fix input cache keys for tasks referencing rust-toolchain (#90442) 2026-02-24 16:14:00 +00:00
Benjamin Woodruff 5563b4d7e1 Turbopack: Update rust toolchain to nightly-2026-02-18 (#89974)
Rust finally merged a fix to the "trying to encode a dep node twice" ICE we seem to most frequently run into, triggered by the rustc parallel frontend feature: https://github.com/rust-lang/rust/pull/151509

- @mischnic  commented on the issue: https://github.com/rust-lang/rust/issues/150018#issuecomment-3754877064
- @mischnic just updated our toolchain last week, but I'd like to get this fix in.

CI Job for build-and-release that covers all platforms: https://github.com/vercel/next.js/actions/runs/22156881743  
  
In the process of this upgrade, I found and reported https://github.com/rust-lang/rust/issues/152735 upstream (fixed `nightly-2026-02-18`).
2026-02-18 15:41:22 -08:00
Niklas Mischkulnig 6dfcffe1cf Upgrade rustc to 2026-02-05 (#89591)
- checked_div 
- loop -> while
2026-02-06 21:03:00 +01:00
Niklas Mischkulnig 507194aa64 Upgrade to rustc 2026-01-04 (#88095) 2026-01-08 09:30:10 +01:00
Will Binns-Smith 6ea6270ec3 Update rust toolchain to 2025-10-27 (#85409)
- **Remove now-unnecessary feature flag for new_zeroed_alloc**
- **Remove unused import**
- **Update toolchain to 2025-10-27**
2025-10-27 14:49:10 -07:00
Niklas Mischkulnig c2081b134e Bump Rust to nightly-2025-09-21 (#83415)
It compiles fine, but we have another problem: `cargo fmt` really doesn't like it

```
cargo fmt -- turbopack/crates/turbo-tasks-fs/src/lib.rs
error: let chains are only allowed in Rust 2024 or later
   --> /Users/niklas/code/next.js/turbopack/crates/turbo-tasks-fs/src/lib.rs:749:44
    |
749 |                     if create_directory && let Some(parent) = full_path.parent() {
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: let chains are only allowed in Rust 2024 or later
   --> /Users/niklas/code/next.js/turbopack/crates/turbo-tasks-fs/src/lib.rs:893:44
    |
893 |                     if create_directory && let Some(parent) = full_path.parent() {
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: let chains are only allowed in Rust 2024 or later
    --> /Users/niklas/code/next.js/turbopack/crates/turbo-tasks-fs/src/lib.rs:1233:12
     |
1233 |         if let Some(path) = join_path(&self.path, path)
     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

```

The precommit hook that selectively runs on files is simply not a supported usecase.

So I changed that to `rustfmt --edition 2024 -- `​ now 🤷 

Previous discussion: https://vercel.slack.com/archives/C03EWR7LGEN/p1748898285716779
2025-09-23 17:15:44 +02:00
Benjamin Woodruff 3e750d104f Devcontainer: Replace Dockerfile with prebuilt image+features (#82450)
Devcontainers support custom `Dockerfile`s, but it seems like it's more recommended to use a base image with "features" on top: https://containers.dev/implementors/features/

Features get applied after the `Dockerfile`, so e.g. if we're installing `rust` with a feature, then we can't install things that depend on `rust` (e.g. `cargo-nextest`: https://nexte.st/) in the `Dockerfile`. So you're forced to do things with features instead, which can specify dependencies and ordering requirements.

I removed a bunch of comments that were left over from the template. People wishing to update this file should refer to the https://aka.ms/devcontainer.json link at the top of the file.

Also added a lockfile for the features, generated with:

```
devcontainer upgrade --workspace-folder=.
```

**Note:** The `base.Dockerfile` here was entirely unused.


### Testing

```
podman stop --all && podman rm --all  # replace podman with docker if you're using docker
devcontainer up --workspace-folder=.
devcontainer exec --workspace-folder=. zsh
```
2025-08-08 10:14:30 -07:00
Niklas Mischkulnig 1429d72421 Upgrade rust version to 2025-06-04 (#80200)
All code changes come from `cargo clippy --fix` to collapse ifs
2025-06-05 15:46:36 +02:00
Will Binns-Smith 2b7d378f62 Rust: restore toolchain 2025-05-12 (#79121)
This restores #79117.

https://github.com/rust-lang/rust/issues/71520 broke Windows on arm64
when using rust-lld, so this disables that for now.

Test Plan: `pnpm --filter=@next/swc run build-native-no-plugin-release
--target aarch64-pc-windows-msvc` on Windows on arm64.
2025-05-12 21:58:37 -07:00
Will Binns-Smith ed160544f9 Revert toolchain update to 2025-05-12 (#79117)
This partially reverts commit 1866e4403b,
reverting the toolchain update but keeping the clippy fixes.
2025-05-12 23:25:35 +00:00
Will Binns-Smith 1866e4403b Update rust toolchain to 2025-05-12 (#79099)
Clippy now warns on [uninlined format
strings](https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args).
Applied fixers with `cargo clippy --fix`.
2025-05-12 21:26:31 +00:00
Will Binns-Smith 79b266c3b7 Turbopack: Update toolchain to 2025-04-14 (Reapply #78062) (#78167)
This reverts commit dedf6d3ad9.

Test Plan:

Confirmed that 2025-04-10 crashed and created rustc-ice dumps whenever
rust-analyzer was used, even lightly.

Confirmed that 2025-04-14 no longer produces these files after multiple
restarts and light changes to some turbopack crates.
2025-04-14 16:09:38 -07:00
Niklas Mischkulnig dedf6d3ad9 Revert Rust upgrade to nightly-2025-04-10 (#78062)
Reverts most of #78039, I've kept the applied clippy suggestions though.

Unfortunately, a rustc ICE crash that was rare before now happens constantly, both when building and inside rust-analyzer, making everything just unusable.
2025-04-11 17:28:05 +02:00
Will Binns-Smith 2b6304ed1b Update Rust toolchain to nightly-2025-04-10 (#78039)
Attempts to reland parts of #77054.
    
- Removed `#![feature(extract_if)]`
- Removed `#![feature(hash_extract_if)]`
- Removed no-op `#[must_use]`
- Addressed new clippy violations
    
Test Plan:
    
- [ ] Manual build and deploy
2025-04-10 14:51:23 -07:00
Will Binns-Smith a6e6f70507 Revert "Update rust toolchain to 2025-03-12" (#77103)
Reverts vercel/next.js#77054

Looks like this breaks lld on macOS Intel.
2025-03-13 20:01:22 -07:00
Will Binns-Smith d6dbb70e32 Update rust toolchain to 2025-03-12 (#77054)
- Removed `#![feature(extract_if)]`
- Removed `#![feature(hash_extract_if)]`
- Removed no-op `#[must_use]`
- Addressed new clippy violations
2025-03-13 15:29:04 -07:00
Will Binns-Smith cb8d1b0b13 Update toolchain to nightly-2025-02-12 (#75983)
This updates the Rust toolchain to nightly-2025-02-12. It required:

- Removing `#![feature(async_closure)]`
- Removing `#![feature(map_many_mut)]` and renaming `map.get_many_mut()`
to `map.get_disjoint_mut()`
- Adding a range argument to `vec.extract_if()`

Test Plan: CI
2025-02-13 03:02:19 +00:00
Niklas Mischkulnig 477e1e4bec Bump Rust version (#73169) 2024-12-12 11:35:26 +01:00
Will Binns-Smith 189f2da207 Update Rust toolchain to nightly-2024-10-04 (#70803)
This:

- Updates the toolchain file
- Adds `#![feature(arbitrary_self_types_pointers)]` as necessary
- Removes opt-ins for now-stable features like
`option_get_or_insert_default`
- Removes now-detectable dead code
2024-10-07 21:54:44 +00:00
Benjamin Woodruff 9d865a6628 chore(turbopack): Enable the rust-analyzer component in rust-toolchain.toml (#68592)
Discussion:
https://vercel.slack.com/archives/C03EWR7LGEN/p1722904371113719

Between @wbinnssmith and myself, we determined that if you don't specify
this component here:
- `rustup` won't install rust-analyzer by default (it isn't part of the
"minimal" profile)
- `rustacean.nvim` won't install it by default, and will instead just
ask you to install it if you run a health check:
https://github.com/mrcjkb/rustaceanvim/blob/193f1d7925a61a066f7aa7d5d75f0cfe17dc0a9e/lua/rustaceanvim/health.lua#L210
- The VSCode plugin will look for a rustup-installed version, but since
it doesn't exist, it will silently fall back to using its own bundled
version, which doesn't match our toolchain version:
https://github.com/rust-lang/rust-analyzer/blob/b23142209ef632475915e858f5f20901ef7c12da/editors/code/src/bootstrap.ts#L58-L60

Enabling this component ensures that everyone's IDE (VSCode or Neovim
with Rustacean.nvim) uses a version of rust-analyzer that matches the
rest of our toolchain. This also ensures reproducibility across the
whole team.

Copied the line from
https://github.com/vercel/nextpack/blob/main/rust-toolchain.toml

## Tradeoffs

This will install `rust-analyzer` in CI where it's not needed.

## Test Plan

```
rustup component remove rust-analyzer
rustup which rust-analyzer
```

Before this change, the `rustup which` command would fail. With this
change, it will auto-install `rust-analyzer`.
2024-08-06 14:00:35 -04:00
Niklas Mischkulnig 37df9ab243 Upgrade to rustc nightly-2024-08-01 (#68452)
1. Upgrade to `nightly-2024-08-01`
2. Fix lints
3. Remove some unused structs
4. Bump `regex` because of https://github.com/rust-lang/regex/pull/1219

Closes PACK-3178
2024-08-05 09:59:44 +02:00
Will Binns-Smith b39ae62a3b Update rust toolchain to nightly-2024-05-31 (#66428)
Depends on https://github.com/vercel/turbo/pull/8256
2024-06-01 03:37:04 +00:00
hrmny ce69d02cf9 chore: remove unused rust dependencies (#62176)
### What?

Toolchain is updated as well.

Should improve compile times marginally, also added the new parallel
frontend.

Depends on https://github.com/vercel/turbo/pull/7409

Closes PACK-2526
2024-04-16 17:48:06 +02:00