aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/mbe_expander
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-11-02 12:13:32 +0000
committerAleksey Kladov <[email protected]>2020-11-02 13:07:08 +0000
commitb6101184537b1165cfdd5fc473e04ad4c5b7bffa (patch)
treebcc2efd8a2696840a4724ad88758e973ecb77157 /crates/mbe/src/mbe_expander
parente7f90866bcf4b04a11e958eda0ac53f7ff0a607b (diff)
Deny unreachable-pub
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.
Diffstat (limited to 'crates/mbe/src/mbe_expander')
-rw-r--r--crates/mbe/src/mbe_expander/matcher.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs
index b698b9832..39a8eefbd 100644
--- a/crates/mbe/src/mbe_expander/matcher.rs
+++ b/crates/mbe/src/mbe_expander/matcher.rs
@@ -61,16 +61,16 @@ macro_rules! err {
61 61
62#[derive(Debug, Default)] 62#[derive(Debug, Default)]
63pub(super) struct Match { 63pub(super) struct Match {
64 pub bindings: Bindings, 64 pub(super) bindings: Bindings,
65 /// We currently just keep the first error and count the rest to compare matches. 65 /// We currently just keep the first error and count the rest to compare matches.
66 pub err: Option<ExpandError>, 66 pub(super) err: Option<ExpandError>,
67 pub err_count: usize, 67 pub(super) err_count: usize,
68 /// How many top-level token trees were left to match. 68 /// How many top-level token trees were left to match.
69 pub unmatched_tts: usize, 69 pub(super) unmatched_tts: usize,
70} 70}
71 71
72impl Match { 72impl Match {
73 pub fn add_err(&mut self, err: ExpandError) { 73 pub(super) fn add_err(&mut self, err: ExpandError) {
74 let prev_err = self.err.take(); 74 let prev_err = self.err.take();
75 self.err = prev_err.or(Some(err)); 75 self.err = prev_err.or(Some(err));
76 self.err_count += 1; 76 self.err_count += 1;