Skip to content

Mutations

Martin Pool edited this page Apr 24, 2022 · 2 revisions

Mutations generated by cargo-mutants

This doc is not yet complete.

General exclusions

Functions called new, and implementations of Default are skipped because it seems like there is often no other good way to create an instance.

Functions whose body is empty (aside from comments) are also skipped, because we don't have any way to change either their return value (unit) or their side effects (nothing).

Generated mutations

(See src/mutate.rs and src/visit.rs for the code that generates mutations.)

Function return type Mutations
() ()
bool true, false
String String::new, "xyzzy".to_string()
Result<_, > Ok(Default::default())
(anything else) Default::default()
Clone this wiki locally