about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorBastian Kauschke <bastian_kauschke@hotmail.de>2020-10-24 02:21:18 +0200
committerBastian Kauschke <bastian_kauschke@hotmail.de>2020-11-16 22:34:57 +0100
commit2bf93bd852f0636eb4d052ee155bdb6cec592c53 (patch)
tree2b1afcc6ca36800af099b279acedc25de7d88f28 /compiler/rustc_lint/src
parent3ec6720bf1af8cb9397e6ad48ec300b6a46b25fb (diff)
downloadrust-2bf93bd852f0636eb4d052ee155bdb6cec592c53.tar.gz
rust-2bf93bd852f0636eb4d052ee155bdb6cec592c53.zip
compiler: fold by value
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/types.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs
index 467a3a42590..eedb0e31bcc 100644
--- a/compiler/rustc_lint/src/types.rs
+++ b/compiler/rustc_lint/src/types.rs
@@ -880,7 +880,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
             return FfiSafe;
         }
 
-        match ty.kind() {
+        match *ty.kind() {
             ty::Adt(def, _) if def.is_box() && matches!(self.mode, CItemKind::Definition) => {
                 FfiSafe
             }
@@ -1044,7 +1044,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
                     };
                 }
 
-                let sig = tcx.erase_late_bound_regions(&sig);
+                let sig = tcx.erase_late_bound_regions(sig);
                 if !sig.output().is_unit() {
                     let r = self.check_type_for_ffi(cache, sig.output());
                     match r {
@@ -1218,7 +1218,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
     fn check_foreign_fn(&mut self, id: hir::HirId, decl: &hir::FnDecl<'_>) {
         let def_id = self.cx.tcx.hir().local_def_id(id);
         let sig = self.cx.tcx.fn_sig(def_id);
-        let sig = self.cx.tcx.erase_late_bound_regions(&sig);
+        let sig = self.cx.tcx.erase_late_bound_regions(sig);
 
         for (input_ty, input_hir) in sig.inputs().iter().zip(decl.inputs) {
             self.check_type_for_ffi_and_report_errors(input_hir.span, input_ty, false, false);
@@ -1295,7 +1295,7 @@ impl<'tcx> LateLintPass<'tcx> for VariantSizeDifferences {
         if let hir::ItemKind::Enum(ref enum_definition, _) = it.kind {
             let item_def_id = cx.tcx.hir().local_def_id(it.hir_id);
             let t = cx.tcx.type_of(item_def_id);
-            let ty = cx.tcx.erase_regions(&t);
+            let ty = cx.tcx.erase_regions(t);
             let layout = match cx.layout_of(ty) {
                 Ok(layout) => layout,
                 Err(