Skip to content

Commit

Permalink
more dead-code annotations
Browse files Browse the repository at this point in the history
Summary: 1.78.0 throws up this dead code. haven't investigated why but these occurrences only get flagged by the buck2-unsorted-mac test (e.g. https://www.internalfb.com/sandcastle/workflow/657525545598944430)

Reviewed By: ndmitchell, dtolnay

Differential Revision: D57212061

fbshipit-source-id: 87f5654150e935e424d4479c6bf35516d1490b03
  • Loading branch information
Shayne Fletcher authored and facebook-github-bot committed May 10, 2024
1 parent 471d4a4 commit ecdae5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions starlark/src/values/types/string/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::values::types::string::simd::Vector;

/// Check if any byte in the buffer is non-ASCII or need escape.
#[inline(always)]
#[allow(dead_code)]
unsafe fn chunk_non_ascii_or_need_escape<V: Vector>(chunk: V) -> bool {
#[allow(clippy::many_single_char_names)]
unsafe fn or4<V: Vector>(a: V, b: V, c: V, d: V) -> V {
Expand Down Expand Up @@ -124,6 +125,7 @@ pub(crate) fn string_repr(str: &str, buffer: &mut String) {
}

#[inline(always)]
#[allow(dead_code)] // FIXME: Investigate if this is really needed, fails on Mac.
unsafe fn loop_ascii_simd<V: Vector>(val: &str, buffer: &mut String) {
// `buffer` must have enough capacity to contain `val` if it does not need escaping
// followed by trailing double quote.
Expand Down
2 changes: 2 additions & 0 deletions starlark/src/values/types/string/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

/// Fixed length byte vector API.
#[allow(dead_code)] // FIXME: Investigate if this is really needed, fails on Mac
pub(crate) trait Vector: Copy {
/// Fill the vector with given byte value.
unsafe fn splat(byte: u8) -> Self;
Expand All @@ -42,6 +43,7 @@ where
/// This function is called when SIMD is not available.
fn no_simd(self) -> R;
/// This function is called when SIMD is available.
#[allow(dead_code)] // FIXME: Investigate if this is really needed, fails on Mac
fn simd<V: Vector>(self) -> R;

/// Call either `simd` or `no_simd` function.
Expand Down

0 comments on commit ecdae5a

Please sign in to comment.