docs

#E0033: 無效的重新匯出

pub use 違反了規則:它比所重新匯出的項目更公開、它重新匯出了巨集,或重新匯出形成循環。讓項目與重新匯出一樣可見,或修改重新匯出。

nabi
pub use inner::helper;

mod inner {
    fn helper() -> i32 { 1 }
}
error[E0033]: `inner::helper` is private but re-exported as `pub` - a re-export can't be wider than its item
  --> main.nabi:1:9
   |
 1 | pub use inner::helper;
   |         ^^^^^

讓項目與重新匯出一樣可見:

nabi
pub use inner::helper;

mod inner {
    pub fn helper() -> i32 { 1 }
}
println(f"{helper()}");
1

相關錯誤碼:E0034 項目是私有的、E0030 無法解析的匯入

發現錯誤? 在 GitHub 上編輯此頁 最後更新: