From fdf93830c953213205b64ac8adda9e24cbce875a Mon Sep 17 00:00:00 2001 From: "Ming, Bai" Date: Thu, 4 Jan 2024 15:48:22 -0800 Subject: [PATCH] Fixed ambiguity in hint.rs Needle and haystack are actually not the same, they remain constant. --- library/core/src/hint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 4a73f160b65..5c44ca69451 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -287,7 +287,7 @@ pub fn spin_loop() { /// /// The compiler could theoretically make optimizations like the following: /// -/// - `needle` and `haystack` are always the same, move the call to `contains` outside the loop and +/// - The `needle` and `haystack` do not change, move the call to `contains` outside the loop and /// delete the loop /// - Inline `contains` /// - `needle` and `haystack` have values known at compile time, `contains` is always true. Remove