MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / custom_error

Function custom_error

src/debug_utils/generic_reginfo/parse.rs:35–42  ·  view source on GitHub ↗

Helper function to emit a custom error at the given span.

(span: Span<'_>, msg: &str)

Source from the content-addressed store, hash-verified

33
34/// Helper function to emit a custom error at the given span.
35fn custom_error(span: Span<'_>, msg: &str) -> Error<Rule> {
36 Error::new_from_span(
37 ErrorVariant::<Rule>::CustomError {
38 message: msg.into(),
39 },
40 span,
41 )
42}
43
44fn parse_number<T: FromStr>(pair: Pair<'_, Rule>) -> Result<T> {
45 Ok(pair.as_str().parse().map_err(|_| {

Callers 5

parse_numberFunction · 0.70
parse_expected_entityFunction · 0.70
parse_reg_group_listFunction · 0.70
parse_class_defFunction · 0.70
parse_bank_defFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected