Skip to content

fix: Explicitly call out dev-dependencies used in solutions#3196

Draft
arnavnagzirkar wants to merge 1 commit into
google:mainfrom
arnavnagzirkar:fix-1290
Draft

fix: Explicitly call out dev-dependencies used in solutions#3196
arnavnagzirkar wants to merge 1 commit into
google:mainfrom
arnavnagzirkar:fix-1290

Conversation

@arnavnagzirkar
Copy link
Copy Markdown

Summary

Root Cause

The src/unsafe-rust/exercise.rs solution has unit tests that use the
tempfile crate (tempfile::TempDir::new()). However:

  1. tempfile was listed under [dependencies] instead of [dev-dependencies]
    in src/unsafe-rust/Cargo.toml, even though it is only needed at test time.
  2. The solution.md page did not mention tempfile at all, so anyone who
    copy-pastes the solution into a new Cargo project would get compile errors
    without knowing they need to add the crate.

Change Made

src/unsafe-rust/Cargo.toml — moved tempfile from [dependencies] to
[dev-dependencies]:

[dev-dependencies]
tempfile = "3.27.0"

src/unsafe-rust/solution.md — added a note at the top of the solution
page instructing readers to add tempfile as a dev-dependency:

The unit tests use the [`tempfile`](https://docs.rs/tempfile/) crate. Add it as
a dev-dependency with:

```shell
cargo add --dev tempfile



## Issue

Fixes #1290

**Issue URL:** https://github.com/google/comprehensive-rust/issues/1290


## Changes

src/unsafe-rust/Cargo.toml | 2 +-
src/unsafe-rust/solution.md | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)



## Testing


- Agent ran relevant tests during development

- Linting checks passed

- Changes are minimal and focused on the issue


## AI Assistance Disclosure


This pull request was prepared with the assistance of AI coding tools (GitHub Copilot). The change has been read, understood, and is owned by the human contributor submitting it, who will respond to review feedback.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Jun 2, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant