File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -474,6 +474,23 @@ macro_rules! r#try {
474474/// }
475475/// ```
476476///
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+ ///
477494/// Note: This macro can be used in `no_std` setups as well.
478495/// In a `no_std` setup you are responsible for the implementation details of the components.
479496///
You can’t perform that action at this time.
0 commit comments