Merge pull request #116 from oli-obk/master

fix drop impls for clike enums
This commit is contained in:
Scott Olson 2017-02-07 17:43:41 +01:00 committed by GitHub
commit 14f094f5a9
2 changed files with 21 additions and 0 deletions

View File

@ -776,6 +776,7 @@ pub fn drop(
return Ok(()); // nothing to do, this is zero sized (e.g. `None`)
}
},
Layout::CEnum { .. } => return Ok(()),
_ => bug!("{:?} is not an adt layout", layout),
};
let tcx = self.tcx;

View File

@ -0,0 +1,20 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
enum Two { A, B }
impl Drop for Two {
fn drop(&mut self) {
}
}
fn main() {
let _k = Two::A;
}