Skip to content

Commit

Permalink
Format clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen committed Jan 16, 2022
1 parent f4a88f2 commit 94dd915
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
5 changes: 1 addition & 4 deletions clippy_lints/src/non_copy_const.rs
Expand Up @@ -188,10 +188,7 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D

let result = cx.tcx.const_eval_resolve(
cx.param_env,
ty::Unevaluated::new(
ty::WithOptConstParam::unknown(def_id),
substs,
),
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
None,
);
is_value_unfrozen_raw(cx, result, ty)
Expand Down
5 changes: 1 addition & 4 deletions clippy_lints/src/redundant_clone.rs
Expand Up @@ -624,10 +624,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> {
.flat_map(HybridBitSet::iter)
.collect();

if ContainsRegion
.visit_ty(self.body.local_decls[*dest].ty)
.is_break()
{
if ContainsRegion.visit_ty(self.body.local_decls[*dest].ty).is_break() {
mutable_variables.push(*dest);
}

Expand Down
5 changes: 1 addition & 4 deletions clippy_lints/src/unnecessary_sort_by.rs
Expand Up @@ -224,10 +224,7 @@ fn detect_lint(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<LintTrigger> {

fn expr_borrows(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
let ty = cx.typeck_results().expr_ty(expr);
matches!(ty.kind(), ty::Ref(..))
|| ty
.walk()
.any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_)))
matches!(ty.kind(), ty::Ref(..)) || ty.walk().any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_)))
}

impl LateLintPass<'_> for UnnecessarySortBy {
Expand Down
5 changes: 1 addition & 4 deletions clippy_utils/src/consts.rs
Expand Up @@ -413,10 +413,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
.tcx
.const_eval_resolve(
self.param_env,
ty::Unevaluated::new(
ty::WithOptConstParam::unknown(def_id),
substs,
),
ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs),
None,
)
.ok()
Expand Down

0 comments on commit 94dd915

Please sign in to comment.