FuelLabs / FuelLabs/sway

Disallow calling `#[test]` functions from non-`#[test]` code

Open
#3,261 0 comments 0 reactions 0 assignees View on GitHub
compiler compiler: frontend forc-test team:compiler
Dominant language
Rust
Stars
61.4k
Forks
5.4k
Avg merge
3h 33m
Merged PRs (30d)
4

Description

Calling `#[test]` functions from non-test code shouldn't be particularly harmful, but is just a bit confusing and would make supporting `dev-dependencies` more complicated (or at least produce confusing results).

We should check function calls to ensure `#[test]` functions are never called from non-test code.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named. Start by locating the compiler checks for function calls and the handling of #[test] functions, then add coverage showing that non-test code cannot call them; done means those calls are rejected while calls from test code remain supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.