Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: don't suppress static_mut_refs globally - v3 #12680

Closed
wants to merge 4 commits into from

Conversation

jasonish
Copy link
Member

As its use is now a default compiler warning, and eventually will become an
error, remove the global suppression of it. Instead suppress as needed, or
refactor to get rid of the warning.

For reference:
https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html,

Ticket: https://redmine.openinfosecfoundation.org/issues/7417

It doesn't appear to be needed. The vec being cleared is only set once
per run, so never needs to be cleared.

Removes one point where we have to supress the static_mut_refs compiler
warning.

Ticket: OISF#7417
Allows us to get rid of the global supression.

Ticket: OISF#7417
Simply wrapping in a function removes static_mut_refs compiler
warning.

Ticket: OISF#7417
As references to static mutables are highly discouraged, remove the
global suppressing of the compiler warning. Each use case can be
suppressed as needed.

Ticket: OISF#7417
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.76%. Comparing base (80dbaac) to head (02cde06).
Report is 23 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12680   +/-   ##
=======================================
  Coverage   80.75%   80.76%           
=======================================
  Files         934      934           
  Lines      259594   259604   +10     
=======================================
+ Hits       209634   209664   +30     
+ Misses      49960    49940   -20     
Flag Coverage Δ
fuzzcorpus 56.98% <0.00%> (-0.01%) ⬇️
livemode 19.36% <0.00%> (-0.01%) ⬇️
pcap 44.20% <0.00%> (+0.03%) ⬆️
suricata-verify 63.54% <100.00%> (+0.01%) ⬆️
unittests 58.31% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@victorjulien victorjulien added this to the 8.0 milestone Feb 26, 2025
@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 24921

@@ -383,7 +382,6 @@ static void SMTPConfigure(void) {
} else {
/* Add default extract url scheme 'http' since
* extract-urls-schemes wasn't found in the config */
SCMimeSmtpConfigExtractUrlsSchemeReset();
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks I think I used this while trying to have a fuzz target that reload the configuration for each input

@victorjulien
Copy link
Member

Merged in #12685, thanks!

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

Successfully merging this pull request may close these issues.

4 participants