Skip to content

Conversation

@WaterWhisperer
Copy link

@WaterWhisperer WaterWhisperer commented Dec 18, 2025

fixes the main_recursion lint which was previously skipping all no_std crates. It also fixes existing UI tests that were "testing nothing" because they were either marked as //@check-pass while missing expected errors, or were being compiled as libraries (which have no entrypoints).

  • Lint Change: Removed the has_no_std_attr check in MainRecursion. The is_entrypoint_fn utility is now robust enough to handle entrypoint detection correctly without this manual skip.
  • Test Fixes:
    • Updated entrypoint_recursion.rs by adding a dummy main function to force the compiler to treat it as a binary crate, allowing #[rustc_main] to be recognized as an entrypoint.
    • Added no_std_main_recursion.rs to specifically verify the lint works in #![no_std] environments.

Fixes #11034

  • Added passing UI tests (including committed .stderr file)
  • cargo test passes locally
  • Executed cargo dev update_lints
  • Run cargo dev fmt

changelog: [main_recursion]: now works in no_std crates and fixed broken tests

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 18, 2025

r? @samueltardieu

rustbot has assigned @samueltardieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clippy::main_recursion tests seem to be testing nothing anymore

3 participants