rust/tests/codegen/issues/issue-13018.rs
Mark Rousskov 4a216a25d1 Share inline(never) generics across crates
This reduces code sizes and better respects programmer intent when
marking inline(never). Previously such a marking was essentially ignored
for generic functions, as we'd still inline them in remote crates.
2024-11-28 13:43:05 -05:00

15 lines
388 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
//
// We use a cdylib since it's a leaf unit for Rust purposes, so doesn't codegen -Zshare-generics
// code.
#![crate_type = "cdylib"]
use std::rc::Rc;
pub fn foo(t: &Rc<Vec<usize>>) {
// CHECK-NOT: __rust_dealloc
drop(t.clone());
}