Commit Graph

193 Commits

Author SHA1 Message Date
Oli Scherer
4e0af7cc61 Require any function with a tait in its signature to actually constrain a hidden type 2024-06-12 08:53:59 +00:00
bjorn3
ed7d97e4c8 Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into sync_cg_clif-2024-05-13 2024-05-13 13:26:33 +00:00
Oli Scherer
dda4709b1c Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
2024-04-24 08:05:29 +00:00
Matthias Krüger
36449f8cd6 Rollup merge of #124286 - bjorn3:sync_cg_clif-2024-04-23, r=bjorn3
Subtree sync for rustc_codegen_cranelift

This fixes a crash when compiling the standard library. In addition the Cranelift update fixes all the 128bit int abi incompatibility between cg_clif and cg_llvm.

r? ``@ghost``

``@rustbot`` label +A-codegen +A-cranelift +T-compiler
2024-04-23 20:17:52 +02:00
Matthias Krüger
6a2ad55108 Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyo
Dellvmize some intrinsics (use `u32` instead of `Self` in some integer intrinsics)

This implements https://github.com/rust-lang/compiler-team/issues/693 minus what was implemented in #123226.

Note: I decided to _not_ change `shl`/... builder methods, as it just doesn't seem worth it.

r? ``@scottmcm``
2024-04-23 20:17:51 +02:00
bjorn3
4ad6c6c581 Merge commit 'de5d6523738fd44a0521b6abf3e73ae1df210741' into sync_cg_clif-2024-04-23 2024-04-23 09:37:28 +00:00
Maybe Waffle
d5273fff48 Do intrinsic changes in rustc_codegen_cranelift 2024-04-19 18:45:25 +00:00
Ralf Jung
9e4e444a47 static_mut_refs: use raw pointers to remove the remaining FIXME 2024-04-15 18:45:56 +02:00
bjorn3
f91bd7882f Merge commit 'fbda869b4e230c788b6bce426038ba8419956f2d' into sync_cg_clif-2024-04-05 2024-04-05 16:20:23 +00:00
Mark Rousskov
05783c8ed6 Codegen const panic messages as function calls
This skips emitting extra arguments at every callsite (of which there
can be many). For a librustc_driver build with overflow checks enabled,
this cuts 0.7MB from the resulting binary.
2024-03-22 09:55:50 -04:00
bjorn3
4b61629951 Merge commit '4cf4ffc6ba514f171b3f52d1c731063e4fc45be3' into sync_cg_clif-2024-03-16 2024-03-16 17:23:11 +00:00
Jacob Pratt
221402e863 Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
Expose the Freeze trait again (unstably) and forbid implementing it manually

non-emoji version of https://github.com/rust-lang/rust/pull/121501

cc #60715

This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue.

It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: https://github.com/google/zerocopy/issues/941

cc ```@RalfJung```

T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-11 03:47:19 -04:00
Ralf Jung
804eeff180 only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
Oli Scherer
a11756ca75 Forbid implementing Freeze even if the trait is stabilized 2024-02-29 14:10:29 +00:00
Ralf Jung
08e4eafa49 fix use of platform_intrinsics in tests 2024-02-25 08:15:44 +01:00
Ralf Jung
9bb1109478 remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics 2024-02-25 08:14:52 +01:00
Obei Sideg
8ce7f62e58 Improve wording of static_mut_ref
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-18 06:01:40 +03:00
Ralf Jung
adbc67664b remove StructuralEq trait 2024-01-24 07:56:23 +01:00
Obei Sideg
837c0305c6 Update test for E0796 and static_mut_ref lint 2024-01-07 17:29:25 +03:00
bjorn3
653121cd38 Fix borked subtree syncs 2023-12-24 14:38:37 +00:00
bjorn3
a4be90ed16 Merge commit '3a9bf729322fb5035518f99b9d76a742bf7c124e' into sync_cg_clif-2023-12-19 2023-12-19 12:46:39 +00:00
lcnr
89ab75e856 update use of feature flags 2023-12-14 15:22:37 +01:00
bors
e3d2831ff4 Auto merge of #118534 - RalfJung:extern-type-size-of-val, r=WaffleLapkin
codegen: panic when trying to compute size/align of extern type

The alignment is also computed when accessing a field of extern type at non-zero offset, so we also panic in that case.

Previously `size_of_val` worked because the code path there assumed that "thin pointer" means "sized". But that's not true any more with extern types. The returned size and align are just blatantly wrong, so it seems better to panic than returning wrong results. We use a non-unwinding panic since code probably does not expect size_of_val to panic.
2023-12-13 08:33:05 +00:00
Ralf Jung
aa3dc4c225 remove a cranelift test that doesn't make sense any more 2023-12-12 08:15:17 +01:00
Urgau
9d9459a6f9 Adjust tests for newly added ambiguous_wide_pointer_comparisons lint 2023-12-06 09:03:48 +01:00
bjorn3
1988cf4a18 Merge commit '710c67909d034e1c663174a016ca82b95c2d6c12' into sync_cg_clif-2023-11-25 2023-11-25 10:05:52 +00:00
bjorn3
4ae658683f Fix fn_sig_for_fn_abi and the coroutine transform for generators
There were three issues previously:
* The self argument was pinned, despite Iterator::next taking an
  unpinned mutable reference.
* A resume argument was passed, despite Iterator::next not having one.
* The return value was CoroutineState<Item, ()> rather than Option<Item>

While these things just so happened to work with the LLVM backend,
cg_clif does much stricter checks when trying to assign a value to a
place. In addition it can't handle the mismatch between the amount of
arguments specified by the FnAbi and the FnSig.
2023-11-23 20:17:19 +00:00
bjorn3
d49fd9f877 Merge commit 'c84d1871dc4456539b7b578830268ab3539915d0' into sync_cg_clif-2023-11-10 2023-11-10 11:30:51 +00:00
bjorn3
a302610016 Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into sync_cg_clif-2023-10-24 2023-10-24 12:22:23 +00:00
Oli Scherer
4519e68957 s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
Oli Scherer
8e264ab07a s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00
bjorn3
5d85a24442 Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into sync_cg_clif-2023-10-09 2023-10-09 08:52:46 +00:00
bjorn3
59cabd7032 Merge commit '8f9ac9c22d6594cf059d8e6c71d414cc5ccd7975' into sync_cg_clif-2023-08-09 2023-08-09 18:20:12 +00:00
bjorn3
e8168ce8a3 Merge commit '1eded3619d0e55d57521a259bf27a03906fdfad0' into sync_cg_clif-2023-07-22 2023-07-22 13:32:34 +00:00
chenx97
648f5e4208 support for mips64r6 as a target_arch value 2023-07-18 18:58:18 +08:00
DrMeepster
f429b3e67f remove box_free and replace with drop impl 2023-06-16 13:41:06 -07:00
bjorn3
81ea0b29ea Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
bjorn3
8bf550e616 Merge commit 'ef07e8e60f994ec014d049a95591426fb92ebb79' into sync_cg_clif-2023-04-29 2023-04-29 12:00:43 +00:00
Matthias Krüger
b908472a93 Revert "Remove #[alloc_error_handler] from the compiler and library"
This reverts commit abc0660118.
2023-04-25 00:08:35 +02:00
Amanieu d'Antras
2ead2f56c0 Remove #[alloc_error_handler] from the compiler and library 2023-04-16 08:35:50 -07:00
bjorn3
7b3bd56ed9 Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
clubby789
2c122a8926 Remove uses of box_syntax in rustc and tools 2023-03-12 13:19:46 +00:00
Pietro Albini
0738ffe419 replace legacy copyright annotations in submodules 2023-03-09 12:24:47 +01:00
bjorn3
98a276b589 Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14 2022-12-14 19:30:46 +01:00
bjorn3
9950bd1dc5 Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23 2022-10-23 16:22:55 +02:00
Urgau
102a577bb3 Stabilize bench_black_box 2022-09-27 17:38:51 +02:00
bjorn3
cfef0a4f8d Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
Maybe Waffle
bd1ab72406 Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
bjorn3
640c3f730a Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25 2022-07-25 16:07:57 +02:00
Konrad Borowski
743cee6ca9 Partially stabilize const_slice_from_raw_parts
This doesn't stabilize methods working on mutable pointers.
2022-07-09 23:20:02 +02:00