Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --I tried this code (while debugging): Where is the corresponding type from the crate (and everything else is my types). It has an associated function , which returns a 16-byte slice containing the UUID. Because the right-hand-side of the comparison is not a byte slice but an array, the two expressions can't be compared and I get error E0277, shown below. Of interest is the help message at the end, which has the correct solution, but proposes a fix with invalid syntax. It should suggest placing before . <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: I could not test on nightly, as I got a different compile error, apparently related to procedural macros: <details<summaryError</summary<p</p</details
For the error, see . Could you try to bump your version? Also, could you maybe provide either the full code or a smaller reproduction of the suggestion (if possible), I can't seem to reproduce the suggestion for your pattern on stable.
Thanks for the notice. I just bumped to and retried on nightly: Unfortunately the exact same misleading help message still appears. I managed to reproduce it here: The import or argument is actually necessary to cause the bug. If you remove both, the help message doesn't appear. Perhaps this is related to the crate, which I noticed uses a type alias called (), unrelated to .
Smaller repro but still requires dependency: Am investigating how to get rid of the dependency.
Repro without dependencies:

Discussion:
unsatisfied_const: bool, ) { let body_def_id = obligation.cause.body_id; <ins> let span = if let ObligationCauseCode::BinOp { rhs_span: Some(rhs_span), .. } = obligation.cause.code() { *rhs_span } else { span }; </ins> // Try to report a help message if is_fn_trait && let Ok((implemented_kind, params)) = self.type_implements_fn_trait(

candidate_impls: &[ImplCandidate<'tcx>], span: Span, ) { <del> // We can only suggest the slice coersion for function arguments since the suggestion // would make no sense in turbofish or call let ObligationCauseCode::FunctionArgumentObligation { .. } = obligation.cause.code() else { </del> <ins> // We can only suggest the slice coersion for function and binary operation arguments, // since the suggestion would make no sense in turbofish or call let (ObligationCauseCode::BinOp { .. } | ObligationCauseCode::FunctionArgumentObligation { .. }) = obligation.cause.code() else { </ins> return; };

<ins> // run-rustfix pub struct Bytes; impl Bytes { pub fn as_slice(&self) -> &[u8] { todo!() } } impl PartialEq<[u8]> for Bytes { fn eq(&self, other: &[u8]) -> bool { self.as_slice() == other } } impl PartialEq<Bytes> for &[u8] { fn eq(&self, other: &Bytes) -> bool { *other == **self } } fn main() { let _ = &[0u8] == &[0xAA][..]; //~ ERROR can't compare `&[u8; 1]` with `[{integer}; 1]` } </ins>

<ins> // run-rustfix pub struct Bytes; impl Bytes { pub fn as_slice(&self) -> &[u8] { todo!() } } impl PartialEq<[u8]> for Bytes { fn eq(&self, other: &[u8]) -> bool { self.as_slice() == other } } impl PartialEq<Bytes> for &[u8] { fn eq(&self, other: &Bytes) -> bool { *other == **self } } fn main() { let _ = &[0u8] == [0xAA]; //~ ERROR can't compare `&[u8; 1]` with `[{integer}; 1]` } </ins>

<ins> error[E0277]: can't compare `&[u8; 1]` with `[{integer}; 1]` --> $DIR/issue-113447.rs:24:20 | LL |     let _ = &[0u8] == [0xAA]; |                    ^^ no implementation for `&[u8; 1] == [{integer}; 1]` | = help: the trait `PartialEq<[{integer}; 1]>` is not implemented for `&[u8; 1]` = help: the following other types implement trait `PartialEq<Rhs>`: <[A; N] as PartialEq<[B; N]>> <[A; N] as PartialEq<[B]>> <[A; N] as PartialEq<&[B]>> <[A; N] as PartialEq<&mut [B]>> <[T] as PartialEq<Vec<U, A>>> <[A] as PartialEq<[B]>> <[B] as PartialEq<[A; N]>> <&[u8] as PartialEq<Bytes>> and 4 others help: convert the array to a `&[u8]` slice instead | LL |     let _ = &[0u8] == &[0xAA][..]; |                       +      ++++ error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>