Skip to content

Attribute argument / function parameter amount mismatch: improve error message #12

@foresterre

Description

@foresterre

The following code will obvisouly fail, since our function has two inputs, but in our attribute, we only provide one.

        #[parameterized(input = {
            &["03579", "0", "1", "1"]
        })]
        fn should_fail(input: &[&str], expected: (u32, u32, u32, u32)) {
            let some: (u32, u32, u32, u32) = ParseInputsFromIter::parse(input).unwrap();
            assert_eq!(some, expected);
        }

it does fail (which is good), but the error states "this should never happen", while it can and isn't an unreachable error case.

        #[parameterized(input = {
            &["03579", "0", "1", "1"]
        })]
        fn should_fail(input: &[&str], expected: (u32, u32, u32, u32)) {
            let some: (u32, u32, u32, u32) = ParseInputsFromIter::parse(input).unwrap();
            assert_eq!(some, expected);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-uiArea: changes related specifically to the ui (such as how we report errors to the user)C-enhancementCategory: enhancements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions