Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct ND(u8);
- impl Drop for ND {
- fn drop(&mut self) {
- dbg!(self.0);
- }
- }
- impl ND {
- fn foo(&self) -> u8 {
- self.0
- }
- }
- macro_rules! format2 {
- ($($arg:tt)*) => {{
- let res = std::fmt::format(core::format_args!($($arg)*));
- res
- }}
- }
- fn main() {
- match format2!("{}", ND(0).foo()) {
- _ => dbg!("foo"),
- };
- dbg!();
- match format!("{}", ND(0).foo()) {
- _ => dbg!("bar"),
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement