about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/example
AgeCommit message (Collapse)AuthorLines
2025-01-10Merge commit 'e39eacd2d415803ef82de3b6a314e4f2d0fbc4dc' into ↵bjorn3-205/+0
sync_cg_clif-2025-01-10
2024-12-07Make `Copy` unsafe to implement for ADTs with `unsafe` fieldsJack Wrenn-20/+20
As a rule, the application of `unsafe` to a declaration requires that use-sites of that declaration also require `unsafe`. For example, a field declared `unsafe` may only be read in the lexical context of an `unsafe` block. For nearly all safe traits, the safety obligations of fields are explicitly discharged when they are mentioned in method definitions. For example, idiomatically implementing `Clone` (a safe trait) for a type with unsafe fields will require `unsafe` to clone those fields. Prior to this commit, `Copy` violated this rule. The trait is marked safe, and although it has no explicit methods, its implementation permits reads of `Self`. This commit resolves this by making `Copy` conditionally safe to implement. It remains safe to implement for ADTs without unsafe fields, but unsafe to implement for ADTs with unsafe fields. Tracking: #132922
2024-12-06Remove polymorphizationBen Kimock-17/+0
2024-12-06Merge commit '57845a397ec15e4e6a561ed2c4bfa3dcf49144fb' into ↵bjorn3-0/+3
sync_cg_clif-2024-12-06
2024-11-08remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic ↵Ralf Jung-19/+64
functions instead
2024-10-22Rename Receiver -> LegacyReceiverAdrian Taylor-5/+5
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-06various fixes for `naked_asm!` implementationFolkert de Vries-1/+7
- 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-04Use wide pointers consistenly across the compilerUrgau-2/+2
2024-09-23Merge commit '6d35b4c9a04580366fd800692a5b5db79d766530' into ↵bjorn3-0/+71
sync_cg_clif-2024-09-22
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+3
2024-09-09Fix the examples in cg_clifScott McMurray-8/+8
2024-08-18stabilize raw_ref_opRalf Jung-2/+1
2024-08-10Fixes in various placesNadrieril-0/+1
2024-08-09Merge commit '69b3f5a426a5c1c05236a45b36f6679d95fbe01b' into ↵bjorn3-0/+31
sync_cg_clif-2024-08-09
2024-07-29Reformat `use` declarations.Nicholas Nethercote-6/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28stabilize `is_sorted`Slanterns-1/+0
2024-06-30Merge commit '49cd5dd454d0115cfbe9e39102a8b3ba4616aa40' into ↵bjorn3-15/+43
sync_cg_clif-2024-06-30
2024-06-12Require any function with a tait in its signature to actually constrain a ↵Oli Scherer-10/+13
hidden type
2024-05-13Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into ↵bjorn3-0/+39
sync_cg_clif-2024-05-13
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-5/+10
And suggest adding the `#[coroutine]` to the closure
2024-04-23Rollup merge of #124286 - bjorn3:sync_cg_clif-2024-04-23, r=bjorn3Matthias Krüger-3/+7
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-23Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,RalfJung,antoyoMatthias Krüger-2/+2
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-23Merge commit 'de5d6523738fd44a0521b6abf3e73ae1df210741' into ↵bjorn3-3/+7
sync_cg_clif-2024-04-23
2024-04-19Do intrinsic changes in `rustc_codegen_cranelift`Maybe Waffle-2/+2
2024-04-15static_mut_refs: use raw pointers to remove the remaining FIXMERalf Jung-4/+11
2024-04-05Merge commit 'fbda869b4e230c788b6bce426038ba8419956f2d' into ↵bjorn3-2/+2
sync_cg_clif-2024-04-05
2024-03-22Codegen const panic messages as function callsMark Rousskov-0/+30
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-16Merge commit '4cf4ffc6ba514f171b3f52d1c731063e4fc45be3' into ↵bjorn3-0/+8
sync_cg_clif-2024-03-16
2024-03-11Rollup merge of #121840 - oli-obk:freeze, r=dtolnayJacob Pratt-0/+1
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-05only set noalias on Box with the global allocatorRalf Jung-2/+5
2024-02-29Forbid implementing `Freeze` even if the trait is stabilizedOli Scherer-0/+1
2024-02-25fix use of platform_intrinsics in testsRalf Jung-5/+2
2024-02-25remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsicsRalf Jung-2/+2
2024-02-18Improve wording of static_mut_refObei Sideg-2/+2
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-01-24remove StructuralEq traitRalf Jung-3/+0
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-0/+3
2023-12-24Fix borked subtree syncsbjorn3-255/+32
2023-12-19Merge commit '3a9bf729322fb5035518f99b9d76a742bf7c124e' into ↵bjorn3-11/+0
sync_cg_clif-2023-12-19
2023-12-14update use of feature flagslcnr-1/+1
2023-12-13Auto merge of #118534 - RalfJung:extern-type-size-of-val, r=WaffleLapkinbors-55/+0
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-12remove a cranelift test that doesn't make sense any moreRalf Jung-55/+0
2023-12-06Adjust tests for newly added ambiguous_wide_pointer_comparisons lintUrgau-1/+1
2023-11-25Merge commit '710c67909d034e1c663174a016ca82b95c2d6c12' into ↵bjorn3-0/+16
sync_cg_clif-2023-11-25
2023-11-23Fix fn_sig_for_fn_abi and the coroutine transform for generatorsbjorn3-0/+36
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-10Merge commit 'c84d1871dc4456539b7b578830268ab3539915d0' into ↵bjorn3-0/+234
sync_cg_clif-2023-11-10
2023-10-24Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into ↵bjorn3-0/+11
sync_cg_clif-2023-10-24
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-09Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into ↵bjorn3-0/+6
sync_cg_clif-2023-10-09
2023-08-09Merge commit '8f9ac9c22d6594cf059d8e6c71d414cc5ccd7975' into ↵bjorn3-2/+2
sync_cg_clif-2023-08-09