-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 clippy172 v1 #9418
Rust clippy172 v1 #9418
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #9418 +/- ##
==========================================
- Coverage 82.17% 82.14% -0.04%
==========================================
Files 968 968
Lines 274198 274199 +1
==========================================
- Hits 225331 225230 -101
- Misses 48867 48969 +102
Flags with carried forward coverage won't be shown. Click here to find out more. |
We could pin clippy to a version, and making updating it a manual process. |
Clippy nightly does not give the newt warnings somehow ? |
I don't think we should run nightly for linting. By definition lints that it produces may not be fixable without suppression in our MSRV, or could change from night to night as they realize mistakes were made. |
WARNING:
Pipeline 15787 |
Not perfect either... |
Jason has also one commit to upgrade the crate bit flags cf 6b6c598 |
@@ -84,7 +84,7 @@ pub fn detect_parse_iprep(i: &str) -> IResult<&str, DetectIPRepData> { | |||
let (i, name) = take_while(is_alphanumeric_or_slash)(i)?; | |||
// copy as to have final zero | |||
let namez = CString::new(name).unwrap(); | |||
let cat = unsafe { SRepCatGetByShortname(namez.as_ptr() as *const i8) }; | |||
let cat = unsafe { SRepCatGetByShortname(namez.as_ptr()) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gives errors on my arm builders:
Compiling suricata v7.0.1-dev (/builds/inliniac/suricata-ci/suricata/rust)
error[E0308]: mismatched types
--> src/detect/iprep.rs:87:46
|
87 | let cat = unsafe { SRepCatGetByShortname(namez.as_ptr()) };
| --------------------- ^^^^^^^^^^^^^^ expected `*const i8`, found `*const u8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const i8`
found raw pointer `*const u8`
note: function defined here
--> src/detect/iprep.rs:74:12
|
74 | pub fn SRepCatGetByShortname(name: *const i8) -> u8;
| ^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0308`.
error: could not compile `suricata` (lib) due to previous error
Compiling suricata v7.0.1-dev (/builds/inliniac/suricata-ci/suricata/rust)
error[E0308]: mismatched types
--> src/detect/iprep.rs:87:46
|
87 | let cat = unsafe { SRepCatGetByShortname(namez.as_ptr()) };
| --------------------- ^^^^^^^^^^^^^^ expected `i8`, found `u8`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*const i8`
found raw pointer `*const u8`
note: function defined here
--> src/detect/iprep.rs:74:12
|
74 | pub fn SRepCatGetByShortname(name: *const i8) -> u8;
| ^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0308`.
error: could not compile `suricata` due to previous error
Not sure why the 2 errors are different, perhaps rustc version differences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC C type char
is unsigned in arm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see inline comments
Replaced by #9433 |
Link to redmine ticket:
None
Describe changes:
@jasonish how can we prevent CI from going red when clippy 1.73 will be out ?