From 01eb37cb0efef18650d9a4aeef9f4baadcd367d7 Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Wed, 5 Aug 2026 09:15:25 +0300 Subject: [PATCH] Reorder the methods in `#[rustc_must_implement_one_of]` So that their order will be the preferred order for implementations (assuming implementing `read_buf()` is better), like @joshtriplett said in https://github.com/rust-lang/rust/pull/106643#issuecomment-5187934543. --- library/alloc/src/io/read.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/alloc/src/io/read.rs b/library/alloc/src/io/read.rs index 1fe8417d90761..58d3e7005f288 100644 --- a/library/alloc/src/io/read.rs +++ b/library/alloc/src/io/read.rs @@ -84,7 +84,7 @@ use crate::vec::Vec; #[stable(feature = "rust1", since = "1.0.0")] #[doc(notable_trait)] #[cfg_attr(not(test), rustc_diagnostic_item = "IoRead")] -#[rustc_must_implement_one_of(read, read_buf)] +#[rustc_must_implement_one_of(read_buf, read)] // Keep this order, it's important for rust-analyzer (the preferred-to-implement method should come first). pub trait Read { /// Pull some bytes from this source into the specified buffer, returning /// how many bytes were read.