We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c8618f commit 589db1fCopy full SHA for 589db1f
library/core/src/macros/mod.rs
@@ -474,6 +474,23 @@ macro_rules! r#try {
474
/// }
475
/// ```
476
///
477
+/// If you also need the trait names themselves, such as to implement one or both on your types,
478
+/// import the containing module and then name them with a prefix:
479
+///
480
+/// ```
481
+/// # #![allow(unused_imports)]
482
+/// use std::fmt::{self, Write as _};
483
+/// use std::io::{self, Write as _};
484
485
+/// struct Example;
486
487
+/// impl fmt::Write for Example {
488
+/// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
489
+/// unimplemented!();
490
+/// }
491
492
493
494
/// Note: This macro can be used in `no_std` setups as well.
495
/// In a `no_std` setup you are responsible for the implementation details of the components.
496
0 commit comments