rust/library
bors b3ab80c119 Auto merge of #113175 - bryangarza:safe-transmute-rustc-coinductive, r=compiler-errors
Enable coinduction support for Safe Transmute

This patch adds the `#[rustc_coinductive]` annotation to `BikeshedIntrinsicFrom`, so that it's possible to compute transmutability for recursive types.

## Motivation
Safe Transmute currently already supports references (#110662). However, if a type is implemented recursively, it leads to an infinite loop when we try to check if transmutation is safe.

A couple simple examples that one might want to write, that are currently not possible to check transmutability for:
```rs
#[repr(C)] struct A(&'static B);
#[repr(C)] struct B(&'static A);
```

```rs
#[repr(C)]
enum IList<'a> { Nil, Cons(isize, &'a IList<'a>) }
#[repr(C)]
enum UList<'a> { Nil, Cons(usize, &'a UList<'a>) }
```

Previously, `@jswrenn` was considering writing a co-inductive solver from scratch, just for the `rustc_tranmsute` crate. Later on as I started working on Safe Transmute myself, I came across the `#[rustc_coinductive]` annotation, which is currently only being used for the `Sized` trait. Leveraging this trait actually solved the problem entirely, and it saves a lot of duplicate work that would have had to happen in `rustc_transmute`.
2023-07-11 13:48:59 +00:00
..
alloc Rollup merge of #113318 - tgross35:113283-allocator-trait-eq, r=m-ou-se 2023-07-06 20:11:40 -07:00
backtrace@e1c49fbd61 Update std to backtrace 0.3.68 2023-07-02 17:02:45 -07:00
core Auto merge of #113175 - bryangarza:safe-transmute-rustc-coinductive, r=compiler-errors 2023-07-11 13:48:59 +00:00
panic_abort Remove unnecessary raw pointer in __rust_start_panic arg 2023-03-26 16:40:18 +00:00
panic_unwind Partial stabilisation of c_unwind 2023-04-29 13:01:44 +01:00
portable-simd Sync portable-simd to 2023 July 07 2023-07-07 04:07:00 -07:00
proc_macro Merge proc_macro_span_shrink and proc_macro_span 2023-06-20 19:40:26 -04:00
profiler_builtins
rtstartup Remove custom frame info registration on i686-pc-windows-gnu 2022-08-23 16:12:58 +08:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Correct the Android stat struct definitions 2023-07-10 15:13:25 -07:00
stdarch@d77878b729 Bump stdarch 2023-06-13 21:45:04 -07:00
sysroot Expose compiler-builtins-weak-intrinsics feature for -Zbuild-std 2023-06-23 11:15:34 +01:00
test Auto merge of #111992 - ferrocene:pa-panic-abort-tests-bench, r=m-ou-se 2023-07-01 07:07:50 +00:00
unwind wip: Support Apple tvOS in libstd 2023-06-21 14:59:37 -07:00