Skip to content

Commit 79c4d02

Browse files
committed
Remove unnecessary pubs.
1 parent c9c964f commit 79c4d02

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

compiler/rustc_expand/src/expand.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ macro_rules! ast_fragments {
8787
}
8888

8989
impl AstFragment {
90-
pub fn add_placeholders(&mut self, placeholders: &[NodeId]) {
90+
fn add_placeholders(&mut self, placeholders: &[NodeId]) {
9191
if placeholders.is_empty() {
9292
return;
9393
}
@@ -100,14 +100,14 @@ macro_rules! ast_fragments {
100100
}
101101
}
102102

103-
pub fn make_opt_expr(self) -> Option<P<ast::Expr>> {
103+
pub(crate) fn make_opt_expr(self) -> Option<P<ast::Expr>> {
104104
match self {
105105
AstFragment::OptExpr(expr) => expr,
106106
_ => panic!("AstFragment::make_* called on the wrong kind of fragment"),
107107
}
108108
}
109109

110-
pub fn make_method_receiver_expr(self) -> P<ast::Expr> {
110+
pub(crate) fn make_method_receiver_expr(self) -> P<ast::Expr> {
111111
match self {
112112
AstFragment::MethodReceiverExpr(expr) => expr,
113113
_ => panic!("AstFragment::make_* called on the wrong kind of fragment"),
@@ -125,7 +125,7 @@ macro_rules! ast_fragments {
125125
T::fragment_to_output(self)
126126
}
127127

128-
pub fn mut_visit_with<F: MutVisitor>(&mut self, vis: &mut F) {
128+
pub(crate) fn mut_visit_with<F: MutVisitor>(&mut self, vis: &mut F) {
129129
match self {
130130
AstFragment::OptExpr(opt_expr) => {
131131
visit_clobber(opt_expr, |opt_expr| {
@@ -958,7 +958,7 @@ pub fn parse_ast_fragment<'a>(
958958
})
959959
}
960960

961-
pub fn ensure_complete_parse<'a>(
961+
pub(crate) fn ensure_complete_parse<'a>(
962962
parser: &Parser<'a>,
963963
macro_path: &ast::Path,
964964
kind_name: &str,

compiler/rustc_expand/src/mbe.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
//! official terminology: "declarative macros".
55
66
pub(crate) mod diagnostics;
7-
pub(crate) mod macro_check;
8-
pub(crate) mod macro_parser;
97
pub(crate) mod macro_rules;
10-
pub(crate) mod metavar_expr;
11-
pub(crate) mod quoted;
12-
pub(crate) mod transcribe;
8+
9+
mod macro_check;
10+
mod macro_parser;
11+
mod metavar_expr;
12+
mod quoted;
13+
mod transcribe;
1314

1415
use metavar_expr::MetaVarExpr;
1516
use rustc_ast::token::{Delimiter, NonterminalKind, Token, TokenKind};

compiler/rustc_expand/src/placeholders.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_span::DUMMY_SP;
99
use smallvec::{smallvec, SmallVec};
1010
use thin_vec::ThinVec;
1111

12-
pub fn placeholder(
12+
pub(crate) fn placeholder(
1313
kind: AstFragmentKind,
1414
id: ast::NodeId,
1515
vis: Option<ast::Visibility>,

0 commit comments

Comments
 (0)