Skip to content

Commit d08a6da

Browse files
committed
remove Clone from FnCtxt
1 parent 127a7d6 commit d08a6da

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/librustc_typeck/check/coercion.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
914914
/// }
915915
/// let final_ty = coerce.complete(fcx);
916916
/// ```
917-
#[derive(Clone)] // (*)
918917
pub struct CoerceMany<'gcx, 'tcx, 'exprs, E>
919918
where 'gcx: 'tcx, E: 'exprs + AsCoercionSite,
920919
{
@@ -928,16 +927,13 @@ pub struct CoerceMany<'gcx, 'tcx, 'exprs, E>
928927
/// a buffer. We use this in `check/mod.rs` for things like `break`.
929928
pub type DynamicCoerceMany<'gcx, 'tcx> = CoerceMany<'gcx, 'tcx, 'gcx, P<hir::Expr>>;
930929

931-
#[derive(Clone)] // (*)
932930
enum Expressions<'gcx, 'exprs, E>
933931
where E: 'exprs + AsCoercionSite,
934932
{
935933
Dynamic(Vec<&'gcx hir::Expr>),
936934
UpFront(&'exprs [E]),
937935
}
938936

939-
// (*) this is clone because `FnCtxt` is clone, but it seems dubious -- nmatsakis
940-
941937
impl<'gcx, 'tcx, 'exprs, E> CoerceMany<'gcx, 'tcx, 'exprs, E>
942938
where 'gcx: 'tcx, E: 'exprs + AsCoercionSite,
943939
{

src/librustc_typeck/check/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ impl Diverges {
415415
}
416416
}
417417

418-
#[derive(Clone)]
419418
pub struct BreakableCtxt<'gcx: 'tcx, 'tcx> {
420419
may_break: bool,
421420

@@ -424,7 +423,6 @@ pub struct BreakableCtxt<'gcx: 'tcx, 'tcx> {
424423
coerce: Option<DynamicCoerceMany<'gcx, 'tcx>>,
425424
}
426425

427-
#[derive(Clone)]
428426
pub struct EnclosingBreakables<'gcx: 'tcx, 'tcx> {
429427
stack: Vec<BreakableCtxt<'gcx, 'tcx>>,
430428
by_id: NodeMap<usize>,
@@ -439,7 +437,6 @@ impl<'gcx, 'tcx> EnclosingBreakables<'gcx, 'tcx> {
439437
}
440438
}
441439

442-
#[derive(Clone)]
443440
pub struct FnCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
444441
ast_ty_to_ty_cache: RefCell<NodeMap<Ty<'tcx>>>,
445442

0 commit comments

Comments
 (0)