2022-05-02 16:46:25 -05: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-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod tests {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod test_a {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod a_test {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod tests_a {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod a_tests {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod fastest_search {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod test_has_attr {
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mod test_has_no_attr {
|
|
|
|
#[cfg(test)]
|
2022-07-07 20:16:28 -05:00
|
|
|
use super::a;
|
2022-05-02 16:46:25 -05:00
|
|
|
|
2022-07-07 20:16:28 -05:00
|
|
|
#[test]
|
2022-05-02 16:46:25 -05:00
|
|
|
fn foo() {
|
2022-07-07 20:16:28 -05:00
|
|
|
a();
|
|
|
|
use crate::b; //~ ERROR unused import: `crate::b`
|
2022-05-02 16:46:25 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|