MCPcopy Create free account
hub / github.com/carllerche/assert-struct / generate_error_push

Function generate_error_push

assert-struct-macros/src/expand.rs:803–813  ·  view source on GitHub ↗

Generate the error context creation and push code

(
    span: proc_macro2::Span,
    actual_value: TokenStream,
    expected_value: TokenStream,
    node_id: usize,
)

Source from the content-addressed store, hash-verified

801
802/// Generate the error context creation and push code
803fn generate_error_push(
804 span: proc_macro2::Span,
805 actual_value: TokenStream,
806 expected_value: TokenStream,
807 node_id: usize,
808) -> TokenStream {
809 let node_ident = expand_pattern_node_ident(node_id);
810 quote_spanned! {span=>
811 __report.push(&#node_ident, #actual_value, #expected_value);
812 }
813}

Callers 11

expand_struct_assertionFunction · 0.85
expand_enum_assertionFunction · 0.85
expand_range_assertionFunction · 0.85
expand_string_assertionFunction · 0.85
expand_simple_assertionFunction · 0.85
expand_slice_assertionFunction · 0.85
expand_regex_assertionFunction · 0.85
expand_like_assertionFunction · 0.85
expand_closure_assertionFunction · 0.85
expand_map_assertionFunction · 0.85

Calls 1

Tested by

no test coverage detected