2022-05-03 06:46:25 +09:00
|
|
|
// compile-flags: --test
|
|
|
|
|
|
|
|
#![deny(unused_imports)]
|
|
|
|
|
|
|
|
use std::io::BufRead; //~ ERROR unused import: `std::io::BufRead`
|
|
|
|
|
|
|
|
fn a() {}
|
|
|
|
fn b() {}
|
|
|
|
|
|
|
|
mod test {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod tests {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod test_a {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod a_test {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod tests_a {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod a_tests {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod fastest_search {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod test_has_attr {
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod test_has_no_attr {
|
|
|
|
#[cfg(test)]
|
2022-07-08 10:16:28 +09:00
|
|
|
use super::a;
|
2022-05-03 06:46:25 +09:00
|
|
|
|
2022-07-08 10:16:28 +09:00
|
|
|
#[test]
|
2022-05-03 06:46:25 +09:00
|
|
|
fn foo() {
|
2022-07-08 10:16:28 +09:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-03 06:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|