Skip to content

Commit ec179e2

Browse files
committed
Whoops, too stringent with the __builtin__ regex
It was skipping over structs, modules & consts that weren't builtin, thereby messing up the count
1 parent 9fe84a4 commit ec179e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sus-proc-macro/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ pub fn get_builtin_type(token_stream: TokenStream) -> TokenStream {
9898

9999
let stl_text = get_standard_library_text();
100100

101-
let re = Regex::new(r"__builtin__\s+struct\s+([a-zA-Z0-9_]+)\s*(?:#\(.*\))?\s*\{").unwrap();
101+
let re = Regex::new(r"struct\s+([a-zA-Z0-9_]+)\s*(?:#\(.*\))?\s*\{").unwrap();
102102

103103
if let Some(idx) = re.captures_iter(&stl_text).position(|c| {
104104
let (_full, [found_name]) = c.extract();
@@ -125,7 +125,7 @@ pub fn get_builtin_const(token_stream: TokenStream) -> TokenStream {
125125

126126
let stl_text = get_standard_library_text();
127127

128-
let re = Regex::new(r"__builtin__\s+const\s+.+\s+([a-zA-Z0-9_]+)\s*(?:#\(.*\))?\s*\{").unwrap();
128+
let re = Regex::new(r"const\s+.+\s+([a-zA-Z0-9_]+)\s*(?:#\(.*\))?\s*\{").unwrap();
129129

130130
if let Some(idx) = re.captures_iter(&stl_text).position(|c| {
131131
let (_full, [found_name]) = c.extract();

0 commit comments

Comments
 (0)