mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
13 lines
326 B
Rust
13 lines
326 B
Rust
// aux-build:proc_macros.rs
|
|
#![warn(clippy::mem_replace_with_default)]
|
|
|
|
extern crate proc_macros;
|
|
use proc_macros::{external, inline_macros};
|
|
|
|
#[inline_macros]
|
|
fn main() {
|
|
let s = &mut String::from("foo");
|
|
inline!(std::mem::replace($s, Default::default()));
|
|
external!(std::mem::replace($s, Default::default()));
|
|
}
|