Open
Description
BUG
compile_fail
should not be ignored on test function.
Actual
compile_fail
is ignored on test function.
$ cargo test && echo OK
...
OK
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
/// ```compile_fail
/// let mut x = 5;
/// x += 2;
/// ```
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
Expected
compile_fail
should not be ignored on test function.
Same as on non-test function.
$ cargo test
...
Test compiled successfully, but it's marked `compile_fail`.
...
/// ```compile_fail
/// let mut x = 5;
/// x += 2;
/// ```
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
Version
-
rustc 1.73.0 (cc66ad4 2023-10-03)
-
cargo 1.73.0 (9c4383fb5 2023-08-26)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status