Skip to content

Commit 5c3ba4a

Browse files
committed
renamed mk_nil to mk_unit
1 parent 6f685ff commit 5c3ba4a

File tree

16 files changed

+40
-40
lines changed

16 files changed

+40
-40
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
661661
{
662662
let predicate = trait_predicate.map_bound(|mut trait_pred| {
663663
trait_pred.trait_ref.substs = self.tcx.mk_substs_trait(
664-
self.tcx.mk_nil(),
664+
self.tcx.mk_unit(),
665665
&trait_pred.trait_ref.substs[1..],
666666
);
667667
trait_pred

src/librustc/ty/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,7 +2492,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
24922492
}
24932493

24942494
pub fn mk_nil_ptr(self) -> Ty<'tcx> {
2495-
self.mk_imm_ptr(self.mk_nil())
2495+
self.mk_imm_ptr(self.mk_unit())
24962496
}
24972497

24982498
pub fn mk_array(self, ty: Ty<'tcx>, n: u64) -> Ty<'tcx> {
@@ -2511,7 +2511,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
25112511
iter.intern_with(|ts| self.mk_ty(Tuple(self.intern_type_list(ts))))
25122512
}
25132513

2514-
pub fn mk_nil(self) -> Ty<'tcx> {
2514+
pub fn mk_unit(self) -> Ty<'tcx> {
25152515
self.intern_tup(&[])
25162516
}
25172517

src/librustc/ty/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl PrimitiveExt for Primitive {
132132
Int(i, signed) => i.to_ty(tcx, signed),
133133
Float(FloatTy::F32) => tcx.types.f32,
134134
Float(FloatTy::F64) => tcx.types.f64,
135-
Pointer => tcx.mk_mut_ptr(tcx.mk_nil()),
135+
Pointer => tcx.mk_mut_ptr(tcx.mk_unit()),
136136
}
137137
}
138138
}
@@ -1606,7 +1606,7 @@ impl<'a, 'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
16061606
// (which may have no non-DST form), and will work as long
16071607
// as the `Abi` or `FieldPlacement` is checked by users.
16081608
if i == 0 {
1609-
let nil = tcx.mk_nil();
1609+
let nil = tcx.mk_unit();
16101610
let ptr_ty = if this.ty.is_unsafe_ptr() {
16111611
tcx.mk_mut_ptr(nil)
16121612
} else {

src/librustc_codegen_llvm/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ fn get_rust_try_fn<'ll, 'tcx>(
968968
let i8p = tcx.mk_mut_ptr(tcx.types.i8);
969969
let fn_ty = tcx.mk_fn_ptr(ty::Binder::bind(tcx.mk_fn_sig(
970970
iter::once(i8p),
971-
tcx.mk_nil(),
971+
tcx.mk_unit(),
972972
false,
973973
hir::Unsafety::Unsafe,
974974
Abi::Rust

src/librustc_driver/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
309309
}
310310

311311
pub fn t_nil(&self) -> Ty<'tcx> {
312-
self.infcx.tcx.mk_nil()
312+
self.infcx.tcx.mk_unit()
313313
}
314314

315315
pub fn t_pair(&self, ty1: Ty<'tcx>, ty2: Ty<'tcx>) -> Ty<'tcx> {

src/librustc_mir/hair/cx/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
118118
}
119119

120120
pub fn unit_ty(&mut self) -> Ty<'tcx> {
121-
self.tcx.mk_nil()
121+
self.tcx.mk_unit()
122122
}
123123

124124
pub fn true_literal(&mut self) -> &'tcx ty::Const<'tcx> {

src/librustc_mir/interpret/terminator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
436436
layout: self.layout_of(self.tcx.mk_mut_ptr(place.layout.ty))?,
437437
};
438438

439-
let ty = self.tcx.mk_nil(); // return type is ()
439+
let ty = self.tcx.mk_unit(); // return type is ()
440440
let dest = PlaceTy::null(&self, self.layout_of(ty)?);
441441

442442
self.eval_fn_call(

src/librustc_mir/transform/generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ fn compute_layout<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
517517
}
518518

519519
let upvar_len = mir.upvar_decls.len();
520-
let dummy_local = LocalDecl::new_internal(tcx.mk_nil(), mir.span);
520+
let dummy_local = LocalDecl::new_internal(tcx.mk_unit(), mir.span);
521521

522522
// Gather live locals and their indices replacing values in mir.local_decls with a dummy
523523
// to avoid changing local indices
@@ -655,7 +655,7 @@ fn create_generator_drop_shim<'a, 'tcx>(
655655
// Replace the return variable
656656
mir.local_decls[RETURN_PLACE] = LocalDecl {
657657
mutability: Mutability::Mut,
658-
ty: tcx.mk_nil(),
658+
ty: tcx.mk_unit(),
659659
name: None,
660660
source_info,
661661
visibility_scope: source_info.scope,

src/librustc_mir/util/elaborate_drops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
529529
mutbl: hir::Mutability::MutMutable
530530
});
531531
let ref_place = self.new_temp(ref_ty);
532-
let unit_temp = Place::Local(self.new_temp(tcx.mk_nil()));
532+
let unit_temp = Place::Local(self.new_temp(tcx.mk_unit()));
533533

534534
let result = BasicBlockData {
535535
statements: vec![self.assign(
@@ -891,7 +891,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
891891
unwind: Unwind
892892
) -> BasicBlock {
893893
let tcx = self.tcx();
894-
let unit_temp = Place::Local(self.new_temp(tcx.mk_nil()));
894+
let unit_temp = Place::Local(self.new_temp(tcx.mk_unit()));
895895
let free_func = tcx.require_lang_item(lang_items::BoxFreeFnLangItem);
896896
let args = adt.variants[0].fields.iter().enumerate().map(|(i, f)| {
897897
let field = Field::new(i);

src/librustc_typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
15751575

15761576
let output_ty = match decl.output {
15771577
hir::Return(ref output) => self.ast_ty_to_ty(output),
1578-
hir::DefaultReturn(..) => tcx.mk_nil(),
1578+
hir::DefaultReturn(..) => tcx.mk_unit(),
15791579
};
15801580

15811581
debug!("ty_of_fn: output_ty={:?}", output_ty);

0 commit comments

Comments
 (0)