Skip to main content

announce_std/
fmt.rs

1//! announce mocks of `fmt` traits. Generated from newer-type-std's copies.
2
3#[allow(unused_imports)]
4use announce::announce;
5
6/// announce mock of [`::core::fmt::Display`]: invoke `Display!` to receive its definition.
7///
8/// The real trait is re-exported under the same path.
9#[announce(mock = ::core::fmt::Display)]
10pub trait Display {
11    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
12}
13
14#[doc(no_inline)]
15pub use ::core::fmt::Display;
16
17/// announce mock of [`::core::fmt::Debug`]: invoke `Debug!` to receive its definition.
18///
19/// The real trait is available under the same path in the type namespace
20/// (from rustc 1.94, through a glob re-export, since the macro namespace holds this
21/// trampoline).
22#[announce(mock = ::core::fmt::Debug)]
23pub trait Debug {
24    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
25}
26
27#[cfg(not(announce_std_rust_1_94))]
28/// Fallback for rustc < 1.94: a blanket subtrait of [`::core::fmt::Debug`], usable in bounds.
29pub trait Debug: ::core::fmt::Debug {}
30#[cfg(not(announce_std_rust_1_94))]
31impl<__T: ?::core::marker::Sized + ::core::fmt::Debug> Debug for __T {}
32
33/// announce mock of [`::core::fmt::Binary`]: invoke `Binary!` to receive its definition.
34///
35/// The real trait is re-exported under the same path.
36#[announce(mock = ::core::fmt::Binary)]
37pub trait Binary {
38    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
39}
40
41#[doc(no_inline)]
42pub use ::core::fmt::Binary;
43
44/// announce mock of [`::core::fmt::Octal`]: invoke `Octal!` to receive its definition.
45///
46/// The real trait is re-exported under the same path.
47#[announce(mock = ::core::fmt::Octal)]
48pub trait Octal {
49    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
50}
51
52#[doc(no_inline)]
53pub use ::core::fmt::Octal;
54
55/// announce mock of [`::core::fmt::LowerHex`]: invoke `LowerHex!` to receive its definition.
56///
57/// The real trait is re-exported under the same path.
58#[announce(mock = ::core::fmt::LowerHex)]
59pub trait LowerHex {
60    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
61}
62
63#[doc(no_inline)]
64pub use ::core::fmt::LowerHex;
65
66/// announce mock of [`::core::fmt::UpperHex`]: invoke `UpperHex!` to receive its definition.
67///
68/// The real trait is re-exported under the same path.
69#[announce(mock = ::core::fmt::UpperHex)]
70pub trait UpperHex {
71    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
72}
73
74#[doc(no_inline)]
75pub use ::core::fmt::UpperHex;
76
77/// announce mock of [`::core::fmt::LowerExp`]: invoke `LowerExp!` to receive its definition.
78///
79/// The real trait is re-exported under the same path.
80#[announce(mock = ::core::fmt::LowerExp)]
81pub trait LowerExp {
82    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
83}
84
85#[doc(no_inline)]
86pub use ::core::fmt::LowerExp;
87
88/// announce mock of [`::core::fmt::UpperExp`]: invoke `UpperExp!` to receive its definition.
89///
90/// The real trait is re-exported under the same path.
91#[announce(mock = ::core::fmt::UpperExp)]
92pub trait UpperExp {
93    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
94}
95
96#[doc(no_inline)]
97pub use ::core::fmt::UpperExp;
98
99/// announce mock of [`::core::fmt::Pointer`]: invoke `Pointer!` to receive its definition.
100///
101/// The real trait is re-exported under the same path.
102#[announce(mock = ::core::fmt::Pointer)]
103pub trait Pointer {
104    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result;
105}
106
107#[doc(no_inline)]
108pub use ::core::fmt::Pointer;
109
110/// announce mock of [`::core::fmt::Write`]: invoke `Write!` to receive its definition.
111///
112/// The real trait is re-exported under the same path.
113#[announce(mock = ::core::fmt::Write)]
114pub trait Write {
115    fn write_str(&mut self, s: &::core::primitive::str) -> ::core::fmt::Result;
116    fn write_char(&mut self, c: ::core::primitive::char) -> ::core::fmt::Result {
117        ::core::unimplemented!()
118    }
119    fn write_fmt(&mut self, args: ::core::fmt::Arguments<'_>) -> ::core::fmt::Result {
120        ::core::unimplemented!()
121    }
122}
123
124#[doc(no_inline)]
125pub use ::core::fmt::Write;
126
127// Real traits whose name is also a derive macro: explicit names shadow glob
128// imports per namespace, so this glob supplies the *trait* while the announce
129// trampoline above keeps the *macro* namespace. Before rustc 1.94 the glob
130// breaks the trampoline's resolution, so it is only emitted from 1.94 on.
131#[cfg(announce_std_rust_1_94)]
132#[doc(hidden)]
133pub mod __real {
134
135    pub use ::core::fmt::Debug;
136}
137#[cfg(announce_std_rust_1_94)]
138#[doc(no_inline)]
139pub use self::__real::*;