Commit Graph

258645 Commits

Author SHA1 Message Date
Jubilee
539090e5cd
Rollup merge of #126809 - estebank:wording-tweak, r=oli-obk
Remove stray `.` from error message
2024-06-21 21:02:28 -07:00
Jubilee
b9ab6c3501
Rollup merge of #126798 - miguelfrde:master, r=tmandry
[fuchsia-test-runner] Remove usage of kw_only

We are still at Python 3.8 in Fuchsia infra. This was introduced at Python 3.10.

r? tmandry
r? erickt
2024-06-21 21:02:28 -07:00
Jubilee
9498d5cf2f
Rollup merge of #126787 - Strophox:get-bytes, r=RalfJung
Add direct accessors for memory addresses in `Machine` (for Miri)

The purpose of this PR is to enable direct (immutable) access to memory addresses in `Machine`, which will be needed for further extension of Miri.

This is done by adding (/completing missings pairs of) accessor functions, with the relevant signatures as follows:
```rust
/* rust/compiler/rustc_middle/src/mir/interpret/allocation.rs */

pub trait AllocBytes {
  // ..

  fn as_ptr(&self) -> *const u8;
/*fn as_mut_ptr(&mut self) -> *mut u8; -- Already in the compiler*/
}

impl<Prov: Provenance, Extra, Bytes: AllocBytes> Allocation<Prov, Extra, Bytes> {
  // ..

  pub fn get_bytes_unchecked_raw(&self) -> *const u8;
/*pub fn get_bytes_unchecked_raw_mut(&mut self) -> *mut u8; -- Already in the compiler*/
}
```
```rust
/* rust/compiler/rustc_const_eval/src/interpret/memory.rs */

impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
  // ..

  pub fn get_alloc_bytes_unchecked_raw(&self, id: AllocId) -> InterpResult<'tcx, *const u8>;
  pub fn get_alloc_bytes_unchecked_raw_mut(&mut self, id: AllocId) -> InterpResult<'tcx, *mut u8>;
}
```

r? ``@RalfJung``
2024-06-21 21:02:27 -07:00
Jubilee
1f9793f1aa
Rollup merge of #126722 - adwinwhite:ptr_fn_abi, r=celinval
Add method to get `FnAbi` of function pointer

Provide a StableMIR API to query `FnAbi` of a function pointer.

Fixes [rust-lang/project-stable-mir#63](https://github.com/rust-lang/project-stable-mir/issues/63)
2024-06-21 21:02:27 -07:00
Jubilee
84b0922565
Rollup merge of #126712 - Oneirical:bootest-constestllation, r=jieyouxu
Migrate `relocation-model`, `error-writing-dependencies` and `crate-name-priority` `run-make` tests to rmake

Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html).

Needs MSVC try-job due to #28026, almost guaranteed to fail, but let's see anyways.

try-job: aarch64-gnu
`/* try-job: x86_64-msvc */`
try-job: x86_64-apple-1
try-job: armhf-gnu
try-job: test-various
2024-06-21 21:02:26 -07:00
Jubilee
e7956cd994
Rollup merge of #126530 - beetrees:f16-inline-asm-riscv, r=Amanieu
Add `f16` inline ASM support for RISC-V

This PR adds `f16` inline ASM support for RISC-V. A `FIXME` is left for `f128` support as LLVM does not support the required `Q` (Quad-Precision Floating-Point) extension yet.

Relevant issue: #125398
Tracking issue: #116909

`@rustbot` label +F-f16_and_f128
2024-06-21 21:02:26 -07:00
bors
10e1f5d212 Auto merge of #124101 - the8472:pidfd-methods, r=cuviper
Add PidFd::{kill, wait, try_wait}

#117957 changed `Child` kill/wait/try_wait to use its pidfd instead of the pid, when one is available.
This PR extracts those implementations and makes them available on `PidFd` directly.

The `PidFd` implementations differ significantly from the corresponding `Child` methods:

* the methods can be called after the child has been reaped, which will result in an error but will be safe. This state is not observable in `Child` unless something stole the zombie child
* the `ExitStatus` is not kept, meaning that only the first time a wait succeeds it will be returned
* `wait` does not close stdin
* `wait` only requires `&self` instead of `&mut self` since there is no state to maintain and subsequent calls are safe

Tracking issue: #82971
2024-06-22 03:35:52 +00:00
Weihang Lo
2c65a24b8c
Update cargo 2024-06-21 22:47:06 -04:00
Scott McMurray
b28efb11af Save 2 pointers in TerminatorKind (96 → 80 bytes)
These things don't need to be `Vec`s; boxed slices are enough.

The frequent one here is call arguments, but MIR building knows the number of arguments from the THIR, so the collect is always getting the allocation right in the first place, and thus this shouldn't ever add the shrink-in-place overhead.
2024-06-21 18:02:05 -07:00
bors
fcae62649e Auto merge of #126758 - spastorino:avoid-safe-outside-unsafe-blocks, r=compiler-errors
Do not allow safe/unsafe on static and fn items

Fixes #126749

r? `@compiler-errors`

Tracking:

- https://github.com/rust-lang/rust/issues/123743
2024-06-22 00:40:12 +00:00
Caleb Cartwright
e4944185ae chore: bump version 2024-06-21 18:20:47 -05:00
Michael Goulet
ffd72b1700 Fix remaining cases 2024-06-21 19:00:18 -04:00
Michael Goulet
ea681ef281 Add a tidy rule to make sure that diagnostics don't end in periods 2024-06-21 19:00:18 -04:00
The 8472
8abf149bde to extract a pidfd we must consume the child
As long as a pidfd is on a child it can be safely reaped. Taking it
would mean the child would now have to be awaited through its pid, but could also
be awaited through the pidfd. This could then suffer from a recycling race.
2024-06-22 00:46:55 +02:00
The 8472
0787c7308c Add PidFd::{kill, wait, try_wait} 2024-06-22 00:46:55 +02:00
Yacin Tmimi
6c3c4308bb document rustfmt support for #![feature(unsafe_extern_blocks)] 2024-06-21 16:57:45 -05:00
Yacin Tmimi
6daf3c1778 Document removing rustfmt's lazy_static dependency 2024-06-21 16:57:45 -05:00
Yacin Tmimi
e2feea47bc Document fix for retaining inner attributes on const blocks 2024-06-21 16:57:45 -05:00
Yacin Tmimi
9748af80c6 reorder link reference definitions and one changelog entry
Moved the link reference definitions closer to where they were being
used and moved the `type ascription` formatting fix to the correct
section.
2024-06-21 16:57:45 -05:00
Yacin Tmimi
0737d553ed Add changelog entry for match expr inner attribute fix with version=Two 2024-06-21 16:57:45 -05:00
Yacin Tmimi
5cab54ff1e Add itertools v0.11 -> v0.12 bump to changelog 2024-06-21 16:57:45 -05:00
Yacin Tmimi
51ae60ca33 add link to dirs v5 changelog 2024-06-21 16:57:45 -05:00
Yacin Tmimi
591df0823c Add missing issue reference 2024-06-21 16:57:45 -05:00
Yacin Tmimi
eca7a94033 move trace! macro fixes to Changed section. 2024-06-21 16:57:45 -05:00
Yacin Tmimi
4b3498b188 Add another batch of updates to the changelog 2024-06-21 16:57:45 -05:00
Esteban Küber
5d5892e966 Remove stray . from error message 2024-06-21 21:13:10 +00:00
David Carlier
65530ba100
std::unix::fs: copy simplification for apple.
since we do support from macOs Sierra, we avoid the little runtime overhead
with the fclonefileat symbol check.
2024-06-21 21:22:57 +01:00
bors
c1b336cb6b Auto merge of #126650 - compiler-errors:renames, r=lcnr
Rename a bunch of things in the new solver and `rustc_type_ir`

* Renames `interner()` to `cx()` in the solver and `TypeFolder`.
* Renames `Infcx` generic param to `D`
* Moves `infcx.rs` to `delegate.rs`

r? lcnr
2024-06-21 18:14:50 +00:00
bors
9b33872c89 Auto merge of #17469 - roife:fix-issue-17425, r=Veykril
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs

fix #17425.

When converting `PathResolution` to `ItemInNs`, we should convert `ModuleDef::Macro` to `ItemInNs::Macros` to ensure that it can be found in `DefMap`.
2024-06-21 17:52:42 +00:00
Miguel Flores Ruiz de Eguino
d94a40516e
[fuchsia-test-runner] Remove usage of kw_only
We are still at Python 3.8 in Fuchsia infra. This was introduced at
Python 3.10.
2024-06-21 10:48:30 -07:00
beetrees
771e44ebd3
Add f16 inline ASM support for RISC-V 2024-06-21 18:48:20 +01:00
bors
398e3a3c28 Auto merge of #17474 - Veykril:ty-perf-stuff, r=Veykril
internal: Remove some allocations from hir-ty
2024-06-21 17:39:45 +00:00
beetrees
753fb070bb
Add f16 inline ASM support for 32-bit ARM 2024-06-21 18:26:42 +01:00
Lukas Wirth
619574928c Prevent re-allocation in CallableSig::from_params_and_return 2024-06-21 19:26:08 +02:00
Lukas Wirth
54f3f56ee8 Save allocations for empty generic_defaults query results 2024-06-21 19:21:27 +02:00
bors
36c37313a0 Auto merge of #17473 - Veykril:generics, r=Veykril
internal: Tidy up generics handling in hir-ty a bit
2024-06-21 17:12:35 +00:00
Lukas Wirth
2893153c34 Don't attempt to compute implict sized clauses for empty generics 2024-06-21 19:10:57 +02:00
Lukas Wirth
5cbaa3f554 Save allocations for empty generic_predicates query results 2024-06-21 19:10:45 +02:00
Lukas Wirth
873dcf4b9c Lazy generics 2024-06-21 18:38:37 +02:00
Michael Goulet
db638ab968 Rename a bunch of things 2024-06-21 12:32:05 -04:00
Lukas Wirth
3b97b75599 Simplify 2024-06-21 18:27:05 +02:00
bors
5ced3dad57 Auto merge of #125853 - tesuji:promote-fail-fast, r=cjgillot
promote_consts: some clean-up after experimenting

This is some clean-up after experimenting in #125916,
Prefer to review commit-by-commit.
2024-06-21 16:00:14 +00:00
Lukas Wirth
3a66230a44 There can only be one self param 2024-06-21 17:55:16 +02:00
Lukas Wirth
c133c649a0 Light docs and privacy 2024-06-21 17:54:40 +02:00
Yacin Tmimi
30cdc2b3e9 format safety keywords on static items
This includes both `ast::StaticItem` and `ast::StaticForeignItem`.
`safety` was added to both `ast::StaticItem` and `ast::SaticForeignItem`
in https://github.com/rust-lang/rust/pull/124482.
2024-06-21 09:11:07 -05:00
Lzu Tao
7002a3f37f interpret: use trace to reduce noice 2024-06-21 13:51:33 +00:00
Lzu Tao
62a287528a Reuse allocation for Vec<Candidate> 2024-06-21 13:51:33 +00:00
bors
25c9f2ca06 Auto merge of #123165 - oli-obk:no_ord_def_id3, r=cjgillot
Stop sorting `Span`s' `SyntaxContext`, as that is incompatible with incremental

work towards https://github.com/rust-lang/rust/issues/90317

Luckily no one actually needed these to be sorted, so it didn't even affect diagnostics. I'm guessing they'd have been sorted by creation time anyway, so it wouldn't really have mattered.

r? `@cjgillot`
2024-06-21 13:47:43 +00:00
roife
51b138cc79 fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs 2024-06-21 21:05:14 +08:00
Santiago Pastorino
22831ed117
Do not allow safe usafe on static and fn items 2024-06-21 09:12:13 -03:00