rust/library
bors 7abab1efb2 Auto merge of #91838 - scottmcm:array-slice-eq-via-arrays-not-slices, r=dtolnay
Do array-slice equality via array equality, rather than always via slices

~~Draft because it needs a rebase after #91766 eventually gets through bors.~~

This enables the optimizations from #85828 to be used for array-to-slice comparisons too, not just array-to-array.

For example, <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=5f9ba69b3d5825a782f897c830d3a6aa>
```rust
pub fn demo(x: &[u8], y: [u8; 4]) -> bool {
    *x == y
}
```
Currently writes the array to stack for no reason:
```nasm
	sub	rsp, 4
	mov	dword ptr [rsp], edx
	cmp	rsi, 4
	jne	.LBB0_1
	mov	eax, dword ptr [rdi]
	cmp	eax, dword ptr [rsp]
	sete	al
	add	rsp, 4
	ret

.LBB0_1:
	xor	eax, eax
	add	rsp, 4
	ret
```
Whereas with the change in this PR it just compares it directly:
```nasm
	cmp	rsi, 4
	jne	.LBB1_1
	cmp	dword ptr [rdi], edx
	sete	al
	ret

.LBB1_1:
	xor	eax, eax
	ret
```
2021-12-17 19:17:29 +00:00
..
alloc Auto merge of #91527 - the8472:retain-opt, r=dtolnay 2021-12-16 07:58:36 +00:00
backtrace@b02ed04a7e Updated backtrace submodule 2021-11-02 12:31:34 +01:00
core Auto merge of #91838 - scottmcm:array-slice-eq-via-arrays-not-slices, r=dtolnay 2021-12-17 19:17:29 +00:00
panic_abort Stabilize asm! and global_asm! 2021-12-12 11:20:03 +00:00
panic_unwind Fix a bunch of typos 2021-12-14 16:40:43 +01:00
portable-simd Merge commit 'a8385522ade6f67853edac730b5bf164ddb298fd' into simd-remove-autosplats 2021-12-02 18:27:47 -08:00
proc_macro made compiler happy 2021-12-14 16:42:16 +05:30
profiler_builtins rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rtstartup
rustc-std-workspace-alloc rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-core rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
rustc-std-workspace-std rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00
std Rollup merge of #91947 - ibraheemdev:io-error-other, r=joshtriplett 2021-12-16 17:23:10 +01:00
stdarch@0716b22e90 update stdarch 2021-12-15 10:22:03 +08:00
test Update more rustc/libtest things for wasm64 2021-11-10 08:35:42 -08:00
unwind Android: -ldl must appear after -lgcc when linking 2021-11-30 02:42:35 +00:00