• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facet-rs / facet / 14418704003

12 Apr 2025 10:21AM UTC coverage: 32.235% (-0.3%) from 32.576%
14418704003

Pull #180

github

web-flow
Merge 284c76bcf into dbe94d500
Pull Request #180: Impl `Facet` for `Arc<T>`

18 of 83 new or added lines in 3 files covered. (21.69%)

98 existing lines in 3 files now uncovered.

2006 of 6223 relevant lines covered (32.24%)

13.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/facet-core/src/_trait/impls/smart_pointer_impls.rs
1
use core::alloc::Layout;
2

3
use crate::{
4
    ConstTypeId, Def, Facet, OpaqueConst, SmartPointerDef, SmartPointerFlags, SmartPointerVTable,
5
};
6

7
#[cfg(feature = "alloc")]
8
unsafe impl<T: Facet> Facet for alloc::sync::Arc<T> {
9
    const SHAPE: &'static crate::Shape = &const {
10
        crate::Shape::builder()
11
            .id(ConstTypeId::of::<Self>())
12
            .layout(Layout::new::<Self>())
13
            .def(Def::SmartPointer(
14
                SmartPointerDef::builder()
15
                    .t(T::SHAPE)
16
                    .flags(SmartPointerFlags::ATOMIC)
17
                    .known(Some(crate::KnownSmartPointer::Arc))
18
                    .vtable(
19
                        &const {
20
                            SmartPointerVTable::builder()
NEW
21
                                .borrow_fn(|opaque| {
×
NEW
22
                                    let ptr = Self::as_ptr(unsafe { opaque.as_ref() });
×
NEW
23
                                    OpaqueConst::new(ptr)
×
24
                                })
NEW
25
                                .new_into_fn(|this, ptr| {
×
NEW
26
                                    let t = unsafe { ptr.read::<T>() };
×
NEW
27
                                    let arc = alloc::sync::Arc::new(t);
×
NEW
28
                                    unsafe { this.put(arc) }
×
29
                                })
30
                                .build()
31
                        },
32
                    )
33
                    .build(),
34
            ))
35
            .build()
36
    };
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc