rust/tests/codegen/issues/issue-13018.rs
2023-03-20 10:25:29 +00:00

12 lines
271 B
Rust

// compile-flags: -O
// A drop([...].clone()) sequence on an Rc should be a no-op
// In particular, no call to __rust_dealloc should be emitted
#![crate_type = "lib"]
use std::rc::Rc;
pub fn foo(t: &Rc<Vec<usize>>) {
// CHECK-NOT: __rust_dealloc
drop(t.clone());
}