better debug messages

This commit is contained in:
Folkert 2022-04-08 19:51:20 +02:00
parent ffd4566c29
commit 4dafe08544
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -2466,7 +2466,10 @@ fn foo<'a>(
(info, parse_state)
}
Ok(_) => panic!("invalid header format for builtin module"),
Err(e) => todo!(),
Err(e) => panic!(
"Hit a parse error in the header of {:?}:\n{:?}",
filename, e
),
}
}
@ -4145,10 +4148,15 @@ fn add_def_to_module<'a>(
arguments: loc_args,
loc_body,
captured_symbols,
name,
..
}) => {
// this is a top-level definition, it should not capture anything
debug_assert!(captured_symbols.is_empty());
debug_assert!(
captured_symbols.is_empty(),
"{:?}",
(symbol, name, symbol.module_id(), &captured_symbols)
);
// If this is an exposed symbol, we need to
// register it as such. Otherwise, since it