1 /// Only named projected types can be imported.
2 /// See import_unnamed.rs for unnamed projected types.
3 
4 mod pub_ {
5     use pin_project::pin_project;
6 
7     #[pin_project(project = DProj, project_ref = DProjRef)]
8     pub struct Default(());
9 
10     #[pin_project(project = RProj, project_ref = RProjRef, project_replace = RProjOwn)]
11     pub struct Replace(());
12 }
13 pub mod pub_use {
14     #[rustfmt::skip]
15     pub use crate::pub_::DProj; //~ ERROR E0365
16     #[rustfmt::skip]
17     pub use crate::pub_::DProjRef; //~ ERROR E0365
18     #[rustfmt::skip]
19     pub use crate::pub_::RProj; //~ ERROR E0365
20     #[rustfmt::skip]
21     pub use crate::pub_::RProjOwn; //~ ERROR E0365
22     #[rustfmt::skip]
23     pub use crate::pub_::RProjRef; //~ ERROR E0365
24 
25     // Confirm that the visibility of the original type is not changed.
26     pub use crate::pub_::{Default, Replace};
27 }
28 pub mod pub_use2 {
29     // Ok
30     #[allow(unused_imports)]
31     pub(crate) use crate::pub_::{DProj, DProjRef, RProj, RProjOwn, RProjRef};
32 }
33 
34 mod pub_crate {
35     use pin_project::pin_project;
36 
37     #[pin_project(project = DProj, project_ref = DProjRef)]
38     pub(crate) struct Default(());
39 
40     #[pin_project(project = RProj, project_ref = RProjRef, project_replace = RProjOwn)]
41     pub(crate) struct Replace(());
42 }
43 pub mod pub_crate_use {
44     // Ok
45     #[allow(unused_imports)]
46     pub(crate) use crate::pub_crate::{DProj, DProjRef, RProj, RProjOwn, RProjRef};
47 }
48 
main()49 fn main() {}
50