2023-07-27 13:23:04 +00:00
|
|
|
//@aux-build:proc_macros.rs
|
2019-12-24 15:59:35 +00:00
|
|
|
#![warn(clippy::mem_replace_with_default)]
|
|
|
|
|
2023-03-07 14:40:55 +00:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::{external, inline_macros};
|
2019-12-24 15:59:35 +00:00
|
|
|
|
2023-03-07 14:40:55 +00:00
|
|
|
#[inline_macros]
|
2019-12-24 15:59:35 +00:00
|
|
|
fn main() {
|
2023-03-07 14:40:55 +00:00
|
|
|
let s = &mut String::from("foo");
|
2024-02-12 00:11:13 +00:00
|
|
|
let _ = inline!(std::mem::replace($s, Default::default()));
|
|
|
|
let _ = external!(std::mem::replace($s, Default::default()));
|
2019-12-24 15:59:35 +00:00
|
|
|
}
|