Skip to content

wasm-snip --snip-rust-panicking-code should not target std::panicking::panicking() #133

@nwoods-cimpress

Description

@nwoods-cimpress

Motivation

std::panicking::panicking() is a simple function that checks to see if the current thread is panicking. Looking at the wasm-snip source code, it appears that this will be targeted by this pattern when --snip-rust-panicking-code is used:

options.patterns.push(r#".*std\.\.panicking\.\..*"#.into());

It is unfortunate because this function is called by std::thread::panicking(); a function extensively used by tokio

Proposed Solution

Omit this particular function from the patterns, or somehow snip this particular function to always return false

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions