Remove crate visibility usage in compiler
This commit is contained in:
@@ -14,7 +14,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
///
|
||||
/// N.B., **No cleanup is scheduled for this temporary.** You should
|
||||
/// call `schedule_drop` once the temporary is initialized.
|
||||
crate fn temp(&mut self, ty: Ty<'tcx>, span: Span) -> Place<'tcx> {
|
||||
pub(crate) fn temp(&mut self, ty: Ty<'tcx>, span: Span) -> Place<'tcx> {
|
||||
// Mark this local as internal to avoid temporaries with types not present in the
|
||||
// user's code resulting in ICEs from the generator transform.
|
||||
let temp = self.local_decls.push(LocalDecl::new(ty, span).internal());
|
||||
@@ -25,20 +25,24 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
|
||||
/// Convenience function for creating a literal operand, one
|
||||
/// without any user type annotation.
|
||||
crate fn literal_operand(&mut self, span: Span, literal: ConstantKind<'tcx>) -> Operand<'tcx> {
|
||||
pub(crate) fn literal_operand(
|
||||
&mut self,
|
||||
span: Span,
|
||||
literal: ConstantKind<'tcx>,
|
||||
) -> Operand<'tcx> {
|
||||
let constant = Box::new(Constant { span, user_ty: None, literal });
|
||||
Operand::Constant(constant)
|
||||
}
|
||||
|
||||
// Returns a zero literal operand for the appropriate type, works for
|
||||
// bool, char and integers.
|
||||
crate fn zero_literal(&mut self, span: Span, ty: Ty<'tcx>) -> Operand<'tcx> {
|
||||
pub(crate) fn zero_literal(&mut self, span: Span, ty: Ty<'tcx>) -> Operand<'tcx> {
|
||||
let literal = ConstantKind::from_bits(self.tcx, 0, ty::ParamEnv::empty().and(ty));
|
||||
|
||||
self.literal_operand(span, literal)
|
||||
}
|
||||
|
||||
crate fn push_usize(
|
||||
pub(crate) fn push_usize(
|
||||
&mut self,
|
||||
block: BasicBlock,
|
||||
source_info: SourceInfo,
|
||||
@@ -59,7 +63,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
temp
|
||||
}
|
||||
|
||||
crate fn consume_by_copy_or_move(&self, place: Place<'tcx>) -> Operand<'tcx> {
|
||||
pub(crate) fn consume_by_copy_or_move(&self, place: Place<'tcx>) -> Operand<'tcx> {
|
||||
let tcx = self.tcx;
|
||||
let ty = place.ty(&self.local_decls, tcx).ty;
|
||||
if !self.infcx.type_is_copy_modulo_regions(self.param_env, ty, DUMMY_SP) {
|
||||
|
||||
Reference in New Issue
Block a user