Skip to content

Commit

Permalink
remove unused unit values (clippy::unused_unit)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Mar 21, 2020
1 parent 47e9775 commit e45fdcf
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ impl<'tcx> TyCtxt<'tcx> {
/// side-effects -- e.g., in order to report errors for erroneous programs.
///
/// Note: The optimization is only available during incr. comp.
pub(super) fn ensure_query<Q: QueryDescription<'tcx> + 'tcx>(self, key: Q::Key) -> () {
pub(super) fn ensure_query<Q: QueryDescription<'tcx> + 'tcx>(self, key: Q::Key) {
if Q::EVAL_ALWAYS {
let _ = self.get_query::<Q>(DUMMY_SP, key);
return;
Expand Down
4 changes: 1 addition & 3 deletions src/librustc_mir/const_eval/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
}

#[inline(always)]
fn tag_static_base_pointer(_memory_extra: &MemoryExtra, _id: AllocId) -> Self::PointerTag {
()
}
fn tag_static_base_pointer(_memory_extra: &MemoryExtra, _id: AllocId) -> Self::PointerTag {}

fn box_alloc(
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
Expand Down
4 changes: 1 addition & 3 deletions src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine {
}

#[inline(always)]
fn tag_static_base_pointer(_memory_extra: &(), _id: AllocId) -> Self::PointerTag {
()
}
fn tag_static_base_pointer(_memory_extra: &(), _id: AllocId) -> Self::PointerTag {}

fn box_alloc(
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
Expand Down
5 changes: 1 addition & 4 deletions src/librustc_mir_build/build/expr/as_temp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
// they are never assigned.
ExprKind::Break { .. } | ExprKind::Continue { .. } | ExprKind::Return { .. } => (),
ExprKind::Block { body: hir::Block { expr: None, targeted_by_break: false, .. } }
if expr_ty.is_never() =>
{
()
}
if expr_ty.is_never() => {}
_ => {
this.cfg
.push(block, Statement { source_info, kind: StatementKind::StorageLive(temp) });
Expand Down
26 changes: 6 additions & 20 deletions src/librustc_target/spec/apple_sdk_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,20 @@ pub fn get_sdk_root(sdk_name: &str) -> Result<String, String> {
// Ignore `SDKROOT` if it's clearly set for the wrong platform.
"appletvos"
if sdkroot.contains("TVSimulator.platform")
|| sdkroot.contains("MacOSX.platform") =>
{
()
}
|| sdkroot.contains("MacOSX.platform") => {}
"appletvsimulator"
if sdkroot.contains("TVOS.platform") || sdkroot.contains("MacOSX.platform") =>
{
()
}
if sdkroot.contains("TVOS.platform") || sdkroot.contains("MacOSX.platform") => {}
"iphoneos"
if sdkroot.contains("iPhoneSimulator.platform")
|| sdkroot.contains("MacOSX.platform") =>
{
()
}
|| sdkroot.contains("MacOSX.platform") => {}
"iphonesimulator"
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("MacOSX.platform") =>
{
()
if sdkroot.contains("iPhoneOS.platform") || sdkroot.contains("MacOSX.platform") => {
}
"macosx10.15"
if sdkroot.contains("iPhoneOS.platform")
|| sdkroot.contains("iPhoneSimulator.platform") =>
{
()
}
|| sdkroot.contains("iPhoneSimulator.platform") => {}
// Ignore `SDKROOT` if it's not a valid path.
_ if !p.is_absolute() || p == Path::new("/") || !p.exists() => (),
_ if !p.is_absolute() || p == Path::new("/") || !p.exists() => {}
_ => return Ok(sdkroot),
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/librustc_typeck/coherence/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: DefId) {
use ty::TyKind::*;
match (&source.kind, &target.kind) {
(&Ref(r_a, _, mutbl_a), Ref(r_b, _, mutbl_b))
if infcx.at(&cause, param_env).eq(r_a, r_b).is_ok() && mutbl_a == *mutbl_b =>
{
()
}
if infcx.at(&cause, param_env).eq(r_a, r_b).is_ok() && mutbl_a == *mutbl_b => {}
(&RawPtr(tm_a), &RawPtr(tm_b)) if tm_a.mutbl == tm_b.mutbl => (),
(&Adt(def_a, substs_a), &Adt(def_b, substs_b))
if def_a.is_struct() && def_b.is_struct() =>
Expand Down

0 comments on commit e45fdcf

Please sign in to comment.