mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
12 lines
342 B
Rust
12 lines
342 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");
|
|
let _ = inline!(std::mem::replace($s, Default::default()));
|
|
let _ = external!(std::mem::replace($s, Default::default()));
|
|
}
|