2023-08-24 19:32:12 +00:00
|
|
|
//@aux-build:proc_macros.rs
|
2019-12-24 15:59:35 +00:00
|
|
|
#![warn(clippy::mem_replace_with_default)]
|
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::{external, inline_macros};
|
2019-12-24 15:59:35 +00:00
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
#[inline_macros]
|
2019-12-24 15:59:35 +00:00
|
|
|
fn main() {
|
2023-03-24 13:04:35 +00:00
|
|
|
let s = &mut String::from("foo");
|
2024-02-27 14:25:18 +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
|
|
|
}
|