]> git.lizzy.rs Git - rust.git/blob - tests/ui/test-attrs/issue-52557.rs
Rollup merge of #106783 - WaffleLapkin:break-my-ident, r=wesleywiser
[rust.git] / tests / ui / test-attrs / 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 }