Merge pull request #116 from oli-obk/master
fix drop impls for clike enums
This commit is contained in:
commit
14f094f5a9
@ -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;
|
||||
|
20
tests/run-pass/issue-15063.rs
Normal file
20
tests/run-pass/issue-15063.rs
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user