summaryrefslogtreecommitdiff
path: root/compiler/rustc_expand
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-05-01 09:39:07 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-05-03 09:06:26 +1000
commit79c4d0202f0c5c44520a424cae34af5e2d30a2cc (patch)
treec1837696eaac4fc7b927395a70b164fc2750d464 /compiler/rustc_expand
parentc9c964fc379966a9fd932e1b5ac8a3327e424cd3 (diff)
Remove unnecessary `pub`s.
Diffstat (limited to 'compiler/rustc_expand')
-rw-r--r--compiler/rustc_expand/src/expand.rs10
-rw-r--r--compiler/rustc_expand/src/mbe.rs11
-rw-r--r--compiler/rustc_expand/src/placeholders.rs2
3 files changed, 12 insertions, 11 deletions
diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
index 35722c94909..84fc92a1df5 100644
--- a/compiler/rustc_expand/src/expand.rs
+++ b/compiler/rustc_expand/src/expand.rs
@@ -87,7 +87,7 @@ macro_rules! ast_fragments {
}
impl AstFragment {
- pub fn add_placeholders(&mut self, placeholders: &[NodeId]) {
+ fn add_placeholders(&mut self, placeholders: &[NodeId]) {
if placeholders.is_empty() {
return;
}
@@ -100,14 +100,14 @@ macro_rules! ast_fragments {
}
}
- pub fn make_opt_expr(self) -> Option<P<ast::Expr>> {
+ pub(crate) fn make_opt_expr(self) -> Option<P<ast::Expr>> {
match self {
AstFragment::OptExpr(expr) => expr,
_ => panic!("AstFragment::make_* called on the wrong kind of fragment"),
}
}
- pub fn make_method_receiver_expr(self) -> P<ast::Expr> {
+ pub(crate) fn make_method_receiver_expr(self) -> P<ast::Expr> {
match self {
AstFragment::MethodReceiverExpr(expr) => expr,
_ => panic!("AstFragment::make_* called on the wrong kind of fragment"),
@@ -125,7 +125,7 @@ macro_rules! ast_fragments {
T::fragment_to_output(self)
}
- pub fn mut_visit_with<F: MutVisitor>(&mut self, vis: &mut F) {
+ pub(crate) fn mut_visit_with<F: MutVisitor>(&mut self, vis: &mut F) {
match self {
AstFragment::OptExpr(opt_expr) => {
visit_clobber(opt_expr, |opt_expr| {
@@ -958,7 +958,7 @@ pub fn parse_ast_fragment<'a>(
})
}
-pub fn ensure_complete_parse<'a>(
+pub(crate) fn ensure_complete_parse<'a>(
parser: &Parser<'a>,
macro_path: &ast::Path,
kind_name: &str,
diff --git a/compiler/rustc_expand/src/mbe.rs b/compiler/rustc_expand/src/mbe.rs
index bd6a9b7cb07..a805c4fcf7b 100644
--- a/compiler/rustc_expand/src/mbe.rs
+++ b/compiler/rustc_expand/src/mbe.rs
@@ -4,12 +4,13 @@
//! official terminology: "declarative macros".
pub(crate) mod diagnostics;
-pub(crate) mod macro_check;
-pub(crate) mod macro_parser;
pub(crate) mod macro_rules;
-pub(crate) mod metavar_expr;
-pub(crate) mod quoted;
-pub(crate) mod transcribe;
+
+mod macro_check;
+mod macro_parser;
+mod metavar_expr;
+mod quoted;
+mod transcribe;
use metavar_expr::MetaVarExpr;
use rustc_ast::token::{Delimiter, NonterminalKind, Token, TokenKind};
diff --git a/compiler/rustc_expand/src/placeholders.rs b/compiler/rustc_expand/src/placeholders.rs
index 581d71875bd..7026425e167 100644
--- a/compiler/rustc_expand/src/placeholders.rs
+++ b/compiler/rustc_expand/src/placeholders.rs
@@ -9,7 +9,7 @@ use rustc_span::DUMMY_SP;
use smallvec::{smallvec, SmallVec};
use thin_vec::ThinVec;
-pub fn placeholder(
+pub(crate) fn placeholder(
kind: AstFragmentKind,
id: ast::NodeId,
vis: Option<ast::Visibility>,