-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Given the following lib.rs
:
fn foo() {}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let x = [0u8];
assert_eq!((&x[..]).as_ref(), []);
}
}
Running cargo check --tests
succeeds. However, if we add an attribute, #[cfg_attr(test, mutagen::mutate)]
, to fn foo() {}
, then cargo check --tests
fails:
error[E0282]: type annotations needed
--> src/lib.rs:9:2
|
9 | assert_eq!((&x[..]).as_ref(), []);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Version information
Using Mutagen pulled from this repository at 94321e5.
$ cargo version
cargo 1.43.0-nightly (bda50510d 2020-03-02)
Metadata
Metadata
Assignees
Labels
No labels