Skip to content

Conversation

ironcev
Copy link
Member

@ironcev ironcev commented Sep 11, 2025

Description

This PR adds expressive diagnostics for the UnusedReturnValue warning that explains how to intentionally ignore a returned value by using let _ = ....

The reason for adding the diagnostics was an observed confusion among novice Sway developers in the particular case of using __dbg intrinsic as a statement:

__dbg("some debug message");

It was unclear to developers why this usage generates the warning, and also how to remove it.

Additionally, the PR fixes some uninlined_format_args Clippy warnings.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@ironcev ironcev self-assigned this Sep 11, 2025
@ironcev ironcev added compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Sep 11, 2025
Copy link

codspeed-hq bot commented Sep 11, 2025

CodSpeed Performance Report

Merging #7382 will not alter performance

Comparing ironcev/expressive-diagnostics-for-unused-return-value (828ec9d) with master (608fc52)

Summary

✅ 25 untouched benchmarks

@ironcev ironcev marked this pull request as ready for review September 11, 2025 10:39
@ironcev ironcev requested review from a team as code owners September 11, 2025 10:39
@ironcev ironcev enabled auto-merge (squash) September 11, 2025 10:40
@IGI-111 IGI-111 requested a review from a team September 11, 2025 12:11
@ironcev ironcev merged commit 8fde717 into master Sep 12, 2025
41 checks passed
@ironcev ironcev deleted the ironcev/expressive-diagnostics-for-unused-return-value branch September 12, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants