Skip to content

utmpx.rs: Remove duplicated const - #11323

Merged
cakebaker merged 1 commit into
uutils:mainfrom
oech3:patch-1
Mar 14, 2026
Merged

utmpx.rs: Remove duplicated const#11323
cakebaker merged 1 commit into
uutils:mainfrom
oech3:patch-1

Conversation

@oech3

@oech3 oech3 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Conflicting with pub use libc::ACCOUNTING;

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/misc/write-errors was skipped on 'main' but is now failing.

@oech3
oech3 marked this pull request as ready for review March 14, 2026 10:10
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/misc/io-errors. tests/misc/io-errors is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/tail-n0f. tests/tail/tail-n0f is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/cut/cut-huge-range is now passing!

@cakebaker
cakebaker merged commit de5e4f5 into uutils:main Mar 14, 2026
158 of 159 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

@oech3
oech3 deleted the patch-1 branch March 14, 2026 13:33
@oech3

oech3 commented Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

tried NetBSD cargo check with this:

   Compiling phf_generator v0.13.1
error[E0308]: mismatched types
   --> src/uucore/src/lib/features/uptime.rs:159:44
    |
159 |             .filter(|r| r.record_type() == BOOT_TIME)
    |                         ---------------    ^^^^^^^^^ expected `i16`, found `u16`
    |                         |
    |                         expected because this is `i16`
    |
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
    |
159 |             .filter(|r| r.record_type() == BOOT_TIME.try_into().unwrap())
    |                                                     ++++++++++++++++++++
error[E0308]: mismatched types
   --> src/uucore/src/lib/features/uptime.rs:306:32
    |
306 |         if ut.record_type() == USER_PROCESS {
    |            ----------------    ^^^^^^^^^^^^ expected `i16`, found `u16`
    |            |
    |            expected because this is `i16`
    |
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
    |
306 |         if ut.record_type() == USER_PROCESS.try_into().unwrap() {
    |                                            ++++++++++++++++++++
error[E0308]: mismatched types
   --> src/uucore/src/lib/features/utmpx.rs:213:9
    |
212 |     pub fn record_type(&self) -> i16 {
    |                                  --- expected `i16` because of return type
213 |         self.inner.ut_type
    |         ^^^^^^^^^^^^^^^^^^ expected `i16`, found `u16`
    |
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
    |
213 |         self.inner.ut_type.try_into().unwrap()
    |                           ++++++++++++++++++++
    Checking indicatif v0.18.4
    Checking crossbeam-deque v0.8.6
error[E0609]: no field `ut_user` on type `libc::utmpx`
   --> src/uucore/src/lib/features/utmpx.rs:225:34
    |
225 |         chars2string!(self.inner.ut_user)
    |                                  ^^^^^^^ unknown field
    |
    = note: available fields are: `ut_name`, `ut_id`, `ut_line`, `ut_host`, `ut_session` ... and 5 others
error[E0308]: mismatched types
   --> src/uucore/src/lib/features/utmpx.rs:267:58
    |
267 |         !self.user().is_empty() && self.record_type() == USER_PROCESS
    |                                    ------------------    ^^^^^^^^^^^^ expected `i16`, found `u16`
    |                                    |
    |                                    expected because this is `i16`
    |
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
    |
267 |         !self.user().is_empty() && self.record_type() == USER_PROCESS.try_into().unwrap()

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants