fix: address compiler warnings across crates#356
Merged
Conversation
…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.
Member
|
These are fairly small changes so I'll review them together. But, please, in the future, split separate fixes across PRs. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rust_icu_udata: adds#[allow(dead_code)]toRep::Buffer(Vec<u8>)— this variant intentionally keeps ICU's raw pointer alive and is never read directlyrust_icu_ucnv: fixes copy-paste bug in pivot buffer reset functions wherepivot_to_targetandpivot_from_targetwere each assigned to themselves instead of their respectivestartpointersrust_icu_ucsdet: makes the anonymous lifetime explicit indetect()anddetect_all()return types (CharsetMatch→CharsetMatch<'_>)rust_icu_common: adds#[allow(dead_code)]to theTypestruct in the hygiene test, which exists solely to exercisesimple_drop_impl!under#![no_implicit_prelude]and is never constructedTest plan
This commit was created by an automated coding assistant, with human supervision.