Do not clone Mir unnecessarily

This commit is contained in:
Simonas Kazlauskas 2016-10-31 02:16:21 +02:00
parent f5a702dc78
commit 8ec0b3a12a
2 changed files with 7 additions and 5 deletions

View file

@ -63,7 +63,8 @@ macro_rules! newtype_index {
}
/// Lowered representation of a single function.
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
// Do not implement clone for Mir, its easy to do so accidently and its kind of expensive.
#[derive(RustcEncodable, RustcDecodable, Debug)]
pub struct Mir<'tcx> {
/// List of basic blocks. References to basic block use a newtyped index type `BasicBlock`
/// that indexes into this vector.