2023-07-02 07:35:19 -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-24 08:04:35 -05:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::{external, inline_macros};
|
2019-12-24 09:59:35 -06:00
|
|
|
|
2023-03-24 08:04:35 -05:00
|
|
|
#[inline_macros]
|
2019-12-24 09:59:35 -06:00
|
|
|
fn main() {
|
2023-03-24 08:04:35 -05: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
|
|
|
}
|