rust/src
bors 9fed13030c Auto merge of #94954 - SimonSapin:null-thin3, r=yaahc
Extend ptr::null and null_mut to all thin (including extern) types

Fixes https://github.com/rust-lang/rust/issues/93959

This change was accepted in https://rust-lang.github.io/rfcs/2580-ptr-meta.html

Note that this changes the signature of **stable** functions. The change should be backward-compatible, but it is **insta-stable** since it cannot (easily, at all?) be made available only through a `#![feature(…)]` opt-in.

The RFC also proposed the same change for `NonNull::dangling`, which makes sense it terms of its signature but not in terms of its implementation. `dangling` uses `align_of()` as an address. But what `align_of()` should be for extern types or whether it should be allowed at all remains an open question.

This commit depends on https://github.com/rust-lang/rust/pull/93977, which is not yet part of the bootstrap compiler. So `#[cfg]` is used to only apply the change in stage 1+. As far a I know bounds cannot be made conditional with `#[cfg]`, so the entire functions are duplicated. This is unfortunate but temporary.

Since this duplication makes it less obvious in the diff, the new definitions differ in:

* More permissive bounds (`Thin` instead of implied `Sized`)
* Different implementation
* Having `rustc_allow_const_fn_unstable(const_fn_trait_bound)`
* Having `rustc_allow_const_fn_unstable(ptr_metadata)`
2022-05-25 13:58:51 +00:00
..
bootstrap Make llvm-libunwind a per-target option 2022-05-24 15:58:45 -07:00
ci Add bitmaps and diesel to rustc PGO benchmarks 2022-05-23 17:55:50 +02:00
doc Remove feature: crate visibility modifier 2022-05-21 14:22:06 -04:00
etc Read the Ref/RefMut pointer in natvis 2022-05-16 17:39:34 -07:00
librustdoc Auto merge of #97365 - klensy:rustdoc-vs-clippy, r=notriddle 2022-05-25 01:12:54 +00:00
llvm-project@4784866596 Update LLVM submodule 2022-05-12 10:17:27 +02:00
rustdoc-json-types rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate 2022-05-04 21:03:01 +02:00
test Auto merge of #94954 - SimonSapin:null-thin3, r=yaahc 2022-05-25 13:58:51 +00:00
tools update Miri 2022-05-24 17:44:11 +02:00
README.md
stage0.json Bump stage 0 to new beta 2022-05-18 11:38:34 -04:00
version Bump to 1.63 2022-05-13 10:08:03 -04: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.