]> git.lizzy.rs Git - rust.git/blob - tests/codegen/issue-13018.rs
Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum
[rust.git] / tests / codegen / issue-13018.rs
1 // compile-flags: -O
2
3 // A drop([...].clone()) sequence on an Rc should be a no-op
4 // In particular, no call to __rust_dealloc should be emitted
5 #![crate_type = "lib"]
6 use std::rc::Rc;
7
8 pub fn foo(t: &Rc<Vec<usize>>) {
9 // CHECK-NOT: __rust_dealloc
10     drop(t.clone());
11 }