rust/compiler
bors 95e77648e4 Auto merge of #97522 - xfix:stabilize-slice-from-raw-parts, r=dtolnay
Partially stabilize const_slice_from_raw_parts

This doesn't stabilize methods working on mutable pointers.

This pull request continues from #94946.

Pinging `@rust-lang/wg-const-eval` this because I use `rustc_allow_const_fn_unstable`. I believe this is justifiable as it's already possible to use `slice::from_raw_parts` in stable by abusing `transmute`. The stable alternative to this would be to provide a stable const implementation of `std::ptr::from_raw_parts` (as it can already be implemented in stable).

```rust
use std::mem;

#[repr(C)]
struct Slice<T> {
    data: *const T,
    len: usize,
}

fn main() {
    let data: *const i32 = [1, 2, 3, 4].as_ptr();
    let len = 4;
    println!("{:?}", unsafe {
        mem::transmute::<Slice<i32>, &[i32]>(Slice { data, len })
    });
}
```

`@rustbot` modify labels: +T-libs-api
2022-07-10 06:26:03 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #98758 - nnethercote:more-derive-output-improvements, r=Mark-Simulacrum 2022-07-08 12:44:14 +00:00
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty
rustc_attr
rustc_borrowck Rollup merge of #98795 - jackh726:lexical_region_resolve_cleanup, r=compiler-errors 2022-07-08 08:00:38 +02:00
rustc_builtin_macros Minor updates based on review comments. 2022-07-09 10:04:09 +10:00
rustc_codegen_cranelift Partially stabilize const_slice_from_raw_parts 2022-07-09 23:20:02 +02:00
rustc_codegen_gcc fix cranelift and gcc backends 2022-07-09 07:27:29 -04:00
rustc_codegen_llvm don't allow ZST in ScalarInt 2022-07-09 07:27:29 -04:00
rustc_codegen_ssa tweak names and output and bless 2022-07-09 07:43:56 -04:00
rustc_const_eval Auto merge of #98957 - RalfJung:zst-are-different, r=lcnr,oli-obk 2022-07-09 17:16:00 +00:00
rustc_data_structures
rustc_driver
rustc_error_codes
rustc_error_messages simplify plurals in fluent messages using hir::ConstContext 2022-07-08 03:48:10 +00:00
rustc_errors Rollup merge of #98657 - compiler-errors:rustc-const-eval-session-diagnostic-1, r=davidtwco 2022-07-08 18:25:50 +05:30
rustc_expand
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #99043 - compiler-errors:derive-nit, r=cjgillot 2022-07-09 11:28:07 +05:30
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Auto merge of #99056 - lcnr:higher_ranked_sub, r=oli-obk 2022-07-09 19:57:13 +00:00
rustc_interface Implement support for DWARF version 5. 2022-07-08 11:31:08 -07:00
rustc_lexer
rustc_lint
rustc_lint_defs
rustc_llvm
rustc_log
rustc_macros
rustc_metadata
rustc_middle Auto merge of #98957 - RalfJung:zst-are-different, r=lcnr,oli-obk 2022-07-09 17:16:00 +00:00
rustc_mir_build tweak names and output and bless 2022-07-09 07:43:56 -04:00
rustc_mir_dataflow Rollup merge of #99022 - pierwill:always-storage-live-locals, r=pierwill 2022-07-09 12:52:50 +02:00
rustc_mir_transform Rollup merge of #99022 - pierwill:always-storage-live-locals, r=pierwill 2022-07-09 12:52:50 +02:00
rustc_monomorphize
rustc_parse Auto merge of #98638 - bjorn3:less_string_interning, r=tmiasko 2022-07-08 10:03:27 +00:00
rustc_parse_format
rustc_passes
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system Auto merge of #99028 - tmiasko:inline, r=estebank 2022-07-09 04:34:51 +00:00
rustc_resolve Rollup merge of #99008 - obeis:issue-98974, r=compiler-errors 2022-07-09 11:28:06 +05:30
rustc_save_analysis
rustc_serialize
rustc_session Implement support for DWARF version 5. 2022-07-08 11:31:08 -07:00
rustc_smir
rustc_span Auto merge of #99028 - tmiasko:inline, r=estebank 2022-07-09 04:34:51 +00:00
rustc_symbol_mangling
rustc_target Rollup merge of #99043 - compiler-errors:derive-nit, r=cjgillot 2022-07-09 11:28:07 +05:30
rustc_trait_selection don't allow ZST in ScalarInt 2022-07-09 07:27:29 -04:00
rustc_traits
rustc_ty_utils
rustc_type_ir Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiser 2022-07-08 17:55:26 +00:00
rustc_typeck Rollup merge of #99048 - TaKO8Ki:remove-type-string-comparison, r=compiler-errors 2022-07-09 11:28:08 +05:30