]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-52557.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / ui / issues / issue-52557.rs
1 // run-pass
2 #![allow(unused_imports)]
3 // This test checks for namespace pollution by private tests.
4 // Tests used to marked as public causing name conflicts with normal
5 // functions only in test builds.
6
7 // compile-flags: --test
8
9 mod a {
10     pub fn foo() -> bool {
11         true
12     }
13 }
14
15 mod b {
16     #[test]
17     fn foo() {
18         local_name(); // ensure the local name still works
19     }
20
21     #[test]
22     fn local_name() {}
23 }
24
25 use a::*;
26 use b::*;
27
28 pub fn conflict() {
29     let _: bool = foo();
30 }