Commit Graph

252154 Commits

Author SHA1 Message Date
DianQK
928c57dc9a
Add test case for #119014 2024-04-08 19:20:04 +08:00
DianQK
f4407370db
Change the return type of can_simplify to Option<()> 2024-04-08 19:09:57 +08:00
DianQK
032bb742ab
Add comments for CompareType 2024-04-08 19:07:53 +08:00
DianQK
254289a16e
Updating the MIR with MirPatch 2024-04-08 19:04:11 +08:00
DianQK
e752af765e
Transforms a match containing negative numbers into an assignment statement as well 2024-04-08 19:00:57 +08:00
DianQK
1f061f47e2
Transforms match into an assignment statement 2024-04-08 19:00:53 +08:00
DianQK
7af7458453
Refactor MatchBranchSimplification 2024-04-08 18:54:42 +08:00
DianQK
badb73b921
Update matches_reduce_branches.rs 2024-04-08 18:54:33 +08:00
Guillaume Gomez
66bc97cc88 Make theme switching closer to reality 2024-04-08 12:14:41 +02:00
Guillaume Gomez
cf65764920 Update browser-ui-test version to 0.17.2 2024-04-08 12:14:26 +02:00
Philippe-Cholet
7a2678de7d Add invariant to VecDeque::pop_* that len < cap if pop successful
Similar to #114370 for VecDeque instead of Vec. It now uses `core::hint::assert_unchecked`.
2024-04-08 12:12:13 +02:00
bors
0e5f520788 Auto merge of #123577 - Urgau:prep-work-for-compiletest-check-cfg, r=oli-obk
Do some preparation work for compiletest check-cfg

This PR does several preparation work for having always-on check-cfg in compiletest.

In particular, this PR does two main things:
 - It unifies all the *always-false* cfgs under the `FALSE` cfg (as it seems to be the convention under `tests/ui`)
 - It also removes some useless conditions

This is done ahead of the introduction of the always-on check-cfg in compiletest to reduce the amount of changes in that follow-up work. I also think that this is useful even without that follow-up work.
2024-04-08 09:34:44 +00:00
bors
7a495cc13d Auto merge of #123616 - bzEq:fix-be-test, r=jhpratt
[Test] issue-122805.rs should limit to little endian target

In issue-122805.rs, codegen on big endian target is different from little endian target.
```llvm
%0 = load <8 x i16>, ptr %value, align 2
store <8 x i16> %0, ptr %_0, align 1
ret void
```
This is expected since the conversion is unnecessary on BE target for this case.
2024-04-08 04:16:16 +00:00
Kai Luo
d8d1e6ce21 Limited to little endian target 2024-04-08 11:11:11 +08:00
Nikita Popov
1b7342b411 force_array -> is_consecutive
The actual ABI implication here is that in some cases the values
are required to be "consecutive", i.e. must either all be passed
in registers or all on stack (without padding).

Adjust the code to either use Uniform::new() or Uniform::consecutive()
depending on which behavior is needed.

Then, when lowering this in LLVM, skip the [1 x i128] to i128
simplification if is_consecutive is set. i128 is the only case
I'm aware of where this is problematic right now. If we find
other cases, we can extend this (either based on target information
or possibly just by not simplifying for is_consecutive entirely).
2024-04-08 11:31:43 +09:00
Nikita Popov
009280c5e3 Fix argument ABI for overaligned structs on ppc64le
When passing a 16 (or higher) aligned struct by value on ppc64le,
it needs to be passed as an array of `i128` rather than an array
of `i64`. This will force the use of an even starting register.

For the case of a 16 byte struct with alignment 16 it is important
that `[1 x i128]` is used instead of `i128` -- apparently, the
latter will get treated similarly to `[2 x i64]`, not exhibiting
the correct ABI. Add a `force_array` flag to `Uniform` to support
this.

The relevant clang code can be found here:
fe2119a7b0/clang/lib/CodeGen/Targets/PPC.cpp (L878-L884)
fe2119a7b0/clang/lib/CodeGen/Targets/PPC.cpp (L780-L784)

I think the corresponding psABI wording is this:

> Fixed size aggregates and unions passed by value are mapped to as
> many doublewords of the parameter save area as the value uses in
> memory. Aggregrates and unions are aligned according to their
> alignment requirements. This may result in doublewords being
> skipped for alignment.

In particular the last sentence.

Fixes https://github.com/rust-lang/rust/issues/122767.
2024-04-08 11:15:36 +09:00
bors
f2c8013393 Auto merge of #123569 - c410-f3r:testsssssss, r=jieyouxu
Move some tests

r? `@petrochenkov`
2024-04-08 02:13:05 +00:00
bors
a2c72ce594 Auto merge of #123506 - RalfJung:miri-test-libstd, r=Mark-Simulacrum
check-aux: test core, alloc, std in Miri

Let's see if this works, and how long it takes.
2024-04-08 00:08:44 +00:00
Mark Rousskov
f946bf4f2e Remove debuginfo from rustc-demangle too
This is done for the same reason as the other dependencies in this list.
2024-04-07 19:19:11 -04:00
bors
f65f84feb0 Auto merge of #123597 - Gbd199:patch-1, r=jhpratt
Fix typo in library/core/src/iter/traits/iterator.rs
2024-04-07 22:04:40 +00:00
Ben Kimock
da09eadbab Only traverse mono-reachable blocks in cg_clif 2024-04-07 16:46:21 -04:00
Ben Kimock
b5b49289e1 Only traverse mono-reachable blocks in cg_clif 2024-04-07 16:46:21 -04:00
Caio
ab8994d93e Move tests 2024-04-07 17:38:07 -03:00
Ben Kimock
339f4be046 Only collect mono items from reachable blocks 2024-04-07 14:36:42 -04:00
bors
9d5cdf75aa Auto merge of #123601 - jieyouxu:compiletest-run-rustfix-revisions, r=WaffleLapkin
compiletest: properly handle revisioned run-rustfix tests

Before this PR, if you have a revisioned `//@ run-rustfix` test like `//`@[foo]` run-rustfix`, you would run into an error saying crate name cannot contain `.` characters because the fixed test file trying to be compiled is named `<test-name>.<revision>.fixed`, from which `rustc` infers the crate name to be `<test-name>.<revision>` which is not a valid crate name.

This PR fixes the problem by constructing a synthetic crate name from `<test-name>.<revision>`, by

1. replacing all `-` with `_`, and
2. replacing all `.` with `__`

and pass that constructed crate name with `--crate-name` to rustc to compile the fixed file.

Fixes https://github.com/rust-lang/rust/issues/123596.
2024-04-07 18:22:55 +00:00
bjorn3
f7cc528deb Restore required permission for the release job 2024-04-07 17:31:44 +00:00
bjorn3
6bab2e750b Fix showing error details in the dev release action 2024-04-07 17:31:26 +00:00
许杰友 Jieyou Xu (Joe)
de3857e553 tests/ui: remove workaround for broken revisioned run-rustfix test 2024-04-07 17:06:15 +00:00
许杰友 Jieyou Xu (Joe)
5dc276c0da compiletest: properly handle revisioned run-rustfix tests 2024-04-07 17:06:15 +00:00
bjorn3
0328ee571b Fix caching on Cirrus CI 2024-04-07 16:36:41 +00:00
bjorn3
39b25b3d71 Don't emit unwind tables on macOS
They don't work anyway as object misses support for emitting the
particular format macOS expects. And on arm64 macOS it causes
compilation to abort due to an unsupported relocation type.

Fixes rust-lang/rustc_codegen_cranelift#1371
2024-04-07 16:29:04 +00:00
Gabriel Dolberg
a1d4066e53
Fix typo in library/core/src/iter/traits/iterator.rs 2024-04-07 18:55:28 +03:00
许杰友 Jieyou Xu (Joe)
d4aeff711e Port over backtrace's line-tables-only test to a ui test 2024-04-07 15:25:38 +00:00
BALAGANESH
8f6ebf608d Made changes in documentation 2024-04-07 15:07:25 +00:00
bors
e78913baef Auto merge of #123592 - matthiaskrgr:rollup-3k1pq8s, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - #123584 (Emit an error when `rustc_doc_primitive` has an unknown value)
 - #123589 (sys_common::thread_local_key: make a note that this is not used on Windows)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-07 14:51:54 +00:00
DianQK
a334848ba3
Re-enable the early otherwise branch optimization 2024-04-07 21:14:29 +08:00
DianQK
f5c256fa0f
Add FileCheck for early_otherwise_branch*.rs 2024-04-07 21:14:29 +08:00
DianQK
31e74771f0
Resolve unsound hoisting of discriminant in EarlyOtherwiseBranch 2024-04-07 21:14:26 +08:00
Matthias Krüger
e5bdd7ebc1
Rollup merge of #123589 - RalfJung:nowin, r=ChrisDenton
sys_common::thread_local_key: make a note that this is not used on Windows

This just confused me for a while. I don't have the time to clean it up but I can at least leave a note for the next wary traveler.
2024-04-07 14:50:00 +02:00
Matthias Krüger
f64e97100c
Rollup merge of #123584 - tgross35:rustc_doc_primitive-usage-error, r=fmease
Emit an error when `rustc_doc_primitive` has an unknown value

Currently rustdoc silently does nothing. Change this to raise an error instead.
2024-04-07 14:49:59 +02:00
bors
4e431fad67 Auto merge of #123561 - saethlin:str-unchecked-sub-index, r=scottmcm
Use unchecked_sub in str indexing

https://github.com/rust-lang/rust/pull/108763 applied this logic to indexing for slices, but of course `str` has its own separate impl.

Found this by skimming over the codegen for https://github.com/oxidecomputer/hubris/; their dist builds enable overflow checks so the lack of `unchecked_sub` was producing an impossible-to-hit overflow check and also inhibiting some inlining.

r? scottmcm
2024-04-07 12:49:15 +00:00
Zalathar
e38dfc4961 Remove unnecessary cast from LLVMRustGetInstrProfIncrementIntrinsic
This particular cast appears to have been copied over from clang, but there are
plenty of other call sites in clang that don't bother with a cast here, and it
works fine without one.

For context, `llvm::Intrinsic::ID` is a typedef for `unsigned`, and
`llvm::Intrinsic::instrprof_increment` is a member of
`enum IndependentIntrinsics : unsigned`.
2024-04-07 21:27:53 +10:00
bors
5d765b8cc1 Auto merge of #123221 - pacak:cache_emit, r=fmease,jieyouxu
Save/restore more items in cache with incremental compilation

Right now they don't play very well together, consider a simple example:

```
$ export RUSTFLAGS="--emit asm"
$ cargo new --lib foo
     Created library `foo` package
$ cargo build -q
$ touch src/lib.rs
$ cargo build
error: could not copy
  "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.4qbzn9k8mosu50a5.rcgu.s"
  to "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.s":
  No such file or directory (os error 2)
```

Touch triggers the rebuild, incremental compilation detects no changes (yay) and everything explodes while trying to copy files were they should go.

This pull request fixes it by copying and restoring more files in the incremental compilation cache

Fixes https://github.com/rust-lang/rust/issues/89149
Fixes https://github.com/rust-lang/rust/issues/88829

Related: https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551
2024-04-07 10:46:50 +00:00
bors
fc1a4c5cc9 Auto merge of #123221 - pacak:cache_emit, r=fmease,jieyouxu
Save/restore more items in cache with incremental compilation

Right now they don't play very well together, consider a simple example:

```
$ export RUSTFLAGS="--emit asm"
$ cargo new --lib foo
     Created library `foo` package
$ cargo build -q
$ touch src/lib.rs
$ cargo build
error: could not copy
  "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.4qbzn9k8mosu50a5.rcgu.s"
  to "/path/to/foo/target/debug/deps/foo-e307cc7fa7b6d64f.s":
  No such file or directory (os error 2)
```

Touch triggers the rebuild, incremental compilation detects no changes (yay) and everything explodes while trying to copy files were they should go.

This pull request fixes it by copying and restoring more files in the incremental compilation cache

Fixes https://github.com/rust-lang/rust/issues/89149
Fixes https://github.com/rust-lang/rust/issues/88829

Related: https://internals.rust-lang.org/t/interaction-between-incremental-compilation-and-emit/20551
2024-04-07 10:46:50 +00:00
Ralf Jung
b1d1ad9f8c sys_common::thread_local_key: make a note that this is not used on Windows 2024-04-07 12:23:47 +02:00
bors
8f2c255ae0 Auto merge of #123585 - matthiaskrgr:rollup-dexaj7a, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #123410 (Relax framework linking test)
 - #123446 (Fix incorrect 'llvm_target' value used on watchOS target)
 - #123579 (add some more tests)
 - #123581 (Add `f16` and `f128` to rustdoc's `PrimitiveType`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-07 08:44:19 +00:00
Ralf Jung
596908bb9a also test core+alloc on a 32bit big-endian target 2024-04-07 10:06:06 +02:00
Ralf Jung
d0346c50bc disable debug assertions to speed up the check-aux job 2024-04-07 10:06:06 +02:00
Ralf Jung
24089812db run some std tests on more targets 2024-04-07 10:06:06 +02:00
Ralf Jung
a986c0a100 make a doctest less slow in Miri 2024-04-07 10:06:06 +02:00