1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
use super::*;
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(Copy, Clone)]
pub struct _private_TypeLayoutDerive {
pub shared_vars: &'static SharedVars,
pub mono: &'static MonoTypeLayout,
pub abi_consts:AbiConsts,
pub data: GenericTLData,
pub tag:Option<&'static Tag>,
pub extra_checks:Option<&'static ManuallyDrop<StoredExtraChecks>>,
}
#[allow(non_camel_case_types)]
#[doc(hidden)]
#[derive(Copy, Clone)]
pub struct _private_MonoTypeLayoutDerive {
pub name: RStr<'static>,
pub item_info:ItemInfo,
pub data: MonoTLData,
pub generics: CompGenericParams,
pub repr_attr:ReprAttr,
pub mod_refl_mode:ModReflMode,
pub phantom_fields:RSlice<'static,CompTLFieldRepr>,
pub shared_vars:MonoSharedVars,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq,StableAbi)]
#[sabi(unsafe_sabi_opaque_fields)]
pub struct ItemInfo{
package_and_version:RStr<'static>,
pub line:u32,
pub mod_path:ModPath,
}
impl ItemInfo{
#[doc(hidden)]
pub const fn new(
package_and_version:&'static str,
line:u32,
mod_path:ModPath,
)->Self{
Self{
package_and_version:RStr::from_str(package_and_version),
line,
mod_path,
}
}
pub const fn primitive()->Self{
Self{
package_and_version: RStr::from_str("std;1.0.0"),
line:0,
mod_path:ModPath::PRELUDE,
}
}
pub const fn std_type_in(mod_path:NulStr<'static>)->Self{
Self{
package_and_version: RStr::from_str("std;1.0.0"),
line:0,
mod_path:ModPath::inside(mod_path),
}
}
pub const fn package_and_mod(
package_and_version:&'static str,
mod_path:NulStr<'static>
)->Self{
Self{
package_and_version:RStr::from_str(package_and_version),
line:0,
mod_path:ModPath::inside(mod_path),
}
}
pub fn package_and_version(&self)->(&'static str,&'static str){
let pav=self.package_and_version.as_str();
match pav.find(';') {
Some(separator)=>{
(&pav[..separator],&pav[(separator+1)..])
}
None=>{
(&pav[..],"")
}
}
}
pub fn package(&self)->&'static str{
self.package_and_version().0
}
pub fn version(&self)->&'static str{
self.package_and_version().1
}
}