Skip to content

Remove a workaround for deriving(Clone) on unit structs. #14168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/librustc/middle/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,9 @@ pub mod gather_loans;

pub mod move_data;

#[deriving(Clone)]
pub struct LoanDataFlowOperator;

/// FIXME(pcwalton): Should just be #[deriving(Clone)], but that doesn't work
/// yet on unit structs.
impl Clone for LoanDataFlowOperator {
fn clone(&self) -> LoanDataFlowOperator {
LoanDataFlowOperator
}
}

pub type LoanDataFlow<'a> = DataFlowContext<'a, LoanDataFlowOperator>;

impl<'a> Visitor<()> for BorrowckCtxt<'a> {
Expand Down
18 changes: 2 additions & 16 deletions src/librustc/middle/borrowck/move_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,14 @@ pub struct Assignment {
pub span: Span,
}

#[deriving(Clone)]
pub struct MoveDataFlowOperator;

/// FIXME(pcwalton): Should just be #[deriving(Clone)], but that doesn't work
/// yet on unit structs.
impl Clone for MoveDataFlowOperator {
fn clone(&self) -> MoveDataFlowOperator {
MoveDataFlowOperator
}
}

pub type MoveDataFlow<'a> = DataFlowContext<'a, MoveDataFlowOperator>;

#[deriving(Clone)]
pub struct AssignDataFlowOperator;

/// FIXME(pcwalton): Should just be #[deriving(Clone)], but that doesn't work
/// yet on unit structs.
impl Clone for AssignDataFlowOperator {
fn clone(&self) -> AssignDataFlowOperator {
AssignDataFlowOperator
}
}

pub type AssignDataFlow<'a> = DataFlowContext<'a, AssignDataFlowOperator>;

impl MoveData {
Expand Down