From d08a6da1f05dc6f8de4201efe949f1c26704ced0 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 21 Mar 2017 21:21:24 -0400 Subject: [PATCH] remove `Clone` from `FnCtxt` --- src/librustc_typeck/check/coercion.rs | 4 ---- src/librustc_typeck/check/mod.rs | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index 8a9db674c6eb..37d442f1d059 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -914,7 +914,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { /// } /// let final_ty = coerce.complete(fcx); /// ``` -#[derive(Clone)] // (*) pub struct CoerceMany<'gcx, 'tcx, 'exprs, E> where 'gcx: 'tcx, E: 'exprs + AsCoercionSite, { @@ -928,7 +927,6 @@ pub struct CoerceMany<'gcx, 'tcx, 'exprs, E> /// a buffer. We use this in `check/mod.rs` for things like `break`. pub type DynamicCoerceMany<'gcx, 'tcx> = CoerceMany<'gcx, 'tcx, 'gcx, P>; -#[derive(Clone)] // (*) enum Expressions<'gcx, 'exprs, E> where E: 'exprs + AsCoercionSite, { @@ -936,8 +934,6 @@ enum Expressions<'gcx, 'exprs, E> UpFront(&'exprs [E]), } -// (*) this is clone because `FnCtxt` is clone, but it seems dubious -- nmatsakis - impl<'gcx, 'tcx, 'exprs, E> CoerceMany<'gcx, 'tcx, 'exprs, E> where 'gcx: 'tcx, E: 'exprs + AsCoercionSite, { diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 0a2cb94c591d..9eaa8404bded 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -415,7 +415,6 @@ impl Diverges { } } -#[derive(Clone)] pub struct BreakableCtxt<'gcx: 'tcx, 'tcx> { may_break: bool, @@ -424,7 +423,6 @@ pub struct BreakableCtxt<'gcx: 'tcx, 'tcx> { coerce: Option>, } -#[derive(Clone)] pub struct EnclosingBreakables<'gcx: 'tcx, 'tcx> { stack: Vec>, by_id: NodeMap, @@ -439,7 +437,6 @@ impl<'gcx, 'tcx> EnclosingBreakables<'gcx, 'tcx> { } } -#[derive(Clone)] pub struct FnCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { ast_ty_to_ty_cache: RefCell>>,