blob: 274942f9379f49c55e74f920564a3d6c89c6644c [file] [log] [blame] [edit]
//@ check-pass
#![allow(unused)]
// Test if `Expr::can_have_side_effects` considers element of repeat expressions.
fn drop_repeat_in_arm_body() {
// Built-in lint `dropping_copy_types` relies on `Expr::can_have_side_effects`
// (See rust-clippy#9482 and rust#113231)
match () {
() => drop([0; 1]), // No side effects
//~^ WARNING calls to `std::mem::drop` with a value that implements `Copy` does nothing
}
match () {
() => drop([return; 1]), // Definitely has side effects
}
}
fn main() {}