2015-03-22 20:13:15 +00:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2013-12-06 03:13:46 +00:00
|
|
|
|
2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
2013-12-06 03:13:46 +00:00
|
|
|
|
2014-08-01 23:42:13 +00:00
|
|
|
// Tests for a previous bug that occurred due to an interaction
|
2013-12-06 03:13:46 +00:00
|
|
|
// between struct field initialization and the auto-coercion
|
|
|
|
// from a vector to a slice. The drop glue was being invoked on
|
|
|
|
// the temporary slice with a wrong type, triggering an LLVM assert.
|
|
|
|
|
2014-03-05 23:28:08 +00:00
|
|
|
|
2013-12-10 07:16:18 +00:00
|
|
|
struct Thing1<'a> {
|
2015-03-26 00:06:52 +00:00
|
|
|
baz: &'a [Box<isize>],
|
2014-05-06 01:56:44 +00:00
|
|
|
bar: Box<u64>,
|
2013-12-06 03:13:46 +00:00
|
|
|
}
|
|
|
|
|
2013-12-10 07:16:18 +00:00
|
|
|
struct Thing2<'a> {
|
2015-03-26 00:06:52 +00:00
|
|
|
baz: &'a [Box<isize>],
|
2013-12-06 03:13:46 +00:00
|
|
|
bar: u64,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
let _t1_fixed = Thing1 {
|
2014-01-15 19:39:08 +00:00
|
|
|
baz: &[],
|
2022-07-07 02:36:10 +00:00
|
|
|
bar: Box::new(32),
|
2013-12-06 03:13:46 +00:00
|
|
|
};
|
2014-01-15 19:39:08 +00:00
|
|
|
Thing1 {
|
2015-02-02 02:53:25 +00:00
|
|
|
baz: &Vec::new(),
|
2022-07-07 02:36:10 +00:00
|
|
|
bar: Box::new(32),
|
2013-12-06 03:13:46 +00:00
|
|
|
};
|
|
|
|
let _t2_fixed = Thing2 {
|
2014-01-15 19:39:08 +00:00
|
|
|
baz: &[],
|
2013-12-06 03:13:46 +00:00
|
|
|
bar: 32,
|
|
|
|
};
|
2014-01-15 19:39:08 +00:00
|
|
|
Thing2 {
|
2015-02-02 02:53:25 +00:00
|
|
|
baz: &Vec::new(),
|
2013-12-06 03:13:46 +00:00
|
|
|
bar: 32,
|
|
|
|
};
|
|
|
|
}
|