Remove crate
visibility usage in compiler
This commit is contained in:
parent
536020c5f9
commit
49c82f31a8
186 changed files with 865 additions and 800 deletions
|
@ -17,7 +17,11 @@ use std::collections::hash_map::Entry;
|
|||
use std::fmt::Write;
|
||||
|
||||
impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
crate fn lower_inline_asm(&mut self, sp: Span, asm: &InlineAsm) -> &'hir hir::InlineAsm<'hir> {
|
||||
pub(crate) fn lower_inline_asm(
|
||||
&mut self,
|
||||
sp: Span,
|
||||
asm: &InlineAsm,
|
||||
) -> &'hir hir::InlineAsm<'hir> {
|
||||
// Rustdoc needs to support asm! from foreign architectures: don't try
|
||||
// lowering the register constraints in this case.
|
||||
let asm_arch = if self.sess.opts.actually_rustdoc { None } else { self.sess.asm_arch };
|
||||
|
|
|
@ -848,7 +848,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
}
|
||||
|
||||
/// Construct `ExprKind::Err` for the given `span`.
|
||||
crate fn expr_err(&mut self, span: Span) -> hir::Expr<'hir> {
|
||||
pub(crate) fn expr_err(&mut self, span: Span) -> hir::Expr<'hir> {
|
||||
self.expr(span, hir::ExprKind::Err, AttrVec::new())
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
//! get confused if the spans from leaf AST nodes occur in multiple places
|
||||
//! in the HIR, especially for multiple identifiers.
|
||||
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(let_else)]
|
||||
|
|
|
@ -12,11 +12,11 @@ use rustc_span::symbol::Ident;
|
|||
use rustc_span::{source_map::Spanned, Span};
|
||||
|
||||
impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
crate fn lower_pat(&mut self, pattern: &Pat) -> &'hir hir::Pat<'hir> {
|
||||
pub(crate) fn lower_pat(&mut self, pattern: &Pat) -> &'hir hir::Pat<'hir> {
|
||||
self.arena.alloc(self.lower_pat_mut(pattern))
|
||||
}
|
||||
|
||||
crate fn lower_pat_mut(&mut self, mut pattern: &Pat) -> hir::Pat<'hir> {
|
||||
pub(crate) fn lower_pat_mut(&mut self, mut pattern: &Pat) -> hir::Pat<'hir> {
|
||||
ensure_sufficient_stack(|| {
|
||||
// loop here to avoid recursion
|
||||
let node = loop {
|
||||
|
@ -290,7 +290,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
}
|
||||
|
||||
/// Emit a friendly error for extra `..` patterns in a tuple/tuple struct/slice pattern.
|
||||
crate fn ban_extra_rest_pat(&self, sp: Span, prev_sp: Span, ctx: &str) {
|
||||
pub(crate) fn ban_extra_rest_pat(&self, sp: Span, prev_sp: Span, ctx: &str) {
|
||||
self.diagnostic()
|
||||
.struct_span_err(sp, &format!("`..` can only be used once per {} pattern", ctx))
|
||||
.span_label(sp, &format!("can only be used once per {} pattern", ctx))
|
||||
|
|
|
@ -15,7 +15,7 @@ use smallvec::smallvec;
|
|||
use tracing::debug;
|
||||
|
||||
impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
crate fn lower_qpath(
|
||||
pub(crate) fn lower_qpath(
|
||||
&mut self,
|
||||
id: NodeId,
|
||||
qself: &Option<QSelf>,
|
||||
|
@ -142,7 +142,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
);
|
||||
}
|
||||
|
||||
crate fn lower_path_extra(
|
||||
pub(crate) fn lower_path_extra(
|
||||
&mut self,
|
||||
res: Res,
|
||||
p: &Path,
|
||||
|
@ -163,7 +163,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
})
|
||||
}
|
||||
|
||||
crate fn lower_path(
|
||||
pub(crate) fn lower_path(
|
||||
&mut self,
|
||||
id: NodeId,
|
||||
p: &Path,
|
||||
|
@ -174,7 +174,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
self.lower_path_extra(res, p, param_mode)
|
||||
}
|
||||
|
||||
crate fn lower_path_segment(
|
||||
pub(crate) fn lower_path_segment(
|
||||
&mut self,
|
||||
path_span: Span,
|
||||
segment: &PathSegment,
|
||||
|
@ -381,7 +381,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
|||
}
|
||||
|
||||
/// An associated type binding `Output = $ty`.
|
||||
crate fn output_ty_binding(
|
||||
pub(crate) fn output_ty_binding(
|
||||
&mut self,
|
||||
span: Span,
|
||||
ty: &'hir hir::Ty<'hir>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue