2023-07-27 08:23:04 -05:00
|
|
|
//@aux-build:proc_macros.rs
|
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");
|
2024-02-11 18:11:13 -06:00
|
|
|
let _ = inline!(std::mem::replace($s, Default::default()));
|
|
|
|
let _ = external!(std::mem::replace($s, Default::default()));
|
2019-12-24 09:59:35 -06:00
|
|
|
}
|