diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-02 13:08:53 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-11-02 13:08:53 +0000 |
commit | 731b38fa3c1694648e6c8e60f61820f9783343eb (patch) | |
tree | b3f4e94e8eac9bb24296aacafacb100930bee59e /crates/hir_def/src/lib.rs | |
parent | 6507877e7039d4517682a4fc232356662f509d81 (diff) | |
parent | b6101184537b1165cfdd5fc473e04ad4c5b7bffa (diff) |
Merge #6438
6438: Deny unreachable-pub r=matklad a=matklad
It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!
Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_def/src/lib.rs')
-rw-r--r-- | crates/hir_def/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_def/src/lib.rs b/crates/hir_def/src/lib.rs index f24a1dd77..1b22d1eec 100644 --- a/crates/hir_def/src/lib.rs +++ b/crates/hir_def/src/lib.rs | |||
@@ -486,12 +486,12 @@ impl AsMacroCall for InFile<&ast::MacroCall> { | |||
486 | /// Helper wrapper for `AstId` with `ModPath` | 486 | /// Helper wrapper for `AstId` with `ModPath` |
487 | #[derive(Clone, Debug, Eq, PartialEq)] | 487 | #[derive(Clone, Debug, Eq, PartialEq)] |
488 | struct AstIdWithPath<T: ast::AstNode> { | 488 | struct AstIdWithPath<T: ast::AstNode> { |
489 | pub ast_id: AstId<T>, | 489 | ast_id: AstId<T>, |
490 | pub path: path::ModPath, | 490 | path: path::ModPath, |
491 | } | 491 | } |
492 | 492 | ||
493 | impl<T: ast::AstNode> AstIdWithPath<T> { | 493 | impl<T: ast::AstNode> AstIdWithPath<T> { |
494 | pub fn new(file_id: HirFileId, ast_id: FileAstId<T>, path: path::ModPath) -> AstIdWithPath<T> { | 494 | fn new(file_id: HirFileId, ast_id: FileAstId<T>, path: path::ModPath) -> AstIdWithPath<T> { |
495 | AstIdWithPath { ast_id: AstId::new(file_id, ast_id), path } | 495 | AstIdWithPath { ast_id: AstId::new(file_id, ast_id), path } |
496 | } | 496 | } |
497 | } | 497 | } |