mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
remove unused unit values (clippy::unused_unit)
This commit is contained in:
parent
47e9775a9a
commit
e45fdcfa9a
@ -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;
|
||||
|
@ -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>,
|
||||
|
@ -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>,
|
||||
|
@ -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) });
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
@ -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() =>
|
||||
|
Loading…
Reference in New Issue
Block a user