Commit graph

4620 commits

Author SHA1 Message Date
bjorn3
8fd8b2d63c Only handle BinOp::Mul in codegen_i128::maybe_codegen_mul_checked 2025-01-09 16:04:25 +00:00
bjorn3
ec96e028a7 Slightly simplify maybe_codegen_checked 2025-01-09 15:28:50 +00:00
bjorn3
c74c817fb7 Rustup to rustc 1.86.0-nightly (a580b5c37 2025-01-08) 2025-01-09 13:41:32 +00:00
bjorn3
f6d58eb790 Update dependencies 2025-01-09 12:03:15 +00:00
bjorn3
517118e160 Make it easier to use unreleased versions of Cranelift 2025-01-09 12:00:00 +00:00
bjorn3
0e8e9b3887 Put rustc_codegen_cranelift.dll in bin rather than lib on Windows
rustc-clif has long been changed from a custom driver linking against
cg_clif to a wrapper around rustc which passes -Zcodegen-backend.
2025-01-09 10:26:50 +00:00
bjorn3
916a0b3225 Minor cleanup 2025-01-09 10:24:27 +00:00
bjorn3
0335dc131f Make TimingGuard a little safer 2025-01-07 15:38:44 +00:00
bjorn3
a28b98650f Remove a couple of obsolete tests
mod_bench is basically useless as test and hasn't been used as benchmark
for a long time. alloc_example doesn't test anything that isn't
already tested by std_example.
2025-01-07 15:19:40 +00:00
bjorn3
adf0f41983 Merge branch 'sync_from_rust' 2025-01-05 15:49:03 +00:00
bjorn3
a2d78f77f4 Merge commit '918acafef6' into sync_cg_clif-2025-01-05 2025-01-05 15:44:46 +00:00
bjorn3
918acafef6 Fix rustc test suite 2025-01-05 15:28:26 +00:00
bjorn3
62d3654327 Rustup to rustc 1.86.0-nightly (1891c2866 2025-01-04) 2025-01-05 15:11:06 +00:00
bjorn3
36376f5572 Sync from rust 1891c28669 2025-01-05 15:00:29 +00:00
bjorn3
113af154d4 Stop building and testing mingw cross-toolchain
It isn't all that useful and wine has started crashing in CI
2024-12-29 13:35:43 +00:00
bjorn3
4cc1c9036d Use -ffunction-sections by default again
Cranelift now uses the same section name for all subsections which
reduces the size overhead of -ffunction-sections.
2024-12-28 21:42:01 +00:00
bjorn3
7f98f34420 Update to Cranelift 0.115 2024-12-28 20:06:43 +00:00
bjorn3
1723075aff Fix rustc test suite 2024-12-28 16:30:39 +00:00
bjorn3
a177ed55a7 Rustup to rustc 1.85.0-nightly (dd84b7d5e 2024-12-27) 2024-12-28 14:45:45 +00:00
bjorn3
446c582ce0 Sync from rust dd84b7d5ee 2024-12-28 13:32:14 +00:00
Trevor Gross
cd271d811e Update compiler-builtins to 0.1.140
Nothing significant here, just syncing the following small changes:

- https://github.com/rust-lang/compiler-builtins/pull/727
- https://github.com/rust-lang/compiler-builtins/pull/730
- https://github.com/rust-lang/compiler-builtins/pull/736
- https://github.com/rust-lang/compiler-builtins/pull/737
2024-12-27 22:26:08 +00:00
Scott McMurray
5e58dc1e96 Delete Rvalue::Len
Everything's moved to `PtrMetadata` instead.
2024-12-22 06:12:39 -08:00
bjorn3
1f66d7d47f Make DependencyList an IndexVec 2024-12-19 15:30:32 +00:00
bjorn3
ad2b9ac18d Rustup to rustc 1.85.0-nightly (4ba4ac612 2024-12-18) 2024-12-19 15:20:38 +00:00
bjorn3
c5291585b3 Sync from rust 4ba4ac612d 2024-12-19 15:13:56 +00:00
bjorn3
da415e17c8
Merge pull request #1550 from jyn514/logging
hook up tracing to cg_cranelift
2024-12-19 13:53:18 +01:00
许杰友 Jieyou Xu (Joe)
47e42c8815 Rollup merge of #133702 - RalfJung:single-variant, r=oli-obk
Variants::Single: do not use invalid VariantIdx for uninhabited enums

~~Stacked on top of https://github.com/rust-lang/rust/pull/133681, only the last commit is new.~~

Currently, `Variants::Single` for an empty enum contains a `VariantIdx` of 0; looking that up in the enum variant list will ICE. That's quite confusing. So let's fix that by adding a new `Variants::Empty` case for types that have 0 variants.

try-job: i686-msvc
2024-12-19 16:48:07 +08:00
jyn
b046e32262 hook up tracing to cg_cranelift
this was easier than expected. here is an example of using RUSTC_LOG with a build of cranelift from rust-lang/rust:
```
$ RUSTC_LOG=rustc_codegen_cranelift cargo +stage1 b
   Compiling example v0.1.0 (/home/jyn/src/example)
 INFO rustc_codegen_cranelift codegen crate example
 INFO rustc_codegen_cranelift codegen crate example
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.44s
```
2024-12-18 17:53:20 -05:00
bjorn3
53bbef8305 Remove host and target configuration from config.txt
They can still be set using HOST_TRIPLE and TARGET_TRIPLE.
2024-12-18 18:36:05 +00:00
bjorn3
88139f0c6b Move the benchmark markdown files from dist/ to build/ 2024-12-18 18:24:13 +00:00
bjorn3
cae568eeb4 Use the compiler returned by build_sysroot for benchmarking
Rather than trying to fish it out of the default target location dist/.
This reduces the amount of places where the presence of the dist dir is
hardcoded.
2024-12-18 18:13:59 +00:00
bjorn3
8521e70019 Simplify RelPath implementation 2024-12-18 18:11:47 +00:00
bjorn3
a220a53af3 Disable testing on wine
Wine started crashing for whatever reason. Supporting native Windows is
much more important and already tested separately.
2024-12-18 17:48:08 +00:00
bjorn3
9f50fa7e21 Ensure user trap code 0 is never used
Cranelift will return None from TrapCode::user(0).

Fixes rust-lang/rustc_codegen_cranelift#1548
2024-12-18 17:07:56 +00:00
acceptacross
3227f35177 chore: fix some typos
Signed-off-by: acceptacross <csqcqs@gmail.com>
2024-12-18 23:23:44 +08:00
bjorn3
67c241e33b Fix rustc test suite 2024-12-18 15:23:22 +00:00
bjorn3
076ae56bda Rustup to rustc 1.85.0-nightly (a4cb3c831 2024-12-17) 2024-12-18 15:12:35 +00:00
bjorn3
1587f77aa9 Sync from rust a4cb3c8318 2024-12-18 14:55:12 +00:00
Ralf Jung
a6cf662f93 make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
Ralf Jung
2d32e43d38 Variants::Single: do not use invalid VariantIdx for uninhabited enums 2024-12-18 11:00:21 +01:00
Nicholas Nethercote
4dd8941d3f Re-export more rustc_span::symbol things from rustc_span.
`rustc_span::symbol` defines some things that are re-exported from
`rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some
closely related things such as `Ident` and `kw`. So you can do `use
rustc_span::{Symbol, sym}` but you have to do `use
rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good
reason.

This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`,
and changes many `rustc_span::symbol::` qualifiers in `compiler/` to
`rustc_span::`. This is a 200+ net line of code reduction, mostly
because many files with two `use rustc_span` items can be reduced to
one.
2024-12-18 13:38:53 +11:00
Matthias Krüger
884dcee945 Rollup merge of #134251 - bjorn3:various_cleanups2, r=oli-obk
A bunch of cleanups (part 2)

Just like https://github.com/rust-lang/rust/pull/133567 these were all found while looking at the respective code, but are not blocking any other changes I want to make in the short term.
2024-12-14 03:54:35 +01:00
bjorn3
c99d4f0f51 Make dependency_formats an FxIndexMap rather than a list of tuples
It is treated as a map already. This is using FxIndexMap rather than
UnordMap because the latter doesn't provide an api to pick a single
value iff all values are equal, which each_linked_rlib depends on.
2024-12-13 11:29:15 +00:00
bjorn3
37b47f9542 Remove jobserver from Session
It is effectively a global resource and the jobserver::Client in Session
was a clone of GLOBAL_CLIENT anyway.
2024-12-13 10:21:22 +00:00
Ralf Jung
8d3a263c79 generalize 'forbidden feature' concept so that even (un)stable feature can be invalid to toggle
Also rename some things for extra clarity
2024-12-11 22:11:15 +01:00
bjorn3
3ebaf04707 Fix rustc test suite 2024-12-11 11:04:50 +00:00
bjorn3
e1461e2c7e Rustup to rustc 1.85.0-nightly (33c245b9e 2024-12-10) 2024-12-11 10:47:08 +00:00
bjorn3
14fbfb0460 Sync from rust 33c245b9e9 2024-12-11 10:36:18 +00:00
León Orell Valerian Liehr
1c9a333c7c Rollup merge of #134008 - jswrenn:unsafe-fields-copy, r=compiler-errors
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 entail `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

r? ```@compiler-errors```
2024-12-10 13:51:10 +01:00
Matthias Krüger
14f12919f6 Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillot
A bunch of cleanups

These are all extracted from a branch I have to get rid of driver queries. Most of the commits are not directly necessary for this, but were found in the process of implementing the removal of driver queries.

Previous PR: https://github.com/rust-lang/rust/pull/132410
2024-12-09 01:56:32 +01:00