Skip to content

Commit e45fdcf

Browse files
committed
remove unused unit values (clippy::unused_unit)
1 parent 47e9775 commit e45fdcf

File tree

6 files changed

+11
-35
lines changed

6 files changed

+11
-35
lines changed

src/librustc/ty/query/plumbing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ impl<'tcx> TyCtxt<'tcx> {
692692
/// side-effects -- e.g., in order to report errors for erroneous programs.
693693
///
694694
/// Note: The optimization is only available during incr. comp.
695-
pub(super) fn ensure_query<Q: QueryDescription<'tcx> + 'tcx>(self, key: Q::Key) -> () {
695+
pub(super) fn ensure_query<Q: QueryDescription<'tcx> + 'tcx>(self, key: Q::Key) {
696696
if Q::EVAL_ALWAYS {
697697
let _ = self.get_query::<Q>(DUMMY_SP, key);
698698
return;

src/librustc_mir/const_eval/machine.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
335335
}
336336

337337
#[inline(always)]
338-
fn tag_static_base_pointer(_memory_extra: &MemoryExtra, _id: AllocId) -> Self::PointerTag {
339-
()
340-
}
338+
fn tag_static_base_pointer(_memory_extra: &MemoryExtra, _id: AllocId) -> Self::PointerTag {}
341339

342340
fn box_alloc(
343341
_ecx: &mut InterpCx<'mir, 'tcx, Self>,

src/librustc_mir/transform/const_prop.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine {
232232
}
233233

234234
#[inline(always)]
235-
fn tag_static_base_pointer(_memory_extra: &(), _id: AllocId) -> Self::PointerTag {
236-
()
237-
}
235+
fn tag_static_base_pointer(_memory_extra: &(), _id: AllocId) -> Self::PointerTag {}
238236

239237
fn box_alloc(
240238
_ecx: &mut InterpCx<'mir, 'tcx, Self>,

src/librustc_mir_build/build/expr/as_temp.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
7373
// they are never assigned.
7474
ExprKind::Break { .. } | ExprKind::Continue { .. } | ExprKind::Return { .. } => (),
7575
ExprKind::Block { body: hir::Block { expr: None, targeted_by_break: false, .. } }
76-
if expr_ty.is_never() =>
77-
{
78-
()
79-
}
76+
if expr_ty.is_never() => {}
8077
_ => {
8178
this.cfg
8279
.push(block, Statement { source_info, kind: StatementKind::StorageLive(temp) });

src/librustc_target/spec/apple_sdk_base.rs

+6-20
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,20 @@ pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
4949
// Ignore `SDKROOT` if it's clearly set for the wrong platform.
5050
"appletvos"
5151
if sdkroot.contains("TVSimulator.platform")
52-
|| sdkroot.contains("MacOSX.platform") =>
53-
{
54-
()
55-
}
52+
|| sdkroot.contains("MacOSX.platform") => {}
5653
"appletvsimulator"
57-
if sdkroot.contains("TVOS.platform") || sdkroot.contains("MacOSX.platform") =>
58-
{
59-
()
60-
}
54+
if sdkroot.contains("TVOS.platform") || sdkroot.contains("MacOSX.platform") => {}
6155
"iphoneos"
6256
if sdkroot.contains("iPhoneSimulator.platform")
63-
|| sdkroot.contains("MacOSX.platform") =>
64-
{
65-
()
66-
}
57+
|| sdkroot.contains("MacOSX.platform") => {}
6758
"iphonesimulator"
68-
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("MacOSX.platform") =>
69-
{
70-
()
59+
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("MacOSX.platform") => {
7160
}
7261
"macosx10.15"
7362
if sdkroot.contains("iPhoneOS.platform")
74-
|| sdkroot.contains("iPhoneSimulator.platform") =>
75-
{
76-
()
77-
}
63+
|| sdkroot.contains("iPhoneSimulator.platform") => {}
7864
// Ignore `SDKROOT` if it's not a valid path.
79-
_ if !p.is_absolute() || p == Path::new("/") || !p.exists() => (),
65+
_ if !p.is_absolute() || p == Path::new("/") || !p.exists() => {}
8066
_ => return Ok(sdkroot),
8167
}
8268
}

src/librustc_typeck/coherence/builtin.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: DefId) {
178178
use ty::TyKind::*;
179179
match (&source.kind, &target.kind) {
180180
(&Ref(r_a, _, mutbl_a), Ref(r_b, _, mutbl_b))
181-
if infcx.at(&cause, param_env).eq(r_a, r_b).is_ok() && mutbl_a == *mutbl_b =>
182-
{
183-
()
184-
}
181+
if infcx.at(&cause, param_env).eq(r_a, r_b).is_ok() && mutbl_a == *mutbl_b => {}
185182
(&RawPtr(tm_a), &RawPtr(tm_b)) if tm_a.mutbl == tm_b.mutbl => (),
186183
(&Adt(def_a, substs_a), &Adt(def_b, substs_b))
187184
if def_a.is_struct() && def_b.is_struct() =>

0 commit comments

Comments
 (0)