rust/tests/codegen/issues/issue-13018.rs

12 lines
271 B
Rust
Raw Normal View History

// compile-flags: -O
2018-08-19 05:07:04 -05:00
// 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());
}