66 Commits

Author SHA1 Message Date
Antoni Boucher
1954034e34 Comment test that cannot be fixed currently 2025-07-12 10:44:48 -04:00
Oli Scherer
f1d6f48e91 Stop backends from needing to support nullary intrinsics 2025-06-30 08:04:19 +00:00
Guillaume Gomez
efb79975f6 Merge commit 'fda0bb9588912a3e0606e880ca9f6e913cf8a5a4' into subtree-update_cg_gcc_2025-06-18 2025-06-18 15:11:44 +02:00
David Wood
e9d795d717 cranelift/gcc: {Meta,Pointee,}Sized in minicore
As in many previous commits, adding the new traits to minicore, but this
time for cranelift and gcc.
2025-06-16 23:04:37 +00:00
Matthias Krüger
4ffcf8021a Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errors
Unimplement unsized_locals

Implements https://github.com/rust-lang/compiler-team/issues/630

Tracking issue here: https://github.com/rust-lang/rust/issues/111942

Note that this just removes the feature, not the implementation, and does not touch `unsized_fn_params`. This is because it is required to support `Box<dyn FnOnce()>: FnOnce()`.

There may be more that should be removed (possibly in follow up prs)
- the `forget_unsized` function and `forget` intrinsic.
- the `unsized_locals` test directory; I've just fixed up the tests for now
- various codegen support for unsized values and allocas

cc ``@JakobDegen`` ``@oli-obk`` ``@Noratrieb`` ``@programmerjake`` ``@bjorn3``

``@rustbot`` label F-unsized_locals

Fixes rust-lang/rust#79409
2025-06-14 11:27:10 +02:00
mejrs
1ff33b5f68 Unimplement unsized_locals 2025-06-13 01:16:36 +02:00
Ralf Jung
f5c62888b8 intrinsics: rename min_align_of to align_of 2025-06-12 17:50:25 +02:00
WANG Rui
620a4f318c Add new Tier-3 targets: loongarch32-unknown-none*
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-06 08:19:38 +08:00
Guillaume Gomez
d52b5e6df5 Merge commit '6ba33f5e1189a5ae58fb96ce3546e76b13d090f5' into subtree-update_cg_gcc_2025-05-14 2025-05-14 13:51:02 +02:00
bendn
338e7388ea Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
Guillaume Gomez
8f9a32aaf8 Merge commit 'db1a31c243a649e1fe20f5466ba181da5be35c14' into subtree-update_cg_gcc_2025-04-18 2025-04-18 21:20:11 +02:00
Ralf Jung
7989568b8e intrinsics: remove unnecessary leading underscore from argument names 2025-03-12 08:04:09 +01:00
Ralf Jung
15f0dca531 remove support for rustc_intrinsic_must_be_overridden from the compiler 2025-02-24 07:53:59 +01:00
Michael Goulet
feb78f904e Implement and use BikeshedGuaranteedNoDrop for union/unsafe field validity 2025-02-13 03:45:04 +00:00
Ralf Jung
301d2478e0 remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
Jacob Pratt
daeeffa830 Rollup merge of #132397 - m-ou-se:warn-missing-abi, r=Nadrieril
Make missing_abi lint warn-by-default.

This makes the missing_abi lint warn-by-default, as suggested here: https://github.com/rust-lang/rfcs/pull/3722#issuecomment-2447719047

This needs a lang FCP.
2025-01-15 04:08:10 -05:00
Antoni Boucher
43b7e28601 Merge commit '59a81c2ca1edc88ad3ac4b27a8e03977ffb8e73a' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
Mara Bos
60ee6fbaa4 Update tests. 2025-01-07 16:04:14 +01:00
Jack Wrenn
691aec2ef3 Make Copy unsafe to implement for ADTs with unsafe fields
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-07 20:50:00 +00:00
Ralf Jung
f0368983da remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
Adrian Taylor
c12fdd2c65 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
Ralf Jung
9d12735425 stabilize raw_ref_op 2024-08-18 19:46:53 +02:00
Nadrieril
18c7d54993 Fixes in various places 2024-08-10 12:08:46 +02:00
Slanterns
1e117cfb56 stabilize is_sorted 2024-07-28 03:11:54 +08:00
Michael Goulet
9a9d5ec6b6 Remove lang feature for type ascription 2024-07-11 20:40:38 -04:00
Guillaume Gomez
c92f054085 Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into master 2024-07-10 12:44:23 +02:00
Mark Rousskov
2b875f0927 Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
Oli Scherer
df0639b6e1 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
79d217fcf1 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
Maybe Waffle
dd50f454c8 Fixup rustc_codegen_gcc test signature 2024-04-20 12:18:21 +00:00
Ralf Jung
6f36e82594 static_mut_refs: use raw pointers to remove the remaining FIXME 2024-04-15 18:45:56 +02:00
Mark Rousskov
c8cb091e1e 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
Jacob Pratt
a6202e2a77 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
0975461837 only set noalias on Box with the global allocator 2024-03-05 15:03:33 +01:00
Oli Scherer
3ca0c5913e Forbid implementing Freeze even if the trait is stabilized 2024-02-29 14:10:29 +00:00
Obei Sideg
b959fc1d0a 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
215284a490 remove StructuralEq trait 2024-01-24 07:56:23 +01:00
Obei Sideg
47b06069b3 Update test for E0796 and static_mut_ref lint 2024-01-07 17:29:25 +03:00
Urgau
a72e20d773 Fix rustc codegen gcc tests 2023-12-11 18:48:49 +01:00
Urgau
3cfff05ac7 Allow internal_features in rustc_codegen_gcc examples 2023-12-07 15:26:18 +01:00
Guillaume Gomez
a13408d824 Remove libc dependency in cg_gcc alloc_system example 2023-11-02 21:03:27 +01:00
Guillaume Gomez
34e6386f63 Fix compilation errors in rustc_codegen_gcc examples 2023-11-02 21:03:27 +01:00
Antoni Boucher
9f4f90b19a Merge commit 'e4fe941b11a55c5005630696e9b6d81c65f7bd04' into subtree-update_cg_gcc_2023-10-25 2023-10-26 17:42:02 -04:00
Oli Scherer
a690467938 s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
Oli Scherer
67b28ac34b s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00
Antoni Boucher
242a482c88 Merge commit '11a0cceab966e5ff1058ddbcab5977e8a1d6d290' into subtree-update_cg_gcc_2023-10-09 2023-10-09 15:53:34 -04:00
Dirreke
814c2e2cea add a csky-unknown-linux-gnuabiv2 target 2023-08-14 23:02:36 +08:00
chenx97
f2dded27f8 support for mips32r6 as a target_arch value 2023-07-18 18:58:18 +08:00
chenx97
5277ea10b5 support for mips64r6 as a target_arch value 2023-07-18 18:58:18 +08:00
Antoni Boucher
38c16e9862 Merge commit '1bbee3e217d75e7bc3bfe5d8c1b35e776fce96e6' into sync-cg_gcc-2023-06-19 2023-06-19 18:51:02 -04:00