]> git.lizzy.rs Git - rust.git/commitdiff
Remove unused field
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Thu, 28 Jun 2018 12:31:46 +0000 (14:31 +0200)
committerOliver Schneider <github35764891676564198441@oli-obk.de>
Sat, 30 Jun 2018 09:45:11 +0000 (11:45 +0200)
src/librustc/hir/lowering.rs

index 30537f41178e74c9780ebed204179349343f49ed..530733d5f837ecf2a774b3890eec2fb4098815ad 100644 (file)
@@ -177,9 +177,7 @@ enum ImplTraitContext {
     /// Treat `impl Trait` as shorthand for a new universal generic parameter.
     /// Example: `fn foo(x: impl Debug)`, where `impl Debug` is conceptually
     /// equivalent to a fresh universal parameter like `fn foo<T: Debug>(x: T)`.
-    ///
-    /// We store a DefId here so we can look up necessary information later
-    Universal(DefId),
+    Universal,
 
     /// Treat `impl Trait` as shorthand for a new universal existential parameter.
     /// Example: `fn foo() -> impl Debug`, where `impl Debug` is conceptually
@@ -803,7 +801,7 @@ fn add_in_band_defs<F, T>(
         let (in_band_defs, (mut lowered_generics, res)) = self.with_in_scope_lifetime_defs(
             &generics.params,
             |this| {
-                let itctx = ImplTraitContext::Universal(parent_id);
+                let itctx = ImplTraitContext::Universal;
                 this.collect_in_band_defs(parent_id, anonymous_lifetime_mode, |this| {
                     (this.lower_generics(generics, itctx), f(this))
                 })
@@ -1169,7 +1167,7 @@ fn lower_ty_direct(&mut self, t: &Ty, itctx: ImplTraitContext) -> hir::Ty {
                             |this| this.lower_param_bounds(bounds, itctx),
                         )
                     }
-                    ImplTraitContext::Universal(_def_id) => {
+                    ImplTraitContext::Universal => {
                         self.lower_node_id(def_node_id);
                         // Add a definition for the in-band TyParam
                         let def_index = self
@@ -1875,8 +1873,8 @@ fn lower_fn_decl(
         let inputs = decl.inputs
             .iter()
             .map(|arg| {
-                if let Some(def_id) = fn_def_id {
-                    self.lower_ty_direct(&arg.ty, ImplTraitContext::Universal(def_id))
+                if fn_def_id.is_some() {
+                    self.lower_ty_direct(&arg.ty, ImplTraitContext::Universal)
                 } else {
                     self.lower_ty_direct(&arg.ty, ImplTraitContext::Disallowed)
                 }
@@ -2527,9 +2525,9 @@ fn lower_async_body(
         body: &Block,
     ) -> hir::BodyId {
         self.lower_body(Some(decl), |this| {
-            if let IsAsync::Async(async_node_id) = asyncness {
+            if let IsAsync::Async { closure_id, .. } = asyncness {
                 let async_expr = this.make_async_expr(
-                    CaptureBy::Value, async_node_id, None,
+                    CaptureBy::Value, closure_id, None,
                     |this| {
                         let body = this.lower_block(body, false);
                         this.expr_block(body, ThinVec::new())