Commit Graph

1234 Commits

Author SHA1 Message Date
bors
bb121d111d Auto merge of #116167 - RalfJung:structural-eq, r=lcnr
remove StructuralEq trait

The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more.

One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good.

Fixes https://github.com/rust-lang/rust/issues/115881
2024-01-26 00:17:00 +00:00
bors
d645e1638d Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obk
Replacement of #114390: Add new intrinsic `is_var_statically_known` and optimize pow for powers of two

This adds a new intrinsic `is_val_statically_known` that lowers to [``@llvm.is.constant.*`](https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic).` It also applies the intrinsic in the int_pow methods to recognize and optimize the idiom `2isize.pow(x)`. See #114390 for more discussion.

While I have extended the scope of the power of two optimization from #114390, I haven't added any new uses for the intrinsic. That can be done in later pull requests.

Note: When testing or using the library, be sure to use `--stage 1` or higher. Otherwise, the intrinsic will be a noop and the doctests will be skipped. If you are trying out edits, you may be interested in [`--keep-stage 0`](https://rustc-dev-guide.rust-lang.org/building/suggested.html#faster-builds-with---keep-stage).

Fixes #47234
Resolves #114390
`@Centri3`
2024-01-25 05:16:53 +00:00
Ralf Jung
215284a490 remove StructuralEq trait 2024-01-24 07:56:23 +01:00
Nicholas Thompson
b2a7afd898 Further Implement is_val_statically_known 2024-01-23 12:02:31 -05:00
liewyec
599492a3d5 replace filter with skip and take 2024-01-21 09:22:32 +01:00
antoyo
e747d42bfd
Merge pull request #415 from rowan-sl/rename-clean-ui-tests
Rename `y.sh test --clean-ui-tests` to `y.sh clean ui-tests`
2024-01-19 15:05:33 -05:00
Rowan S-L
d34789f5d2 update Intel Software Development Emulator 2024-01-19 11:18:40 -05:00
antoyo
e4e9365882
Merge pull request #413 from NCGThompson/check-rustup-home-flag
Honor `$RUSTUP_HOME`
2024-01-19 10:46:23 -05:00
Rowan S-L
94ed9d16cf rename y.sh test --clean-ui-tests to y.sh clean ui-tests 2024-01-18 12:41:25 -05:00
Nic
dcb531f130
Update build_system/src/test.rs
Co-authored-by: antoyo <antoyo@users.noreply.github.com>
2024-01-16 12:57:34 -05:00
Nicholas Thompson
7dd3f6fffb call rustup which 2024-01-14 14:19:40 -05:00
Nicholas Thompson
52946377dc Honor $RUSTUP_HOME 2024-01-14 11:52:06 -05:00
usamoi
0783d45057 add avx512fp16 to x86 target features 2024-01-13 13:50:10 +08:00
antoyo
1a8e0c39fa
Merge pull request #412 from tgross35/gha-update
Switch from actions-rs to preinstalled rustup
2024-01-12 17:36:10 -05:00
Trevor Gross
0fe5c7fee3 Switch from actions-rs to preinstalled rustup
actions-rs is deprecated. Switch to using the preinstalled rustup to install
the toolchain, and https://github.com/Swatinem/rust-cache to configure
cacheing.
2024-01-12 14:28:10 -05:00
antoyo
5032d33628
Merge pull request #411 from rust-lang/fix/sysroot-copy-path
Fix the destination path of the sysroot copy
2024-01-11 18:29:15 -05:00
Antoni Boucher
45137ddd32 Fix the destination path of the sysroot copy 2024-01-11 17:41:37 -05:00
Nicholas Nethercote
558d051b1d Rename {create,emit}_warning as {create,emit}_warn.
For consistency with `warn`/`struct_warn`, and also `{create,emit}_err`,
all of which use an abbreviated form.
2024-01-10 07:33:06 +11:00
antoyo
47373be793
Merge pull request #410 from vuittont60/master
Fix typos
2024-01-09 07:40:25 -05:00
vuittont60
f8e079a171
Fix typo src/intrinsic/llvm.rs 2024-01-09 10:53:11 +08:00
vuittont60
4e8627cf89
Fix typo src/base.rs 2024-01-09 10:53:00 +08:00
vuittont60
b10f5dd3b9
Fix typo Readme.md 2024-01-09 10:52:52 +08:00
Obei Sideg
47b06069b3 Update test for E0796 and static_mut_ref lint 2024-01-07 17:29:25 +03:00
Michael Goulet
41b758f437 Rollup merge of #119538 - nnethercote:cleanup-errors-5, r=compiler-errors
Cleanup error handlers: round 5

More rustc_errors cleanups. A sequel to https://github.com/rust-lang/rust/pull/119171.

r? ````@compiler-errors````
2024-01-05 10:57:21 -05:00
Matthias Krüger
fe71e04f7f Rollup merge of #119431 - taiki-e:asm-s390x-reg-addr, r=Amanieu
Support reg_addr register class in s390x inline assembly

In s390x, `r0` cannot be used as an address register (it is evaluated as zero in an address context).

Therefore, currently, in assemblies involving memory accesses, `r0` must be [marked as clobbered](1a1155653a/src/arch/s390x.rs (L58)) or [explicitly used to a non-address](1a1155653a/src/arch/s390x.rs (L135)) or explicitly use an address register to prevent `r0` from being allocated to a register for the address.

This patch adds a register class for allocating general-purpose registers, except `r0`, to make it easier to use address registers. (powerpc already has a register class (reg_nonzero) for a similar purpose.)

This is identical to the `a` constraint in LLVM and GCC:

https://llvm.org/docs/LangRef.html#supported-constraint-code-list
> a: A 32, 64, or 128-bit integer address register (excludes R0, which in an address context evaluates as zero).

https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html
> a
> Address register (general purpose register except r0)

cc ``@uweigand``

r? ``@Amanieu``
2024-01-04 15:33:59 +01:00
antoyo
fac7c3109d
Merge pull request #408 from GuillaumeGomez/intrinsics-conversion
Update intrinsics conversion
2024-01-03 10:00:56 -05:00
Guillaume Gomez
b5681ca4aa Update intrinsics conversion 2024-01-03 15:27:19 +01:00
Taiki Endo
f93e985664 Support reg_addr register class in s390x inline assembly 2024-01-03 18:00:37 +09:00
Nicholas Nethercote
a56eff2b41 Rename some Diagnostic setters.
`Diagnostic` has 40 methods that return `&mut Self` and could be
considered setters. Four of them have a `set_` prefix. This doesn't seem
necessary for a type that implements the builder pattern. This commit
removes the `set_` prefixes on those four methods.
2024-01-03 19:40:20 +11:00
antoyo
a91d9e1dce
Merge pull request #405 from GuillaumeGomez/rustify-cargo-sh
Rustify `cargo.sh`
2023-12-30 07:37:45 -05:00
bors
a2efaf0030 Auto merge of #118705 - WaffleLapkin:codegen-atomic-exhange-untuple, r=cjgillot
Change `rustc_codegen_ssa`'s `atomic_cmpxchg` interface to return a pair of values

Doesn't change much, but a little nicer that way.
2023-12-30 07:42:19 +00:00
Guillaume Gomez
c122376493 Don't show cargo command errors 2023-12-29 21:27:36 +01:00
Michael Goulet
eca05c6cb0 Remove movability from TyKind::Coroutine 2023-12-28 16:35:01 +00:00
Bernd Schmidt
69b5a9f2eb Change rustc_codegen_ssa's atomic_cmpxchg interface to return a pair of values 2023-12-28 09:40:47 +00:00
Nicholas Nethercote
02ed790631 Remove Session methods that duplicate DiagCtxt methods.
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
2023-12-24 08:05:28 +11:00
Guillaume Gomez
ec94074817 Correctly take into account potential position of cargo command in y.sh 2023-12-23 00:13:09 +01:00
Guillaume Gomez
2e52b08800 Rustify cargo.sh 2023-12-23 00:13:09 +01:00
antoyo
b2e0cc5cec
Merge pull request #399 from GuillaumeGomez/checkout
If the rustc commit cannot be retrieve, just checkout the repository
2023-12-21 16:11:03 -05:00
Antoni Boucher
a53495ab45 Add comment 2023-12-21 11:18:11 -05:00
Guillaume Gomez
6631dd9dd2 Don't stop test if llvm FileCheck cannot be found 2023-12-20 21:44:12 +01:00
Guillaume Gomez
87a704a227 If the rustc commit cannot be retrieve, just checkout the repository 2023-12-20 21:33:21 +01:00
antoyo
9131ece832
Merge pull request #397 from GuillaumeGomez/rm-rustup-sh
Remove unused `rustup.sh` script
2023-12-20 15:27:57 -05:00
Guillaume Gomez
9a8245fed8 Remove unused rustup.sh script 2023-12-20 16:19:03 +01:00
antoyo
7dad07a67c
Merge pull request #396 from GuillaumeGomez/rustify-clean-all
Rustify `clean_all.sh`
2023-12-20 10:09:16 -05:00
Guillaume Gomez
e26e074261 Rustify clean_all.sh 2023-12-20 15:47:50 +01:00
Guillaume Gomez
05ef68961b Remove unused build_sysroot.sh file 2023-12-20 14:47:42 +01:00
antoyo
e0c4d65e07
Merge pull request #384 from GuillaumeGomez/rustify-test
Rustify test.sh
2023-12-19 17:06:40 -05:00
Guillaume Gomez
8e870c75d9 Remove unused TestArgs::use_backend and display messages in case a test is not run 2023-12-19 22:25:48 +01:00
Guillaume Gomez
6e53832eda Simplify Runner type alias 2023-12-19 21:15:28 +01:00
antoyo
db494375ab
Merge pull request #382 from sadlerap/impl-generic-arithmetic-pass
simd: implement missing intrinsics from simd/generic-arithmetic-pass.rs
2023-12-19 13:00:35 -05:00