Skip to content

Support freestanding functions in library macro #17

@dtolnay

Description

@dtolnay

The reflect::library! macro currently only accepts functions as trait functions or associated functions. We'll also need to work with free functions like str::from_utf8 that are not part of a trait or impl block.

reflect::library! {
    extern crate std {
        mod str {
            fn from_utf8(&[u8]) -> Result<&str, Utf8Error>
        }
    }
}
let result = RUNTIME::std::str::from_utf8.INVOKE(bytes);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions