2025-02-08 19:45:40 -08:00
|
|
|
//@ compile-flags: -Copt-level=3
|
2018-08-20 11:13:45 -04:00
|
|
|
|
2018-08-19 06:07:04 -04: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 13:19:17 -05: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 06:07:04 -04:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
|
|
pub fn foo(t: &Rc<Vec<usize>>) {
|
2024-05-29 14:11:20 +10:00
|
|
|
// CHECK-NOT: __rust_dealloc
|
2018-08-19 06:07:04 -04:00
|
|
|
drop(t.clone());
|
|
|
|
|
}
|