Skip to content

fix: address compiler warnings across crates#356

Merged
filmil merged 4 commits into
google:mainfrom
clydegerber:fix/warnings-across-crates
Apr 29, 2026
Merged

fix: address compiler warnings across crates#356
filmil merged 4 commits into
google:mainfrom
clydegerber:fix/warnings-across-crates

Conversation

@clydegerber
Copy link
Copy Markdown
Contributor

Summary

  • rust_icu_udata: adds #[allow(dead_code)] to Rep::Buffer(Vec<u8>) — this variant intentionally keeps ICU's raw pointer alive and is never read directly
  • rust_icu_ucnv: fixes copy-paste bug in pivot buffer reset functions where pivot_to_target and pivot_from_target were each assigned to themselves instead of their respective start pointers
  • rust_icu_ucsdet: makes the anonymous lifetime explicit in detect() and detect_all() return types (CharsetMatchCharsetMatch<'_>)
  • rust_icu_common: adds #[allow(dead_code)] to the Type struct in the hygiene test, which exists solely to exercise simple_drop_impl! under #![no_implicit_prelude] and is never constructed

Test plan

  • CI passes with no compiler warnings

This commit was created by an automated coding assistant, with human supervision.

…alive field

Rep::Buffer(Vec<u8>) is never read, but exists solely to keep the buffer
alive while ICU holds a raw pointer to it via udata_setCommonData. Annotate
with #[allow(dead_code)] and document the intent to prevent the warning from
being mistaken for a bug.

This commit was created by an automated coding assistant, with human
supervision.
…tions

reset_to_utf8 and reset_from_utf8 contained a copy-paste error where
pivot_to_target and pivot_from_target were assigned to themselves instead
of being reset to the start of their respective pivot buffers. This left
the target pointer at its previous position after a reset, corrupting the
pivot buffer state for subsequent conversions.

This commit was created by an automated coding assistant, with human
supervision.
… return types

The detect() and detect_all() methods returned CharsetMatch without its
lifetime argument, while &self used the standard elided reference syntax.
Using two different notations for the same lifetime is now flagged by the
mismatched_lifetime_syntaxes lint. Annotate return types with CharsetMatch<'_>
for consistency.

This commit was created by an automated coding assistant, with human
supervision.
The Type struct in hygiene.rs exists solely to verify that simple_drop_impl!
expands correctly under #![no_implicit_prelude]. It is never constructed by
design, so annotate it with #[allow(dead_code)].

This commit was created by an automated coding assistant, with human
supervision.
@filmil
Copy link
Copy Markdown
Member

filmil commented Apr 29, 2026

These are fairly small changes so I'll review them together.

But, please, in the future, split separate fixes across PRs.

@filmil filmil merged commit aa2e95c into google:main Apr 29, 2026
14 checks passed
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