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

facet-rs / facet / 16523647233

25 Jul 2025 01:52PM UTC coverage: 54.208% (-7.2%) from 61.427%
16523647233

push

github

fasterthanlime
Explode workspace

Closes #858

4773 of 8805 relevant lines covered (54.21%)

34.56 hits per line

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

0.0
/facet-core/src/types/ty/pointer.rs
1
use crate::FunctionPointerDef;
2

3
use super::Shape;
4

5
/// Describes all pointer types
6
#[derive(Clone, Copy, Debug)]
7
#[repr(C)]
8
pub enum PointerType {
9
    /// Describees bound const and mut references (`&`/`&mut`)
10
    Reference(ValuePointerType),
11
    /// Describes raw pointers
12
    ///
13
    /// Dereferencing invalid raw pointers may lead to undefined behavior
14
    Raw(ValuePointerType),
15
    /// Describes function pointers
16
    Function(FunctionPointerDef),
17
}
18

19
/// Describes the raw/reference pointer
20
#[derive(Clone, Copy, Debug)]
21
#[repr(C)]
22
pub struct ValuePointerType {
23
    /// Is the pointer mutable or not.
24
    pub mutable: bool,
25

26
    /// Describes whether the pointer is wider or not
27
    ///
28
    /// Note: if the pointer is wide, then the `target` shape will have `ShapeLayout::Unsized`, and
29
    /// the vtables of the target shape will expect the pointer to _this_ pointer, rather than the
30
    /// resulting address of unsized data. This is because wide pointer's metadata information is
31
    /// an undefined implementation detail, at this current moment.
32
    ///
33
    /// See: <https://github.com/rust-lang/rust/issues/81513>
34
    pub wide: bool,
35

36
    /// Shape of the pointer's pointee
37
    ///
38
    /// This needs to be indirect (behind a function), in order to allow recursive types without
39
    /// overflowing the const-eval system.
40
    pub target: fn() -> &'static Shape,
41
}
42

43
impl ValuePointerType {
44
    /// Returns the shape of the pointer's pointee.
45
    #[inline]
46
    pub fn target(&self) -> &'static Shape {
×
47
        (self.target)()
×
48
    }
×
49
}
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