2023-04-20 10:19:36 -05:00
|
|
|
//@aux-build:proc_macros.rs:proc-macro
|
2019-12-24 09:59:35 -06:00
|
|
|
#![warn(clippy::mem_replace_with_default)]
|
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::{external, inline_macros};
|
2019-12-24 09:59:35 -06:00
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
#[inline_macros]
|
2019-12-24 09:59:35 -06:00
|
|
|
fn main() {
|
2023-03-07 08:40:55 -06:00
|
|
|
let s = &mut String::from("foo");
|
|
|
|
inline!(std::mem::replace($s, Default::default()));
|
|
|
|
external!(std::mem::replace($s, Default::default()));
|
2019-12-24 09:59:35 -06:00
|
|
|
}
|