4481 Commits

Author SHA1 Message Date
bjorn3
05126cdc10 Rustup to rustc 1.84.0-nightly (759e07f06 2024-10-30) 2024-10-31 09:28:49 +00:00
bjorn3
28701aa46d Sync from rust 759e07f063fb8e6306ff1bdaeb70af56a878b415 2024-10-31 09:20:43 +00:00
Jubilee Young
988f49d04f cg_clif: Rename LayoutS to LayoutData 2024-10-27 22:32:40 -07:00
Matthias Krüger
a29a8f523e Rollup merge of #132168 - fee1-dead-contrib:fxclean, r=compiler-errors
Effects cleanup

- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers

r? compiler-errors
2024-10-26 06:29:48 +02:00
Deadbeef
83f1121ebd Effects cleanup
- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers
2024-10-26 10:19:07 +08:00
Ralf Jung
6ca276df2e Re-do recursive const stability checks
Fundamentally, we have *three* disjoint categories of functions:
1. const-stable functions
2. private/unstable functions that are meant to be callable from const-stable functions
3. functions that can make use of unstable const features

This PR implements the following system:
- `#[rustc_const_stable]` puts functions in the first category. It may only be applied to `#[stable]` functions.
- `#[rustc_const_unstable]` by default puts functions in the third category. The new attribute `#[rustc_const_stable_indirect]` can be added to such a function to move it into the second category.
- `const fn` without a const stability marker are in the second category if they are still unstable. They automatically inherit the feature gate for regular calls, it can now also be used for const-calls.

Also, several holes in recursive const stability checking are being closed.
There's still one potential hole that is hard to avoid, which is when MIR
building automatically inserts calls to a particular function in stable
functions -- which happens in the panic machinery. Those need to *not* be
`rustc_const_unstable` (or manually get a `rustc_const_stable_indirect`) to be
sure they follow recursive const stability. But that's a fairly rare and special
case so IMO it's fine.

The net effect of this is that a `#[unstable]` or unmarked function can be
constified simply by marking it as `const fn`, and it will then be
const-callable from stable `const fn` and subject to recursive const stability
requirements. If it is publicly reachable (which implies it cannot be unmarked),
it will be const-unstable under the same feature gate. Only if the function ever
becomes `#[stable]` does it need a `#[rustc_const_unstable]` or
`#[rustc_const_stable]` marker to decide if this should also imply
const-stability.

Adding `#[rustc_const_unstable]` is only needed for (a) functions that need to
use unstable const lang features (including intrinsics), or (b) `#[stable]`
functions that are not yet intended to be const-stable. Adding
`#[rustc_const_stable]` is only needed for functions that are actually meant to
be directly callable from stable const code. `#[rustc_const_stable_indirect]` is
used to mark intrinsics as const-callable and for `#[rustc_const_unstable]`
functions that are actually called from other, exposed-on-stable `const fn`. No
other attributes are required.
2024-10-25 20:31:40 +02:00
bjorn3
616abf15d9
Merge pull request #1537 from dpaoliello/debugunwind
Don't panic about debug info for Arm64 Windows unwind info
2024-10-24 18:56:57 +02:00
Daniel Paoliello
bcb7de3bb6 Don't panic about debug info for Arm64 Windows unwind info 2024-10-24 09:33:49 -07:00
bjorn3
c28d433bd9 Update Cranelift to 0.113 2024-10-24 09:28:46 +00:00
bjorn3
3f06952be3 Rustup to rustc 1.84.0-nightly (4f2f477fd 2024-10-23) 2024-10-24 09:16:08 +00:00
bjorn3
0093a4b920 Sync from rust 4f2f477fded0a47b21ed3f6aeddeafa5db8bf518 2024-10-24 08:51:44 +00:00
Adrian Taylor
c5a5e86baa Rename Receiver -> LegacyReceiver
As part of the "arbitrary self types v2" project, we are going to
replace the current `Receiver` trait with a new mechanism based on a
new, different `Receiver` trait.

This PR renames the old trait to get it out the way. Naming is hard.
Options considered included:
* HardCodedReceiver (because it should only be used for things in the
  standard library, and hence is sort-of hard coded)
* LegacyReceiver
* TargetLessReceiver
* OldReceiver

These are all bad names, but fortunately this will be temporary.
Assuming the new mechanism proceeds to stabilization as intended, the
legacy trait will be removed altogether.

Although we expect this trait to be used only in the standard library,
we suspect it may be in use elsehwere, so we're landing this change
separately to identify any surprising breakages.

It's known that this trait is used within the Rust for Linux project; a
patch is in progress to remove their dependency.

This is a part of the arbitrary self types v2 project,
https://github.com/rust-lang/rfcs/pull/3519
https://github.com/rust-lang/rust/issues/44874

r? @wesleywiser
2024-10-22 12:55:16 +00:00
bjorn3
45c2002f08 Update abi-cafe test expectations for a recent fix of the rust abi 2024-10-20 14:29:22 +00:00
bjorn3
04f33cc839 Rustup to rustc 1.84.0-nightly (da935398d 2024-10-19) 2024-10-20 14:14:00 +00:00
bjorn3
383bb665d2 Sync from rust da935398d582344c5b7689bd6632d8ec01b0c988 2024-10-20 13:57:42 +00:00
Michael Goulet
65201c20a6 Fix tests 2024-10-19 18:07:35 +00:00
Michael Goulet
2f1b15f145 Allow dropping dyn principal 2024-10-17 20:43:31 +02:00
bjorn3
6666435b8a Fix rustc test suite (broken by prev commit) 2024-10-17 16:58:00 +00:00
bjorn3
bbaaecc250 Stop copying libstd.so to dist/lib
It is only necessary in dist/lib/rustlib/*/lib anymore. The jit mode now
correctly find it there too.
2024-10-17 16:31:12 +00:00
bjorn3
16067fdea1 Mark blocks as cold in a couple more places 2024-10-17 17:57:34 +02:00
bjorn3
47a7e994f2 Rustup to rustc 1.84.0-nightly (798fb83f7 2024-10-16) 2024-10-17 10:55:09 +00:00
bjorn3
bf2da675c8 Sync from rust 798fb83f7d24e31b16acca113496f39ff168c143 2024-10-17 10:07:36 +00:00
Jed Brown
270fb2130c intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics
Add intrinsics `fmuladd{f16,f32,f64,f128}`. This computes `(a * b) +
c`, to be fused if the code generator determines that (i) the target
instruction set has support for a fused operation, and (ii) that the
fused operation is more efficient than the equivalent, separate pair
of `mul` and `add` instructions.

https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic

MIRI support is included for f32 and f64.

The codegen_cranelift uses the `fma` function from libc, which is a
correct implementation, but without the desired performance semantic. I
think this requires an update to cranelift to expose a suitable
instruction in its IR.

I have not tested with codegen_gcc, but it should behave the same
way (using `fma` from libc).
2024-10-11 15:32:56 -06:00
bjorn3
76dfce7a6f Fix rustc test suite 2024-10-10 16:32:42 +00:00
bjorn3
5d7d2518b3 Rustup to rustc 1.83.0-nightly (eb4e23467 2024-10-09) 2024-10-10 16:19:54 +00:00
bjorn3
3cf701c845 Sync from rust eb4e2346748e1760f74fcaa27b42431e0b95f8f3 2024-10-10 16:13:20 +00:00
bjorn3
14f656ede3 Compile all abi-cafe tests with debuginfo enabled 2024-10-10 16:09:42 +00:00
Jubilee Young
48504415cf cg_clif: Factor out rustc_target::abi 2024-10-08 18:24:56 -07:00
Folkert de Vries
2811ce715d various fixes for naked_asm! implementation
- fix for divergence
- fix error message
- fix another cranelift test
- fix some cranelift things
- don't set the NORETURN option for naked asm
- fix use of naked_asm! in doc comment
- fix use of naked_asm! in run-make test
- use `span_bug` in unreachable branch
2024-10-06 19:00:09 +02:00
Urgau
0bd0b99729 Use wide pointers consistenly across the compiler 2024-10-04 14:06:48 +02:00
bjorn3
a146874989 Couple of clif ir printing improvements around abi handling 2024-10-03 15:34:21 +02:00
bjorn3
0ba084514a Also enable Cranelift optimizations with -Copt-level=1/2 2024-10-03 12:36:16 +00:00
bjorn3
0f1284cea7 Fix ./y.sh prepare when the download dir is clobbered 2024-10-03 10:15:15 +00:00
bjorn3
0a9ce96e7a Validate dir checksum during testing too
Fixes rust-lang/rustc_codegen_cranelift#1394
2024-10-03 10:13:20 +00:00
bjorn3
9a48c44a27 Remove pulley-interpreter dependency 2024-10-03 09:01:42 +00:00
bjorn3
743a2e47ac Update to Cranelift 0.112.0 2024-10-03 09:01:40 +00:00
Michael Goulet
d10a16ae40 Relax a debug assertion in codegen 2024-09-30 12:18:02 -04:00
Ralf Jung
9b31c68c0e fix cranelift CI 2024-09-29 07:32:08 +02:00
bjorn3
764f1ba5cd Fix running rustc tests 2024-09-26 16:54:35 +00:00
bjorn3
eccda69544 Rustup to rustc 1.83.0-nightly (9e394f551 2024-09-25) 2024-09-26 16:41:40 +00:00
bjorn3
39440c53dc Sync from rust 9e394f551c050ff03c6fc57f190e0761cf0be6e8 2024-09-26 16:36:04 +00:00
Michael Goulet
6fdc133daa Add a debug assertion in codegen that unsize casts of the same principal trait def id are truly NOPs 2024-09-25 11:13:59 -04:00
Lukas Markeffsky
25b66d8091 be even more precise about "cast" vs "coercion" 2024-09-24 23:12:02 +02:00
Lukas Markeffsky
1efad22339 unify dyn* coercions with other pointer coercions 2024-09-24 22:17:55 +02:00
Michael Goulet
631ab21ff0 Check vtable projections for validity in miri 2024-09-23 19:38:26 -04:00
bjorn3
3a3a6347bb Merge branch 'sync_from_rust' 2024-09-23 11:32:18 +00:00
bjorn3
9d8572d33b Rustfmt 2024-09-23 11:28:15 +00:00
bjorn3
f3ae4237ab Revert change to apply_patches to fix panic 2024-09-23 11:20:56 +00:00
bjorn3
32b608a439 Merge commit '6d35b4c9a04580366fd800692a5b5db79d766530' into sync_cg_clif-2024-09-22 2024-09-23 11:20:46 +00:00
bjorn3
6d35b4c9a0 Rustup to rustc 1.83.0-nightly (6c6d21008 2024-09-22) 2024-09-23 11:11:08 +00:00