Commit Graph

4431 Commits

Author SHA1 Message Date
bjorn3
30be8bcb45 Remove --cfg no_unstable_features 2024-06-29 15:06:08 +00:00
bjorn3
3d54358b64 Update object to 0.36.1
This fixes a crash with macOS's ld-prime on arm64.

Fixes rust-lang/rustc_codegen_cranelift#1501
2024-06-29 15:13:34 +02:00
bjorn3
e97cebb2b1 Use dyn Module instead of impl Module where possible 2024-06-28 11:51:17 +00:00
bjorn3
cc05efe29e Introduce UnwindModule wrapper around a Module and UnwindContext
This way all UnwindContext::add_function calls can be done automatically
in a single place.
2024-06-28 11:51:00 +00:00
bjorn3
94c2e7aad3 Fix rustc test suite 2024-06-26 09:33:35 +00:00
bjorn3
476b7bdbe5 Rustup to rustc 1.81.0-nightly (fda509e81 2024-06-25) 2024-06-26 09:13:12 +00:00
bjorn3
8d11939589 Sync from rust fda509e817 2024-06-26 09:11:55 +00:00
Jubilee Young
f1052eb253 cg_clif: Define build opts from FramePointer 2024-06-23 00:36:33 -07:00
bjorn3
aa5d7a0d8a Update platform support table for the new arm64 macOS support
Closes rust-lang/rustc_codegen_cranelift#1248
2024-06-21 12:31:16 +00:00
bjorn3
2a378251fb Update to Cranelift 0.109 2024-06-20 17:05:08 +00:00
bjorn3
cdad523e5f
Merge pull request #1500 from beetrees/mac-arm64-va-call
Fix varargs support on `aarch64-apple-darwin`
2024-06-20 13:45:48 +02:00
beetrees
b0fcf2e27a
Add aarch64-apple-darwin to CI 2024-06-20 00:08:08 +01:00
beetrees
8556604bc6
Fix varargs support on aarch64-apple-darwin 2024-06-20 00:08:08 +01:00
Scott McMurray
e79dc7656a bug! more uses of these in runtime stuff 2024-06-19 10:44:01 -07:00
Guillaume Gomez
1cb728280d
Re-enable tests/run-make/const_fn_mir (#1497) 2024-06-18 18:51:53 +02:00
bjorn3
729cb08d4c Fix rustc tests 2024-06-18 16:23:11 +00:00
bjorn3
c5bd2e3b90 Rustup to rustc 1.81.0-nightly (59e2c01c2 2024-06-17) 2024-06-18 16:14:35 +00:00
bjorn3
88a5f32ed5 Sync from rust 59e2c01c22 2024-06-18 16:04:56 +00:00
Oli Scherer
afef64c1bd Use a dedicated type instead of a reference for the diagnostic context
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-18 15:42:11 +00:00
bjorn3
e241176535 Fix rustc tests 2024-06-17 08:27:46 +00:00
bjorn3
a4b36e5adb Rustup to rustc 1.81.0-nightly (d7f6ebace 2024-06-16) 2024-06-17 08:27:46 +00:00
bjorn3
0d1d00478c Sync from rust d7f6ebacee 2024-06-17 07:50:36 +00:00
Michael Goulet
54aa510c32 Rename InstanceDef -> InstanceKind 2024-06-16 21:35:21 -04:00
bors
5c6849b1df Auto merge of #126505 - compiler-errors:no-vtable, r=lcnr
Only compute vtable information during codegen

This PR removes vtable information from the `Object` and `TraitUpcasting` candidate sources in the trait solvers, and defers the computation of relevant information to `Instance::resolve`. This is because vtables really aren't a thing in the trait world -- they're an implementation detail in codegen.

Previously it was just easiest to tangle this information together since we were already doing the work of looking at all the supertraits in the trait solver, and specifically because we use traits to represent when it's possible to call a method via a vtable (`Object` candidate) and do upcasting (`Unsize` candidate). but I am somewhat suspicious we're doing a *lot* of extra work, especially in polymorphic contexts, so let's see what perf says.
2024-06-16 05:33:49 +00:00
Michael Goulet
5ccfa787fd Only compute vtable information during codegen 2024-06-14 20:35:45 -04:00
Michael Goulet
c867677971 Use is_lang_item more aggressively 2024-06-14 16:54:29 -04:00
bors
c7d3c4f67f Auto merge of #126319 - workingjubilee:rollup-lendnud, r=workingjubilee
Rollup of 16 pull requests

Successful merges:

 - #123374 (DOC: Add FFI example for slice::from_raw_parts())
 - #124514 (Recommend to never display zero disambiguators when demangling v0 symbols)
 - #125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking)
 - #125980 (Nvptx remove direct passmode)
 - #126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.)
 - #126210 (docs(core): make more const_ptr doctests assert instead of printing)
 - #126249 (Simplify `[T; N]::try_map` signature)
 - #126256 (Add {{target}} substitution to compiletest)
 - #126263 (Make issue-122805.rs big endian compatible)
 - #126281 (set_env: State the conclusion upfront)
 - #126286 (Make `storage-live.rs` robust against rustc internal changes.)
 - #126287 (Update a cranelift patch file for formatting changes.)
 - #126301 (Use `tidy` to sort crate attributes for all compiler crates.)
 - #126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`)
 - #126310 (Migrate run make prefer rlib)
 - #126314 (fix RELEASES: we do not support upcasting to auto traits)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-06-12 11:10:50 +00:00
Jubilee
03a2764b68 Rollup merge of #126301 - nnethercote:sort-crate-attributes, r=davidtwco
Use `tidy` to sort crate attributes for all compiler crates.

We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.

For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order.
- Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`.

This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions.

Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).

r? `@davidtwco`
2024-06-12 03:57:24 -07:00
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
Nicholas Nethercote
0b7375f2a0 Use tidy to sort crate attributes for all compiler crates.
We already do this for a number of crates, e.g. `rustc_middle`,
`rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.

For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g.
  `allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes),
  sometimes the order is alphabetical, and sometimes there is no
  particular order.
- Sometimes the attributes of a particular kind aren't even grouped
  all together, e.g. there might be a `feature`, then an `allow`, then
  another `feature`.

This commit extends the existing sorting to all compiler crates,
increasing consistency. If any new attribute line is added there is now
only one place it can go -- no need for arbitrary decisions.

Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
  because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
  ignored in `rustfmt.toml`).
2024-06-12 15:49:10 +10:00
Nicholas Nethercote
02b20f8871 Update a cranelift patch file for formatting changes.
PR #125443 will reformat all the use declarations in the repo. This
would break a patch kept in `rustc_codegen_cranelift` that gets applied
to `library/std/src/sys/pal/windows/rand.rs`.

So this commit formats the use declarations in
`library/std/src/sys/pal/windows/rand.rs` in advance of #125443 and
updates the patch file accordingly.

The motivation is that #125443 is a huge change and we want to get
fiddly little changes like this out of the way so it can be nothing more
than an `x fmt --all`.
2024-06-12 08:52:40 +10:00
bjorn3
ee188cabc2 Fix rustc test suite 2024-06-11 13:47:34 +00:00
bjorn3
c06cbc8dbe Rustup to rustc 1.81.0-nightly (b5b13568f 2024-06-10) 2024-06-11 12:18:15 +00:00
bjorn3
c0477a1231 Sync from rust b5b13568fb 2024-06-11 11:54:36 +00:00
Ralf Jung
0eb782ba13 ScalarInt: size mismatches are a bug, do not delay the panic 2024-06-10 13:43:16 +02:00
Ralf Jung
6210c26a5a offset_of: allow (unstably) taking the offset of slice tail fields 2024-06-08 18:17:55 +02:00
bjorn3
c511676a62
Merge pull request #1495 from folkertdev/add-llvm-sse2-cvtps2dq
add `llvm.x86.sse2.cvtps2dq`
2024-06-06 23:25:16 +02:00
Folkert
63cb28ed48
add llvm.x86.sse2.cvtps2dq 2024-06-06 22:43:28 +02:00
Boxy
5d0ec8d162 Misc fixes to cranelift/clippy/miri 2024-06-05 22:25:42 +01:00
bjorn3
632e5df38a Remove unreachable fatal error 2024-06-04 16:42:15 +02:00
bjorn3
406770001e Don't require the bench job to pass for a new release
cc rust-lang/rust#125493
2024-06-04 16:26:51 +02:00
bjorn3
97d47f7077 Fix rustc tests 2024-06-04 16:21:13 +02:00
bjorn3
eb449c1339 Move error on -Cinstrument-coverage earlier and elaborate that it is LLVM specific
cc rust-lang/rustc_codegen_cranelift#1494
2024-06-04 16:02:36 +02:00
bors
be961b0101 Auto merge of #122597 - pacak:master, r=bjorn3
Show files produced by `--emit foo` in json artifact notifications

Right now it is possible to ask `rustc` to save some intermediate representation into one or more files with `--emit=foo`, but figuring out what exactly was produced is difficult. This pull request adds information about `llvm_ir` and `asm` intermediate files into notifications produced by `--json=artifacts`.

Related discussion: https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477

Motivation - `cargo-show-asm` parses those intermediate files and presents them in a user friendly way, but right now I have to apply some dirty hacks. Hacks make behavior confusing: https://github.com/hintron/computer-enhance/issues/35

This pull request introduces a new behavior: now `rustc` will emit a new artifact notification for every artifact type user asked to `--emit`, for example for `--emit asm` those will include all the `.s` files.

Most users won't notice this behavior, to be affected by it all of the following must hold:
- user must use `rustc` binary directly (when `cargo` invokes `rustc` - it consumes artifact notifications and doesn't emit anything)
- user must specify both `--emit xxx` and `--json artifacts`
- user must refuse to handle unknown artifact types
- user must disable incremental compilation (or deal with it better than cargo does, or use a workaround like `save-temps`) in order not to hit #88829 / #89149
2024-06-04 00:05:56 +00:00
bjorn3
8f1d41e2a0 Implement _rdtsc x86 vendor intrinsic
Fixes rust-lang/rustc_codegen_cranelift#1493
2024-06-02 11:19:47 +02:00
bjorn3
ab10da27a1 Fix rustc test suite 2024-05-30 16:42:52 +00:00
bjorn3
a255965849 Rustup to rustc 1.80.0-nightly (debd22da6 2024-05-29) 2024-05-30 16:34:21 +00:00
bjorn3
a0ea60b3b2 Sync from rust debd22da66 2024-05-30 16:26:07 +00:00
许杰友 Jieyou Xu (Joe)
db4dbc84a5 Rollup merge of #124251 - scottmcm:unop-ptr-metadata, r=oli-obk
Add an intrinsic for `ptr::metadata`

The follow-up to #123840, so we can remove `PtrComponents` and `PtrRepr` from libcore entirely (well, after a bootstrap update).

As discussed in <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/.60ptr_metadata.60.20in.20MIR/near/435637808>, this introduces `UnOp::PtrMetadata` taking a raw pointer and returning the associated metadata value.

By no longer going through a `union`, this should also help future PRs better optimize pointer operations.

r? ``@oli-obk``
2024-05-29 03:25:07 +01:00
Scott McMurray
676fec7c65 Add an intrinsic for ptr::metadata 2024-05-28 09:28:51 -07:00