rust/src
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
..
bootstrap Update submodule rust-installer 2022-07-09 09:49:05 -07:00
ci Auto merge of #98439 - ehuss:cleanup-ci-script, r=Mark-Simulacrum 2022-07-03 19:39:28 +00:00
doc Implement support for DWARF version 5. 2022-07-08 11:31:08 -07:00
etc Rollup merge of #95446 - notseanray:master, r=Mark-Simulacrum 2022-06-22 15:16:08 +09:00
librustdoc Rollup merge of #95635 - davidtwco:terminal-width-stabilization, r=oli-obk 2022-07-08 08:00:36 +02:00
llvm-project@8b6b5014fd Update llvm-project 2022-07-05 17:57:29 +02:00
rustdoc-json-types rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate 2022-05-04 21:03:01 +02:00
test Auto merge of #97522 - xfix:stabilize-slice-from-raw-parts, r=dtolnay 2022-07-10 06:26:03 +00:00
tools Fix epage's nits 2022-07-09 09:49:05 -07:00
README.md
stage0.json bump stage0 compiler 2022-06-29 15:35:30 +02:00
version bump version to 1.64.0 2022-06-24 17:27:24 +02:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.