Commit Graph

169277 Commits

Author SHA1 Message Date
Dylan DPC
025cf96615
Rollup merge of #97366 - WaffleLapkin:stabilize_array_slice_from_ref, r=dtolnay
Stabilize `{slice,array}::from_ref`

This PR stabilizes the following APIs as `const` functions in Rust `1.63`:
```rust
// core::array
pub const fn from_ref<T>(s: &T) -> &[T; 1];

// core::slice
pub const fn from_ref<T>(s: &T) -> &[T];
```

Note that the `mut` versions are not stabilized as unique references (`&mut _`) are [unstable in const context].

FCP: https://github.com/rust-lang/rust/issues/90206#issuecomment-1134586665

r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs

[unstable in const context]: https://github.com/rust-lang/rust/issues/57349
2022-06-03 11:18:23 +02:00
bors
f5507aa881 Auto merge of #97497 - c410-f3r:z-errors, r=petrochenkov
Move some tests to more reasonable places

r? `@petrochenkov`
2022-06-03 04:46:10 +00:00
bors
20ad820928 Auto merge of #97667 - matthiaskrgr:rollup-5cfxc85, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #97502 (rustdoc: Add more test coverage)
 - #97627 (update explicit impls error msg)
 - #97640 (Fix wrong suggestion for adding where clauses)
 - #97645 (don't use a `span_note` for ignored impls)
 - #97655 (Improve documentation for constructors of pinned `Box`es)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-03 00:21:29 +00:00
Matthias Krüger
5b64aab2b6
Rollup merge of #97655 - steffahn:better-pin-box-construction-docs, r=thomcc
Improve documentation for constructors of pinned `Box`es

Adds a cross-references between `Box::pin` and `Box::into_pin` (and other related methods, i.e. the equivalent `From` implementation, and the unstable `pin_in` method), in particular now that `into_pin` [was stabilized](https://github.com/rust-lang/rust/pull/97397). The main goal is to further improve visibility of the fact that `Box<T> -> Pin<Box<T>>` conversion exits in the first place, and that `Box::pin(x)` is – essentially – just a convenience function for `Box::into_pin(Box::new(x))`

The motivating context why I think this is important is even experienced Rust users overlooking the existence this kind of conversion, [e.g. in this thread on IRLO](https://internals.rust-lang.org/t/pre-rfc-function-variants/16732/7?u=steffahn); and also the fact that that discussion brought up that there would be a bunch of Box-construction methods "missing" such as e.g. methods with fallible allocation a la "`Box::try_pin`", and similar; while those are in fact *not* necessary, because you can use `Box::into_pin(Box::try_new(x)?)` instead.

I have *not* included explicit mention of methods (e.g. `try_new`) in the docs of stable methods (e.g. `into_pin`). (Referring to unstable API in stable API docs would be bad style IMO.) Stable examples I have in mind with the statement "constructing a (pinned) Box in a different way than with `Box::new`" are things like cloning a `Box`, or `Box::from_raw`. If/when `try_new` would get stabilized, it would become a very good concrete example use-case of `Box::into_pin` IMO.
2022-06-02 23:39:07 +02:00
Matthias Krüger
d1ae3a4c3b
Rollup merge of #97645 - lcnr:derived-impl-debug, r=cjgillot
don't use a `span_note` for ignored impls

Searching for the `derive` isn't too difficult as it's right above the field definition.

By using a span these errors are a lot more verbose than they should be, which is especially annoying as one can end up with a lot of `dead_code` warnings.
2022-06-02 23:39:06 +02:00
Matthias Krüger
0e33e97fc7
Rollup merge of #97640 - TaKO8Ki:fix-wrong-suggestion-for-adding-where-clauses, r=lcnr
Fix wrong suggestion for adding where clauses

closes #97576
2022-06-02 23:39:05 +02:00
Matthias Krüger
992ca9b601
Rollup merge of #97627 - lcnr:comment-tick, r=Dylan-DPC
update explicit impls error msg
2022-06-02 23:39:04 +02:00
Matthias Krüger
ba54e75b55
Rollup merge of #97502 - onlineSoftwareDevOK:rustdocTests, r=GuillaumeGomez
rustdoc: Add more test coverage

Related issue https://github.com/rust-lang/rust/issues/91113
2022-06-02 23:39:03 +02:00
bors
42bcd41d4d Auto merge of #97598 - spastorino:simplify-universal-impl-trait-lowering, r=cjgillot
Simplify universal impl trait lowering

Closes #96644

r? `@cjgillot`
2022-06-02 21:37:38 +00:00
bors
e71440575c Auto merge of #97575 - nnethercote:lazify-SourceFile-lines, r=Mark-Simulacrum
Lazify `SourceFile::lines`.

`SourceFile::lines` is a big part of metadata. It's stored in a compressed form
(a difference list) to save disk space. Decoding it is a big fraction of
compile time for very small crates/programs.

This commit introduces a new type `SourceFileLines` which has a `Lines`
form and a `Diffs` form. The latter is used when the metadata is first
read, and it is only decoded into the `Lines` form when line data is
actually needed. This avoids the decoding cost for many files,
especially in `std`. It's a performance win of up to 15% for tiny
crates/programs where metadata decoding is a high part of compilation
costs.

A `RefCell` is needed because the methods that access lines data (which can
trigger decoding) take `&self` rather than `&mut self`. To allow for this,
`SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather
than returning the lines slice.

r? `@Mark-Simulacrum`
2022-06-02 18:45:29 +00:00
bors
44e9516c85 Auto merge of #97654 - Dylan-DPC:rollup-w6zrzxf, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #97420 (Be a little nicer with casts when formatting `fn` pointers)
 - #97450 ([RFC 2011] Basic compiler infrastructure)
 - #97599 (Fix JSON reexport ICE)
 - #97617 (Rustdoc anonymous reexports)
 - #97636 (Revert #96682.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-02 16:04:42 +00:00
onlinesoftwaredevok@protonmail.com
9292c907fa rustdoc: Add more test coverage 2022-06-02 11:50:36 -03:00
Frank Steffahn
6e2ac5df31 Improve documentation for constructors of pinned Boxes 2022-06-02 15:32:48 +02:00
Dylan DPC
1d71237646
Rollup merge of #97636 - nnethercote:revert-96682, r=dtolnay
Revert #96682.

The change was "Show invisible delimiters (within comments) when pretty
printing". It's useful to show these delimiters, but is a breaking
change for some proc macros.

Fixes #97608.

r? ``@petrochenkov``
2022-06-02 15:27:01 +02:00
Dylan DPC
f95e2d34c3
Rollup merge of #97617 - GuillaumeGomez:rustdoc-anonymous-reexports, r=Nemo157
Rustdoc anonymous reexports

Fixes #97615.

r? `@Nemo157`
2022-06-02 15:27:00 +02:00
Dylan DPC
f22f7431c2
Rollup merge of #97599 - GuillaumeGomez:reexport-json, r=CraftSpider
Fix JSON reexport ICE

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

The problem was that the ID was conflicting because the reexports have the same one. To fix it, I "extended" it by adding the `Symbol` into it as well.

r? `@notriddle`
2022-06-02 15:26:59 +02:00
Dylan DPC
15bf62b475
Rollup merge of #97450 - c410-f3r:assert-compiler, r=oli-obk
[RFC 2011] Basic compiler infrastructure

Splitting https://github.com/rust-lang/rust/pull/96496 into smaller pieces as was done in https://github.com/rust-lang/rust/pull/97233. Hope review will be easier.

This PR practically contains no logic and only serves as a building ground for the actual code that will be placed in a posterior step.

* Adds `context.rs` to place the new `assert!` logic. Has a lot of unused elements but all of them are used by the implementation.
* Creates an unstable flag because the feature is not yet complete and also to allow external feedback.
* Creates the necessary `sym` identifiers that are mostly based on the library elements -> https://github.com/rust-lang/rust/blob/master/library/core/src/asserting.rs
* Modifies `assert.rs` to branch to `context.rs` if the unstable flag is enabled.
* Adds a test to satisfy tidy but the test does nothing in reality.
2022-06-02 15:26:58 +02:00
Dylan DPC
0b2d48e5af
Rollup merge of #97420 - WaffleLapkin:no_oxford_casts_qqq, r=Mark-Simulacrum
Be a little nicer with casts when formatting `fn` pointers

This removes a `fn(...) -> ...` -> `usize` -> `*const ()` -> `usize` cast. cc #95489.
2022-06-02 15:26:57 +02:00
bors
20976bae5c Auto merge of #97293 - est31:remove_box, r=oli-obk
Add #[rustc_box] and use it inside alloc

This commit adds an alternative content boxing syntax, and uses it inside alloc.

```Rust
#![feature(box_syntax)]

fn foo() {
    let foo = box bar;
}
```

is equivalent to

```Rust
#![feature(rustc_attrs)]

fn foo() {
    let foo = #[rustc_box] Box::new(bar);
}
```

The usage inside the very performance relevant code in
liballoc is the only remaining relevant usage of box syntax
in the compiler (outside of tests, which are comparatively easy to port).

box syntax was originally designed to be used by all Rust
developers. This introduces a replacement syntax more tailored
to only being used inside the Rust compiler, and with it,
lays the groundwork for eventually removing box syntax.

[Earlier work](https://github.com/rust-lang/rust/pull/87781#issuecomment-894714878) by `@nbdd0121` to lower `Box::new` to `box` during THIR -> MIR building ran into borrow checker problems, requiring the lowering to be adjusted in a way that led to [performance regressions](https://github.com/rust-lang/rust/pull/87781#issuecomment-894872367). The proposed change in this PR lowers `#[rustc_box] Box::new` -> `box` in the AST -> HIR lowering step, which is way earlier in the compiler, and thus should cause less issues both performance wise as well as regarding type inference/borrow checking/etc. Hopefully, future work can move the lowering further back in the compiler, as long as there are no performance regressions.
2022-06-02 13:20:19 +00:00
Caio
aa115eba12 Basic compiler infra 2022-06-02 09:00:04 -03:00
Takayuki Maeda
28988902a2 fix wrong suggestion for adding where clauses 2022-06-02 20:50:01 +09:00
bors
9598b4b594 Auto merge of #97644 - Dylan-DPC:rollup-xaeio91, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #96894 (Apply track_caller to closure on `expect_non_local()`)
 - #97023 (Diagnose anonymous lifetimes errors more uniformly between async and regular fns)
 - #97397 (Stabilize `box_into_pin`)
 - #97587 (Migrate more diagnostics to use the `#[derive(SessionDiagnostic)]`)
 - #97603 (Arc make_mut doc comment spelling correction.)
 - #97635 (Fix file metadata documentation for Windows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-02 10:39:24 +00:00
Guillaume Gomez
5adca7305e Add regression test for json reexport bug 2022-06-02 11:14:33 +02:00
Guillaume Gomez
77e729ea92 Add Symbol into rustdoc JSON ID to prevent conflicts between reexports 2022-06-02 11:14:32 +02:00
lcnr
d7645f4245 don't use a span_note for ignored impls 2022-06-02 11:13:31 +02:00
Dylan DPC
fa79247826
Rollup merge of #97635 - rgwood:patch-1, r=ChrisDenton
Fix file metadata documentation for Windows

I noticed that the documentation for `fs::symlink_metadata()` and `fs::metadata()` is incorrect; [the underlying code](481db40311/library/std/src/sys/windows/fs.rs (L334)) calls [`GetFileInformationByHandle()`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileinformationbyhandle) on Windows, not [`GetFileAttributesEx()`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileattributesexw). There are currently [no uses of `GetFileAttributesEx()` in this repo](https://github.com/rust-lang/rust/search?q=GetFileAttributesEx).
2022-06-02 11:13:26 +02:00
Dylan DPC
eb642d48ee
Rollup merge of #97603 - ximon18:arc-make-mut-spelling-correction, r=GuillaumeGomez
Arc make_mut doc comment spelling correction.
2022-06-02 11:13:25 +02:00
Dylan DPC
19dc28c23e
Rollup merge of #97587 - pvdrz:maybe-recover-from-bad-qpath-stage-2, r=davidtwco
Migrate more diagnostics to use the `#[derive(SessionDiagnostic)]`

r? ``@davidtwco``
2022-06-02 11:13:24 +02:00
Dylan DPC
9225f78b74
Rollup merge of #97397 - JohnTitor:stabilize-box-into-pin, r=Mark-Simulacrum
Stabilize `box_into_pin`

FCP has been completed: https://github.com/rust-lang/rust/issues/62370#issuecomment-1012162279
Also, adds notes as per https://github.com/rust-lang/rust/issues/62370#issuecomment-1004108116
Closes #62370
2022-06-02 11:13:23 +02:00
Dylan DPC
5c041f98fa
Rollup merge of #97023 - cjgillot:uniform-anon, r=estebank
Diagnose anonymous lifetimes errors more uniformly between async and regular fns

Async fns and regular fns are desugared differently.  For the former, we create a generic parameter at HIR level.  For the latter, we just create an anonymous region for typeck.

I plan to migrate regular fns to the async fn desugaring.

Before that, this PR attempts to merge the diagnostics for both cases.

r? ```@estebank```
2022-06-02 11:13:22 +02:00
Dylan DPC
ddc5d2c9d2
Rollup merge of #96894 - JohnTitor:expect-non-local-track-caller, r=petrochenkov
Apply track_caller to closure on `expect_non_local()`

r? `@petrochenkov`

Alternatively we could remove the closure by replicating the same logic of `map_id()`. I'm happy to switch to it if you'd like.
2022-06-02 11:13:21 +02:00
bors
5e6bb83268 Auto merge of #96737 - ChrisDenton:win-manifest, r=wesleywiser
Add Windows application manifest to rustc-main

Windows allows setting some runtime options using a manifest file. The format of the XML file is documented here: https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests

The manifest file in this PR does three things:

* Declares which Windows versions we support. This may help avoid unnecessary compatibility shims.
* Uses the UTF-8 code page. While Rust itself uses UTF-16 APIs, other code may rely on the code page.
* Makes the application long path aware (if also enabled by the user). This allows for the current directory to be longer than `PATH_MAX`.

These changes only affect the `rustc` process and not any other DLLs or compiled programs.
2022-06-02 07:58:29 +00:00
bors
fb1976011e Auto merge of #97414 - LYF1999:yf/cachealign, r=Mark-Simulacrum
use 128 cache align for aarch64

the cache line size of m1 mac is 128.
so use `align(128)` for m1 mac

here is `sysctl -a hw machdep.cpu` output on m1 mac
```
hw.ncpu: 10
hw.byteorder: 1234
hw.memsize: 68719476736
hw.activecpu: 10
hw.perflevel0.physicalcpu: 8
hw.perflevel0.physicalcpu_max: 8
hw.perflevel0.logicalcpu: 8
hw.perflevel0.logicalcpu_max: 8
hw.perflevel0.l1icachesize: 196608
hw.perflevel0.l1dcachesize: 131072
hw.perflevel0.l2cachesize: 12582912
hw.perflevel0.cpusperl2: 4
hw.perflevel1.physicalcpu: 2
hw.perflevel1.physicalcpu_max: 2
hw.perflevel1.logicalcpu: 2
hw.perflevel1.logicalcpu_max: 2
hw.perflevel1.l1icachesize: 131072
hw.perflevel1.l1dcachesize: 65536
hw.perflevel1.l2cachesize: 4194304
hw.perflevel1.cpusperl2: 2
hw.optional.arm.FEAT_FlagM: 1
hw.optional.arm.FEAT_FlagM2: 1
hw.optional.arm.FEAT_FHM: 1
hw.optional.arm.FEAT_DotProd: 1
hw.optional.arm.FEAT_SHA3: 1
hw.optional.arm.FEAT_RDM: 1
hw.optional.arm.FEAT_LSE: 1
hw.optional.arm.FEAT_SHA256: 1
hw.optional.arm.FEAT_SHA512: 1
hw.optional.arm.FEAT_SHA1: 1
hw.optional.arm.FEAT_AES: 1
hw.optional.arm.FEAT_PMULL: 1
hw.optional.arm.FEAT_SPECRES: 0
hw.optional.arm.FEAT_SB: 1
hw.optional.arm.FEAT_FRINTTS: 1
hw.optional.arm.FEAT_LRCPC: 1
hw.optional.arm.FEAT_LRCPC2: 1
hw.optional.arm.FEAT_FCMA: 1
hw.optional.arm.FEAT_JSCVT: 1
hw.optional.arm.FEAT_PAuth: 1
hw.optional.arm.FEAT_PAuth2: 0
hw.optional.arm.FEAT_FPAC: 0
hw.optional.arm.FEAT_DPB: 1
hw.optional.arm.FEAT_DPB2: 1
hw.optional.arm.FEAT_BF16: 0
hw.optional.arm.FEAT_I8MM: 0
hw.optional.arm.FEAT_ECV: 1
hw.optional.arm.FEAT_LSE2: 1
hw.optional.arm.FEAT_CSV2: 1
hw.optional.arm.FEAT_CSV3: 1
hw.optional.arm.FEAT_FP16: 1
hw.optional.arm.FEAT_SSBS: 1
hw.optional.arm.FEAT_BTI: 0
hw.optional.floatingpoint: 1
hw.optional.neon: 1
hw.optional.neon_hpfp: 1
hw.optional.neon_fp16: 1
hw.optional.armv8_1_atomics: 1
hw.optional.armv8_2_fhm: 1
hw.optional.armv8_2_sha512: 1
hw.optional.armv8_2_sha3: 1
hw.optional.armv8_3_compnum: 1
hw.optional.watchpoint: 4
hw.optional.breakpoint: 6
hw.optional.armv8_crc32: 1
hw.optional.armv8_gpi: 1
hw.optional.AdvSIMD: 1
hw.optional.AdvSIMD_HPFPCvt: 1
hw.optional.ucnormal_mem: 1
hw.optional.arm64: 1
hw.features.allows_security_research: 0
hw.physicalcpu: 10
hw.physicalcpu_max: 10
hw.logicalcpu: 10
hw.logicalcpu_max: 10
hw.cputype: 16777228
hw.cpusubtype: 2
hw.cpu64bit_capable: 1
hw.cpufamily: 458787763
hw.cpusubfamily: 5
hw.cacheconfig: 10 1 2 0 0 0 0 0 0 0
hw.cachesize: 3373957120 65536 4194304 0 0 0 0 0 0 0
hw.pagesize: 16384
hw.pagesize32: 16384
hw.cachelinesize: 128
hw.l1icachesize: 131072
hw.l1dcachesize: 65536
hw.l2cachesize: 4194304
hw.tbfrequency: 24000000
hw.packages: 1
hw.osenvironment:
hw.ephemeral_storage: 0
hw.use_recovery_securityd: 0
hw.use_kernelmanagerd: 1
hw.serialdebugmode: 0
hw.nperflevels: 2
hw.targettype: J316c
machdep.cpu.cores_per_package: 10
machdep.cpu.core_count: 10
machdep.cpu.logical_per_package: 10
machdep.cpu.thread_count: 10
machdep.cpu.brand_string: Apple M1 Max
```
2022-06-02 04:14:02 +00:00
Nicholas Nethercote
72de7c4102 Address review comments. 2022-06-02 12:22:04 +10:00
Nicholas Nethercote
77e1069a5d Revert #96682.
The change was "Show invisible delimiters (within comments) when pretty
printing". It's useful to show these delimiters, but is a breaking
change for some proc macros.

Fixes #97608.
2022-06-02 11:22:16 +10:00
Reilly Wood
0835dfe579
Fix Windows file metadata docs
Retrieving file metadata on Windows now uses GetFileInformationByHandle not GetFileAttributesEx
2022-06-01 20:32:33 -04:00
bors
e838059d66 Auto merge of #97632 - JohnTitor:rollup-d2ucrjw, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #95594 (Additional `*mut [T]` methods)
 - #97130 (rustdoc: avoid including impl blocks with filled-in generics)
 - #97166 (Move conditions out of recover/report functions.)
 - #97605 (Mention filename in suggestion when it differs from primary span)
 - #97613 (rustdoc: Improve calculation of "Impls on Foreign Types")
 - #97626 (rename PointerAddress → PointerExposeAddress)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-01 22:34:38 +00:00
Yuki Okushi
572c39000b
Stabilize box_into_pin 2022-06-02 07:24:14 +09:00
Guillaume Gomez
1d12b7eb29 Add test for anonymous reexports 2022-06-01 23:46:07 +02:00
Yuki Okushi
b78c118b09
Rollup merge of #97626 - RalfJung:expose, r=tmiasko
rename PointerAddress → PointerExposeAddress

`PointerAddress` sounds a bit too much like `ptr.addr()`, but this corresponds to `ptr.expose_addr()`.

r? `@tmiasko`
2022-06-02 06:44:29 +09:00
Yuki Okushi
a96e71c752
Rollup merge of #97613 - jsha:implementation-is-on-local-type, r=GuillaumeGomez
rustdoc: Improve calculation of "Impls on Foreign Types"

The existing code to calculate whether an implementation was on a "Foreign Type" was duplicated across the sidebar generation and the page generation. It also came to the wrong conclusion for some cases where both the trait and the "for" type were re-exports.

This PR extracts the logic into a method of `Impl`, breaks it into a multi-line method so it can be commented, and adds a case for when the trait and the "for" type came from the same crate. This fixes some cases - like the platform-specific integer types (`__m256`, `__m128`, etc). But it doesn't fix all cases. See the screenshots below.

[Before](https://doc.rust-lang.org/nightly/std/clone/trait.Clone.html#foreign-impls):

<img src="https://user-images.githubusercontent.com/220205/171338226-59ce6daf-3d76-4bad-bc8d-72a8259a8f43.png" width=200>

[After](https://rustdoc.crud.net/jsha/implementation-is-on-local-type/std/clone/trait.Clone.html):

<img src="https://user-images.githubusercontent.com/220205/171338147-28308a65-1597-4223-be47-9550062404dd.png" width=200>

The remaining types (`CString`, `NulError`, etc) are all from the `alloc` crate, while the `Clone` trait is from the `core` crate. Since `CString` and `Clone` are both re-exported by `std`, they are logically local to each other, but I couldn't figure out a good way to detect that in this code. I figure this is still a good step forward.

Related: #97610

r? `@camelid`
2022-06-02 06:44:29 +09:00
Yuki Okushi
2c1990d0b8
Rollup merge of #97605 - estebank:suggestion-filename, r=oli-obk
Mention filename in suggestion when it differs from primary span
2022-06-02 06:44:28 +09:00
Yuki Okushi
d126de111b
Rollup merge of #97166 - nnethercote:move-conditions-out, r=estebank
Move conditions out of recover/report functions.

`Parser` has six recover/report functions that are passed a boolean, and
nothing is done if the boolean has a particular value.

This PR moves the tests outside the functions. This has the following effects.
- The number of lines of code goes down.
- Some `use` items become shorter.
- Avoids the strangeness whereby 11 out of 12 calls to
  `maybe_recover_from_bad_qpath` pass `true` as the second argument.
- Makes it clear at the call site that only one of
  `maybe_recover_from_bad_type_plus` and `maybe_report_ambiguous_plus` will be
  run.

r? `@estebank`
2022-06-02 06:44:27 +09:00
Yuki Okushi
9fc3fc3a0c
Rollup merge of #97130 - notriddle:notriddle/collect-trait-impls-dup, r=GuillaumeGomez
rustdoc: avoid including impl blocks with filled-in generics

Fixes #94937

# Before

![image](https://user-images.githubusercontent.com/1593513/168933282-02ccc4ae-9c89-4836-ba34-e2bd83946105.png)

# After

![image](https://user-images.githubusercontent.com/1593513/168933255-4c17407d-d8d1-406e-87f5-9ea809437173.png)
2022-06-02 06:44:26 +09:00
Yuki Okushi
3ed9bbe970
Rollup merge of #95594 - the8472:raw_slice_methods, r=yaahc
Additional `*mut [T]` methods

Split out from #94247

This adds the following methods to raw slices that already exist on regular slices

* `*mut [T]::is_empty`
* `*mut [T]::split_at_mut`
* `*mut [T]::split_at_mut_unchecked`

These methods reduce the amount of unsafe code needed to migrate `ChunksMut` and related iterators
to raw slices (#94247)

r? `@m-ou-se`
2022-06-02 06:44:25 +09:00
bors
12cd71f4d3 Auto merge of #97612 - ehuss:update-cargo, r=ehuss
Update cargo

5 commits in 39ad1039d9e3e1746177bf5d134af4c164f95528..38472bc19f2f76e245eba54a6e97ee6821b3c1db
2022-05-25 00:50:02 +0000 to 2022-05-31 02:03:24 +0000
- Emit warning upon encountering multiple packages with the same name (rust-lang/cargo#10701)
- Guide new users to add use `super::*;` to `mod test` (rust-lang/cargo#10706)
- Document how to debug change detection events (rust-lang/cargo#10708)
- fix(publish): add more check when use `publish -p &lt;SPEC&gt;` (rust-lang/cargo#10677)
- fix key formatting when switching to a dotted `WorkspaceSource` (rust-lang/cargo#10705)
2022-06-01 20:06:14 +00:00
Santiago Pastorino
15a82d6917
Always assert that impl_trait_def|bounds are empty at start 2022-06-01 15:38:37 -03:00
lcnr
79c3011d9d update explicit impls error msg 2022-06-01 20:36:20 +02:00
Ralf Jung
4dc5d457d8 rename PointerAddress → PointerExposeAddress 2022-06-01 14:08:17 -04:00
Santiago Pastorino
67deaf9fea
instrument lower_fn_decl 2022-06-01 15:02:15 -03:00