File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed
src/tools/miri/tests/fail
tests/codegen-llvm/lib-optimizations Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ LL | let allocation_result = alloc.allocate(rc_layout.get());
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
77 = note: BACKTRACE:
8- = note: inside `alloc::raw_rc::allocate_uninit_raw_bytes::<std::alloc::Global>` at RUSTLIB/alloc/src/raw_rc/mod.rs:LL:CC
9- = note: inside `alloc::raw_rc::allocate_uninit_in::<std::alloc::Global, 1>` at RUSTLIB/alloc/src/raw_rc/mod.rs:LL:CC
10- = note: inside `alloc::raw_rc::allocate_uninit::<std::alloc::Global, 1>` at RUSTLIB/alloc/src/raw_rc/mod.rs:LL:CC
8+ = note: inside `alloc::raw_rc::rc_alloc:: allocate_uninit_raw_bytes::<std::alloc::Global>` at RUSTLIB/alloc/src/raw_rc/mod.rs:LL:CC
9+ = note: inside `alloc::raw_rc::rc_alloc:: allocate_uninit_in::<std::alloc::Global, 1>` at RUSTLIB/alloc/src/raw_rc/mod.rs:LL:CC
10+ = note: inside `alloc::raw_rc::rc_alloc:: allocate_uninit::<std::alloc::Global, 1>` at RUSTLIB/alloc/src/raw_rc/mod.rs:LL:CC
1111 = note: inside `alloc::raw_rc::raw_weak::RawWeak::<std::cell::RefCell<std::option::Option<Dummy>>, std::alloc::Global>::new_uninit::<TAG>` at RUSTLIB/alloc/src/raw_rc/raw_weak.rs:LL:CC
1212 = note: inside `alloc::raw_rc::raw_rc::RawRc::<std::cell::RefCell<std::option::Option<Dummy>>, std::alloc::Global>::new` at RUSTLIB/alloc/src/raw_rc/raw_rc.rs:LL:CC
1313 = note: inside `std::rc::Rc::<std::cell::RefCell<std::option::Option<Dummy>>>::new` at RUSTLIB/alloc/src/rc.rs:LL:CC
Original file line number Diff line number Diff line change 1+ //@ compile-flags: -O -Z merge-functions=disabled
2+
3+ #![ crate_type = "lib" ]
4+
5+ use std:: rc:: { self , Rc } ;
6+
7+ // Ensures that we can create array of `Weak`s using `memset`.
8+
9+ #[ no_mangle]
10+ pub fn array_of_rc_weak ( ) -> [ rc:: Weak < u32 > ; 100 ] {
11+ // CHECK-LABEL: @array_of_rc_weak(
12+ // CHECK-NEXT: start:
13+ // CHECK-NEXT: call void @llvm.memset.
14+ // CHECK-NEXT: ret void
15+ [ ( ) ; 100 ] . map ( |( ) | rc:: Weak :: new ( ) )
16+ }
17+
18+ // Ensures that we convert `&Option<Rc<T>>` to `Option<&T>` without checking for `None`.
19+
20+ #[ no_mangle]
21+ pub fn option_rc_as_deref_no_cmp ( rc : & Option < Rc < u32 > > ) -> Option < & u32 > {
22+ // CHECK-LABEL: @option_rc_as_deref_no_cmp(ptr
23+ // CHECK-NEXT: start:
24+ // CHECK-NEXT: %[[RC:.+]] = load ptr, ptr %rc
25+ // CHECK-NEXT: ret ptr %[[RC]]
26+ rc. as_deref ( )
27+ }
You can’t perform that action at this time.
0 commit comments