2025-02-09 03:45:40 +00:00
|
|
|
//@ compile-flags: -Copt-level=3
|
2018-08-20 15:13:45 +00:00
|
|
|
|
2018-08-19 10:07:04 +00:00
|
|
|
// A drop([...].clone()) sequence on an Rc should be a no-op
|
|
|
|
// In particular, no call to __rust_dealloc should be emitted
|
2024-11-23 18:19:17 +00:00
|
|
|
//
|
|
|
|
// We use a cdylib since it's a leaf unit for Rust purposes, so doesn't codegen -Zshare-generics
|
|
|
|
// code.
|
|
|
|
#![crate_type = "cdylib"]
|
2018-08-19 10:07:04 +00:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
pub fn foo(t: &Rc<Vec<usize>>) {
|
2024-05-29 04:11:20 +00:00
|
|
|
// CHECK-NOT: __rust_dealloc
|
2018-08-19 10:07:04 +00:00
|
|
|
drop(t.clone());
|
|
|
|
}
|