Skip to content

Functions mutated to return constant with NonZero return value are always unviable #570

@sandersaares

Description

@sandersaares

fn foo() -> NonZero<usize> is mutaned to return a constant like NonZero::new(1) which will never compile because NonZero::new() returns an Option<NonZero<_>>. It needs an .unwrap() there!

Not sure how smart the type-specific mutation mechanism is but adding an .unwrap() for NonZero types could suddenly make a lot more mutants viable.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggeneratePatterns of mutation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions