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.
This commit is contained in:
Chayim Refael Friedman
2026-08-05 09:15:25 +03:00
parent 7218ebe936
commit 01eb37cb0e

View File

@@ -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.