bors
a0d98ff0e5
Auto merge of #132356 - jieyouxu:unsound-simplify_aggregate_to_copy, r=cjgillot,DianQK
...
Mark `simplify_aggregate_to_copy` mir-opt as unsound
Mark the `simplify_aggregate_to_copy` mir-opt added in #128299 as unsound as it seems to miscompile the MCVE reported in https://github.com/rust-lang/rust/issues/132353 . The mir-opt can be re-enabled once this case is fixed.
```rs
fn pop_min(mut score2head: Vec<Option<usize>>) -> Option<usize> {
loop {
if let Some(col) = score2head[0] {
score2head[0] = None;
return Some(col);
}
}
}
fn main() {
let min = pop_min(vec![Some(1)]);
println!("min: {:?}", min);
// panic happens here on beta in release mode
// but not in debug mode
min.unwrap();
}
```
This MCVE is included as a `run-pass` ui regression test in the first commit. I built the ui test with a nightly manually, and can reproduce the behavioral difference with `-C opt-level=0` and `-C opt-level=1`. Locally, this ui test will fail unless it was run on a compiler built with the second commit marking the mir-opt as unsound thus disabling it by default.
This PR **partially reverts** commit e7386b3, reversing changes made to 02b1be1. The mir-opt implementation is just marked as unsound but **not** reverted to make reland reviews easier. Test changes are **reverted if they were not pure additions**. Tests added by the original PR received `-Z unsound-mir-opts` compile-flags.
cc `@DianQK` `@cjgillot` (PR author and reviewer of #128299 )
2024-10-31 15:29:14 +00:00
..
2024-05-31 15:56:43 +10:00
2024-10-22 12:55:16 +00:00
2024-10-06 18:12:25 +02:00
2024-10-31 18:20:11 +08:00
2024-05-31 15:56:43 +10:00
2024-09-18 13:53:31 -07:00
2024-10-20 11:41:08 +02:00
2024-08-07 14:08:34 +02:00
2024-10-23 04:42:03 +02:00
2024-10-21 15:22:17 +01:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-10-06 18:12:25 +02:00
2024-05-31 15:56:43 +10:00
2024-06-25 19:00:02 +02:00
2024-09-18 12:31:51 -07:00
2024-07-25 15:14:42 -04:00
2024-10-24 14:19:53 +11:00
2024-09-09 19:39:43 -07:00
2024-09-09 19:39:43 -07:00
2024-06-19 13:54:55 +01:00
2024-08-07 14:08:34 +02:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-06-19 13:54:55 +01:00
2024-09-09 19:39:43 -07:00
2024-09-18 12:28:55 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-04-11 21:42:35 -04:00
2024-04-22 18:48:47 +02:00
2024-08-10 10:44:24 +08:00
2024-04-11 21:42:35 -04:00
2024-04-09 08:51:32 -07:00
2024-06-19 17:48:05 +02:00
2024-04-11 17:20:08 +00:00
2024-10-14 05:30:45 +09:00
2024-05-31 15:56:43 +10:00
2024-10-06 08:14:44 +09:00
2024-09-21 01:51:26 +09:00
2024-05-31 15:56:43 +10:00
2024-07-29 08:26:52 +10:00
2024-10-21 15:22:17 +01:00
2024-05-31 15:56:43 +10:00
2024-10-03 22:15:52 +08:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-07-24 17:13:25 +02:00
2024-07-24 17:13:25 +02:00
2024-08-11 19:40:44 +02:00
2024-08-11 19:40:44 +02:00
2024-08-29 18:12:31 +08:00
2024-06-19 13:54:55 +01:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-10-23 04:42:03 +02:00
2024-10-31 13:48:06 +08:00
2024-07-25 15:14:42 -04:00
2024-05-31 15:56:43 +10:00
2024-08-07 14:08:34 +02:00
2024-08-11 19:40:44 +02:00
2024-10-23 04:42:03 +02:00
2024-04-24 13:12:33 +01:00
2024-09-09 19:39:43 -07:00
2024-09-21 01:07:00 -04:00
2024-06-04 01:30:51 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-06 23:15:48 +00:00
2024-05-06 23:15:48 +00:00
2024-05-31 15:56:43 +10:00
2024-08-12 19:20:00 -07:00
2024-08-07 14:08:34 +02:00
2024-10-11 08:43:27 +11:00
2024-06-05 15:40:11 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-07-25 15:14:42 -04:00
2024-05-31 15:56:43 +10:00
2024-06-16 17:19:25 +08:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-05-03 14:32:08 +02:00
2024-05-31 15:56:43 +10:00
2024-06-23 00:40:43 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-09-25 15:53:53 +02:00
2024-05-28 12:31:33 +02:00
2024-07-14 13:48:29 +03:00
2024-10-10 14:24:43 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-08-12 19:20:00 -07:00
2024-08-22 13:23:00 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-08-17 02:14:23 +01:00
2024-09-18 13:53:31 -07:00
2024-10-16 18:38:26 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-04-22 18:48:47 +02:00
2024-05-31 15:56:43 +10:00
2024-07-14 13:48:29 +03:00
2024-07-14 13:48:29 +03:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-09-18 13:53:31 -07:00
2024-08-31 23:56:45 +02:00
2024-04-18 09:35:35 -07:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-10-06 19:00:09 +02:00
2024-09-21 01:07:00 -04:00
2024-05-31 15:56:43 +10:00
2024-04-04 21:59:08 +01:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-07-14 13:48:29 +03:00
2024-05-31 15:56:43 +10:00
2024-10-07 11:12:58 -04:00
2024-09-18 13:53:31 -07:00
2024-04-11 21:42:35 -04:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-06-04 01:30:51 -07:00
2024-05-31 15:56:43 +10:00
2024-06-14 13:31:46 +10:00
2024-06-14 13:31:46 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-10-22 02:25:38 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-04-29 13:03:45 +00:00
2024-10-23 04:42:03 +02:00
2024-05-31 15:56:43 +10:00
2024-10-18 11:59:20 -07:00
2024-10-17 02:07:02 +01:00
2024-10-23 04:42:21 +02:00
2024-05-31 15:56:43 +10:00
2024-04-06 14:09:03 -04:00
2024-08-31 23:56:45 +02:00
2024-09-18 13:53:31 -07:00
2024-05-31 15:56:43 +10:00
2024-04-22 18:48:47 +02:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-08-07 00:41:48 -04:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-04-06 11:37:57 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-04-11 21:42:35 -04:00
2024-05-01 16:54:20 -07:00
2024-08-07 00:41:48 -04:00
2024-08-27 12:06:30 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-10-31 13:48:06 +08:00
2024-05-31 15:56:43 +10:00
2024-10-19 13:09:21 +00:00
2024-04-06 11:21:47 -04:00
2024-04-11 17:20:08 +00:00
2024-10-23 04:42:03 +02:00
2024-06-19 13:54:55 +01:00
2024-06-19 13:54:55 +01:00
2024-06-19 13:54:55 +01:00
2024-09-18 13:53:31 -07:00
2024-09-18 13:53:31 -07:00
2024-10-23 04:42:03 +02:00
2024-05-20 09:21:09 -05:00
2024-05-31 15:56:43 +10:00
2024-04-20 21:07:00 -04:00
2024-04-08 12:12:13 +02:00
2024-08-31 23:56:45 +02:00
2024-06-04 01:30:51 -07:00
2024-05-27 16:26:56 -04:00
2024-05-31 15:56:43 +10:00
2024-06-19 21:26:48 +01:00
2024-05-31 15:56:43 +10:00
2024-09-09 19:39:43 -07:00