Skip to content

test(nat): Remove warning for shuttle tests - #1617

Merged
qmonnet merged 1 commit into
mainfrom
pr/qmonnet/warning-shuttle
Jul 8, 2026
Merged

qmonnet merged 1 commit into
mainfrom
pr/qmonnet/warning-shuttle

Conversation

@qmonnet

@qmonnet qmonnet commented Jul 6, 2026

Copy link
Copy Markdown
Member

We have a warning when building the shuttle tests for nat:

$ cargo check --features shuttle --all-targets -p dataplane-nat
[...]
warning: function `vpcd1` is never used
  --> nat/src/masquerade/apalloc/test_alloc.rs:43:12
   |
43 |     pub fn vpcd1() -> VpcDiscriminant {
   |            ^^^^^
   |
   = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

It's not blocking, but let's suppress it anyway.

@qmonnet qmonnet self-assigned this Jul 6, 2026
Copilot AI review requested due to automatic review settings July 6, 2026 11:12
@qmonnet
qmonnet requested a review from a team as a code owner July 6, 2026 11:12
@qmonnet qmonnet added the area/nat Related to Network Address Translation (NAT) label Jul 6, 2026
@qmonnet
qmonnet requested review from sergeymatov and removed request for a team July 6, 2026 11:12
@qmonnet
qmonnet enabled auto-merge July 6, 2026 11:13
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4abafa33-149e-4dd1-929c-928aaa867057

📥 Commits

Reviewing files that changed from the base of the PR and between 557fa3c and cd11e47.

📒 Files selected for processing (1)
  • nat/src/masquerade/apalloc/test_alloc.rs
✅ Files skipped from review due to trivial changes (1)
  • nat/src/masquerade/apalloc/test_alloc.rs

📝 Walkthrough

Walkthrough

test_alloc.rs updates warning suppression in the context test-helper module from unused to dead_code. No helper logic, control flow, or public API changes are made.

Changes

Test helper lint suppression

Layer / File(s) Summary
Update helper warning attributes
nat/src/masquerade/apalloc/test_alloc.rs
Replaces #[allow(unused)] with #[allow(dead_code)] on helper items in context, and adds a matching #[allow(dead_code)] before the next helper.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the warning-suppression change for NAT shuttle tests.
Description check ✅ Passed The description matches the code change by explaining the dead_code warning and intent to suppress it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Suppresses a dead_code warning when compiling NAT shuttle tests by annotating an unused test helper.

Changes:

  • Add a lint suppression attribute to context::vpcd1() to avoid dead_code warnings under shuttle builds.

@qmonnet
qmonnet force-pushed the pr/qmonnet/warning-shuttle branch from 557fa3c to 1615488 Compare July 6, 2026 11:18
@qmonnet
qmonnet added this pull request to the merge queue Jul 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 6, 2026
@qmonnet
qmonnet added this pull request to the merge queue Jul 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 7, 2026
We have a warning when building the shuttle tests for nat:

    $ cargo check --features shuttle --all-targets -p dataplane-nat
    [...]
    warning: function `vpcd1` is never used
      --> nat/src/masquerade/apalloc/test_alloc.rs:43:12
       |
    43 |     pub fn vpcd1() -> VpcDiscriminant {
       |            ^^^^^
       |
       = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

It's not blocking, but let's suppress it anyway.

On Copilot review's suggestion, suppress "dead_code" warnings rather
than "unused", that might be broader (such as unused variables or
imports inside of body functions).

Signed-off-by: Quentin Monnet <qmo@qmon.net>
@qmonnet
qmonnet force-pushed the pr/qmonnet/warning-shuttle branch from 1615488 to cd11e47 Compare July 8, 2026 08:13
@qmonnet
qmonnet enabled auto-merge July 8, 2026 08:13
@qmonnet
qmonnet added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit a72822a Jul 8, 2026
28 checks passed
@qmonnet
qmonnet deleted the pr/qmonnet/warning-shuttle branch July 8, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/nat Related to Network Address Translation (NAT)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants