Commit Graph

151615 Commits

Author SHA1 Message Date
Matthias Krüger
df9c87cc2a
Rollup merge of #129634 - compiler-errors:tidy-2024, r=albertlarsan68
Fix tidy to allow `edition = "2024"` in `Cargo.toml`

Needed to upgrade to edition 2024 eventually.
2024-08-27 18:59:28 +02:00
bors
600edc948a Auto merge of #128134 - joboet:move_pal_alloc, r=cupiver
std: move allocators to `sys`

Part of #117276.
2024-08-27 13:51:39 +00:00
joboet
e9566ce9e9
bless miri test 2024-08-27 11:58:20 +02:00
Trevor Gross
3c131a3f54
Rollup merge of #129490 - randomPoison:trusty-os-support, r=Urgau
Add Trusty OS as tier 3 target

This PR adds support for the [Trusty secure operating system](https://source.android.com/docs/security/features/trusty) as a Tier 3 supported target. This upstreams [the patch that we have been using](https://cs.android.com/android/platform/superproject/+/master:external/rust/crates/libc/patches/trusty.patch;l=1;drc=122e586e93a534160230dc10ae3474cf31dd8f7f) internally. This also revives https://github.com/rust-lang/rust/pull/103895 which was closed due to inactivity, and is being resumed now that time allows.

And MCP has already been done for adding this platform: rust-lang/compiler-team/issues/568

# Target Tier Policy Acknowledgements

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

- Nicole LeGare (``@randomPoison)``
- Stephen Crane (``@rinon)``
- As a fallback trusty-dev-team@google.com can be contacted

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

The two new Trusty targets, `aarch64-unknown-trusty` and `armv7-unknown-trusty` both follow the existing naming convention for similar targets.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

👍

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

There are no known legal issues or license incompatibilities.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

👍

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

This PR only adds the targets for the platform. `std` support will be added once platform support is added to the libc crate, which depends on the language targets being added to rustc.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

👍

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ``@)`` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

👍

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

👍

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

👍
2024-08-27 01:46:52 -05:00
Trevor Gross
427019e37f
Rollup merge of #128942 - RalfJung:interpret-weak-memory, r=saethlin
miri weak memory emulation: put previous value into initial store buffer

Fixes https://github.com/rust-lang/miri/issues/2164 by doing a read before each atomic write so that we can initialize the store buffer. The read suppresses memory access hooks and UB exceptions, to avoid otherwise influencing the program behavior. If the read fails, we store that as `None` in the store buffer, so that when an atomic read races with the first atomic write to some memory and previously the memory was uninitialized, we can report UB due to reading uninit memory.

``@cbeuw`` this changes a bit the way we initialize the store buffers. Not sure if you still remember all this code, but if you could have a look to make sure this still makes sense, that would be great. :)

r? ``@saethlin``
2024-08-27 01:46:51 -05:00
Trevor Gross
e209b05037
Rollup merge of #128935 - lqd:needs-zstd, r=Kobzol
More work on `zstd` compression

r? ``@Kobzol`` as we've discussed this.

This is a draft to show the current approach of supporting zstd in compiletest, and making the tests using it unconditional.

Knowing whether llvm/lld was built with `LLVM_ENABLE_ZSTD` is quite hard, so there are two strategies. There are details in the code, and we can discuss this approach. Until we know the config used to build CI artifacts, it seems our options are somewhat limited in any case.

zlib compression seems always enabled, so we only check this in its dedicated test, allowing the test to ignore errors due to zstd not being supported.

The zstd test is made unconditional in what it tests, by relying on `needs-llvm-zstd` to be ignored when `llvm.libzstd` isn't enabled in `config.toml`.

try-job: x86_64-gnu
try-job: x86_64-msvc
try-job: x86_64-gnu-distcheck
2024-08-27 01:46:50 -05:00
Trevor Gross
9c132b29e7
Rollup merge of #127922 - spastorino:unsafe-extern-blocks-in-style-guide, r=compiler-errors
Add unsafe to extern blocks in style guide

This goes after this is merged:

- https://github.com/rust-lang/rust/pull/127921

r? ``@traviscross``

Tracking:

- https://github.com/rust-lang/rust/issues/123743
2024-08-27 01:46:49 -05:00
Trevor Gross
9c26ebe32e
Rollup merge of #126985 - Mrmaxmeier:dwarf-embed-source, r=davidtwco
Implement `-Z embed-source` (DWARFv5 source code embedding extension)

Implement https://github.com/rust-lang/compiler-team/issues/764 MCP which adds an unstable flag that exposes LLVM's [DWARFv5 source code embedding](https://dwarfstd.org/issues/180201.1.html) support.
2024-08-27 01:46:49 -05:00
Michael Goulet
56d861134d Fix tidy 2024-08-26 19:49:47 -04:00
Matthias Krüger
862b911551
Rollup merge of #129560 - GuillaumeGomez:impl-assoc-type-source-link, r=notriddle
[rustdoc] Generate source link on impl associated types

Currently, impl associated types are generated but don't get a source link. This PR fixes that.

Before:

![image](https://github.com/user-attachments/assets/3a22adb5-8b66-4124-9267-7c26eed1aa5e)

After:

![Screenshot from 2024-08-25 16-31-36](https://github.com/user-attachments/assets/6e9b35e7-4357-4ecf-8c49-1d8294051283)

r? `@notriddle`
2024-08-27 00:42:01 +02:00
Nicole LeGare
5d0ce4c391 Note that std support is WIP 2024-08-26 12:22:17 -07:00
Santiago Pastorino
ebf46f7607
Add unsafe to extern blocks in style guide 2024-08-26 14:55:56 -03:00
Matthias Krüger
aa26e1ad97
Rollup merge of #129525 - notriddle:notriddle/fake-variadic-tuple-array, r=GuillaumeGomez
rustdoc: clean up tuple <-> primitive conversion docs

This adds a minor missing feature to `fake_variadic`, so that it can render `impl From<(T,)> for [T; 1]` correctly.
2024-08-26 01:49:02 +02:00
Rémy Rakic
5d83cb27c8 allow llvm.libzstd with download-ci-llvm = true
but warn about it
2024-08-25 22:17:51 +00:00
Rémy Rakic
650ba7fdf0 enable llvm.libzstd on test x64 linux builder 2024-08-25 22:17:51 +00:00
Rémy Rakic
7963beda24 strip whitespace for ignored tests reason comments 2024-08-25 22:17:51 +00:00
Rémy Rakic
62c8c693bd move and rename zstd script
move it where it's used, and name it like the other scripts
2024-08-25 22:17:51 +00:00
Rémy Rakic
5b374631df compiletest: implement needs-lvm-zstd directive 2024-08-25 22:17:51 +00:00
bors
c6db1ca3c9 Auto merge of #129563 - matthiaskrgr:rollup-t6bai2d, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #129091 (add Box::as_ptr and Box::as_mut_ptr methods)
 - #129134 (bootstrap: improve error recovery flags to curl)
 - #129416 (library: Move unstable API of new_uninit to new features)
 - #129459 (handle stage0 `cargo` and `rustc` separately)
 - #129487 (repr_transparent_external_private_fields: special-case some std types)
 - #129511 (Update minifier to 0.3.1)
 - #129523 (Make `rustc_type_ir` build on stable)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-25 20:29:33 +00:00
Matthias Krüger
c6f7b1f390
Rollup merge of #129511 - GuillaumeGomez:update-minifier, r=notriddle
Update minifier to 0.3.1

It adds support for escaped characters.

PR is https://github.com/GuillaumeGomez/minifier-rs/pull/111.

r? ````@notriddle````
2024-08-25 16:51:06 +02:00
Matthias Krüger
a44e5a94ab
Rollup merge of #129459 - onur-ozkan:separate-stage0-bins, r=Kobzol
handle stage0 `cargo` and `rustc` separately

This change allows setting either `build.cargo` or `build.rustc` without requiring both to be set simultaneously, which was not possible previously.

To try it, set `build.rustc` without setting `build.cargo`, and try to bootstrap on clean build.

Blocker for https://github.com/rust-lang/rust/pull/129152
2024-08-25 16:51:05 +02:00
Matthias Krüger
0e2523eaf8
Rollup merge of #129416 - workingjubilee:partial-move-from-stabilization, r=dtolnay
library: Move unstable API of new_uninit to new features

- `new_zeroed` variants move to `new_zeroed_alloc`
- the `write` fn moves to `box_uninit_write`

The remainder will be stabilized in upcoming patches, as it was decided to only stabilize `uninit*` and `assume_init`.
2024-08-25 16:51:04 +02:00
Matthias Krüger
8e27d4ce42
Rollup merge of #129134 - lolbinarycat:continue-at, r=Kobzol
bootstrap: improve error recovery flags to curl

alternative to #128459

fixes #110178

r? ````@Kobzol````
2024-08-25 16:51:04 +02:00
bors
1a94d839be Auto merge of #129295 - Zalathar:profiler-builtins, r=Kobzol
Build `library/profiler_builtins` from `ci-llvm` if appropriate

Running all of `tests/coverage` requires the LLVM profiler runtime, which requires setting `build.profiler = true`.

Historically, doing that has required checking out the entire `src/llvm-project` submodule. For compiler contributors who otherwise don't need that submodule (thanks to `download-ci-vm`), that's quite inconvenient.

However, thanks to #129116, the downloaded CI LLVM tarball now contains a copy of LLVM's `compiler-rt` directory, which includes all the files needed to build the profiler runtime. So with a little bit of extra logic in bootstrap, we can have `library/profiler_builtins` look for the `compiler-rt` files in `ci-llvm` instead of the `src/llvm-project` submodule.
2024-08-25 14:44:55 +00:00
Guillaume Gomez
b581fed15e Generate missing source link on impl associated types 2024-08-25 16:22:35 +02:00
bors
89103466d7 Auto merge of #129531 - Jarcho:clippyup, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-08-25 11:56:57 +00:00
bors
717aec0f8e Auto merge of #129521 - matthiaskrgr:rollup-uigv77m, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #128596 (stabilize const_fn_floating_point_arithmetic)
 - #129199 (make writes_through_immutable_pointer a hard error)
 - #129246 (Retroactively feature gate `ConstArgKind::Path`)
 - #129290 (Pin `cc` to 1.0.105)
 - #129323 (Implement `ptr::fn_addr_eq`)
 - #129500 (remove invalid `TyCompat` relation for effects)
 - #129501 (panicking: improve hint for Miri's RUST_BACKTRACE behavior)
 - #129505 (interpret: ImmTy: tighten sanity checks in offset logic)
 - #129510 (Fix `elided_named_lifetimes` in code)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-25 08:12:16 +00:00
Trevor Gross
11ebb597cd
Rollup merge of #129512 - lolbinarycat:linkchecker-impl-docs, r=ehuss
update the doc comment on lintchecker b/c it parses html now
2024-08-24 21:03:34 -05:00
Trevor Gross
2412d3c317
Rollup merge of #129492 - tshepang:patch-2, r=chenyukang
Make wasm32 platform support docs easier to read
2024-08-24 21:03:34 -05:00
Trevor Gross
093249af70
Rollup merge of #129430 - lolbinarycat:rustdoc-search-exact-case, r=notriddle
rustdoc: show exact case-sensitive matches first

fixes #119480
2024-08-24 21:03:32 -05:00
Jason Newcomb
6c3f43d5cc Merge commit '0f8eabd6231366bfc1bb1464601297c2d48f8f68' into clippyup 2024-08-24 18:33:44 -04:00
binarycat
56adf87213 rewrite extract_curl_version again 2024-08-24 17:30:33 -04:00
Michael Howell
6df0ccf49e rustdoc: clean up tuple <-> primitive conversion docs
This adds a minor missing feature to `fake_variadic`,
so that it can render `impl From<(T,)> for [T; 1]` correctly.
2024-08-24 14:06:57 -07:00
Matthias Krüger
e664ff5d8c
Rollup merge of #129510 - GrigorenkoPV:fix-elided-named-lifetimes, r=cjgillot
Fix `elided_named_lifetimes` in code

https://github.com/rust-lang/rust/pull/129207#issuecomment-2308428671

r? cjgillot
2024-08-24 22:14:15 +02:00
Matthias Krüger
5611b3714f
Rollup merge of #129501 - RalfJung:miri-rust-backtrace, r=Noratrieb
panicking: improve hint for Miri's RUST_BACKTRACE behavior

Should help with https://github.com/rust-lang/miri/issues/3838
2024-08-24 22:14:14 +02:00
Matthias Krüger
0dfdea1c45
Rollup merge of #128596 - RalfJung:const_fn_floating_point_arithmetic, r=nnethercote
stabilize const_fn_floating_point_arithmetic

Part of https://github.com/rust-lang/rust/issues/128288
Fixes https://github.com/rust-lang/rust/issues/57241

The existing test `tests/ui/consts/const_let_eq_float.rs`  ([link](https://github.com/RalfJung/rust/blob/const_fn_floating_point_arithmetic/tests/ui/consts/const_let_eq_float.rs)) covers the basics, and also Miri has extensive tests covering the interpreter's float machinery. Also, that machinery can already be used on stable inside `const`/`static` initializers, just not inside `const fn`.

This was explicitly called out in https://github.com/rust-lang/rfcs/pull/3514 so in a sense t-lang just recently already FCP'd this, but let's hear from them whether they want another FCP for the stabilization here or whether that was covered by the FCP for the RFC.
Cc ``@rust-lang/lang``

### Open items

- [x] Update the Reference: https://github.com/rust-lang/reference/pull/1566
2024-08-24 22:14:11 +02:00
binarycat
027c47983e update the doc comment on lintchecker b/c it parses html now 2024-08-24 12:35:35 -04:00
Guillaume Gomez
c36b5634cf Update minifier to 0.3.1 2024-08-24 18:34:28 +02:00
Pavel Grigorenko
53ce92770d Fix elided_named_lifetimes in code 2024-08-24 19:21:32 +03:00
Ralf Jung
ec0e16a665 panicking: improve hint for Miri's RUST_BACKTRACE behavior 2024-08-24 14:38:50 +02:00
Zalathar
94aadf0f62 Build library/profiler_builtins from ci-llvm if appropriate 2024-08-24 21:21:34 +10:00
bors
edbc000fa4 Auto merge of #129303 - nikic:llvm19rc3, r=cuviper
Update to LLVM 19 rc 3

I don't think that this fixes any specific issues we've encountered.
2024-08-24 03:53:43 +00:00
Miguel Ojeda
90b4e17a1f CI: rfl: move to temporary commit
Link: https://github.com/rust-lang/rust/pull/129416
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-08-23 20:52:07 -07:00
Tshepang Mbambo
f734f3d8e7
remove extraneous text 2024-08-24 05:40:27 +02:00
Tshepang Mbambo
32e34eef57
make text more easy to read 2024-08-24 03:11:00 +02:00
Nicole LeGare
681a866067 Add Trusty OS as tier 3 target 2024-08-23 16:09:56 -07:00
bors
4074d4902d Auto merge of #129278 - GuillaumeGomez:rm-duplicated-usage-of-unstable-options, r=Kobzol
Remove duplicated usage of `-Zunstable-options` in bootstrap

Surprisingly, sometimes it is in the same function.

r? `@Kobzol`
2024-08-23 21:18:13 +00:00
bors
eef00c8be8 Auto merge of #128507 - Oneirical:testart-from-scratch, r=jieyouxu
Migrate `libtest-thread-limit` `run-make` test 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).

Please try, but **only if normal CI is green**:

// try-job: armhf-gnu // <- failed on this
try-job: aarch64-gnu
2024-08-23 18:30:21 +00:00
binarycat
4c5e888eb6 rustdoc: show exact case-sensitive matches first
fixes #119480
2024-08-23 13:05:24 -04:00
binarycat
69ca95bf7f use tuples for semver, not floats 2024-08-23 11:57:23 -04:00