Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmease
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)` I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
This commit is contained in:
commit
d6940fb43d
20 changed files with 51 additions and 57 deletions
|
@ -997,7 +997,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
match self.unit_temp {
|
||||
Some(tmp) => tmp,
|
||||
None => {
|
||||
let ty = Ty::new_unit(self.tcx);
|
||||
let ty = self.tcx.types.unit;
|
||||
let fn_span = self.fn_span;
|
||||
let tmp = self.temp(ty, fn_span);
|
||||
self.unit_temp = Some(tmp);
|
||||
|
|
|
@ -15,7 +15,7 @@ use rustc_hir::HirId;
|
|||
use rustc_hir::Node;
|
||||
use rustc_middle::middle::region;
|
||||
use rustc_middle::thir::*;
|
||||
use rustc_middle::ty::{self, RvalueScopes, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, RvalueScopes, TyCtxt};
|
||||
|
||||
pub(crate) fn thir_body(
|
||||
tcx: TyCtxt<'_>,
|
||||
|
@ -39,7 +39,7 @@ pub(crate) fn thir_body(
|
|||
// It will always be `()` in this case.
|
||||
if tcx.is_coroutine(owner_def.to_def_id()) && body.params.is_empty() {
|
||||
cx.thir.params.push(Param {
|
||||
ty: Ty::new_unit(tcx),
|
||||
ty: tcx.types.unit,
|
||||
pat: None,
|
||||
ty_span: None,
|
||||
self_kind: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue