Commit Graph

264404 Commits

Author SHA1 Message Date
Guillaume Gomez
440076db48
Rollup merge of #128511 - alexcrichton:doc-wasm-features, r=jieyouxu
Document WebAssembly target feature expectations

This commit is a result of the discussion on #128475 and incorporates parts of #109807 as well. This is all done as a new page of documentation for the `wasm32-unknown-unknown` target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires `-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes #109807
Closes #119811
Closes #128475
2024-08-23 12:32:14 +02:00
bors
c8b14ba7b6 Auto merge of #129443 - matthiaskrgr:rollup-tbgdj0p, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #127623 (fix: fs::remove_dir_all: treat internal ENOENT as success)
 - #128876 (Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets)
 - #129055 (Migrate `x86_64-fortanix-unknown-sgx-lvi` `run-make` test to rmake)
 - #129386 (Use a LocalDefId in ResolvedArg.)
 - #129400 (Update `compiler_builtins` to `0.1.120`)
 - #129414 (Fix extern crates not being hidden with `doc(hidden)`)
 - #129417 (Don't trigger refinement lint if predicates reference errors)
 - #129433 (Fix a missing import in a doc in run-make-support)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-23 08:31:26 +00:00
Jakub Beránek
2339560239
kobzol vacation 2024-08-23 10:20:24 +02:00
Matthias Krüger
6c2ee6fe77
Rollup merge of #129433 - GrigorenkoPV:run-make-support-path-rustdoc, r=jieyouxu
Fix a missing import in a doc in run-make-support
2024-08-23 06:26:55 +02:00
Matthias Krüger
32821b9f8a
Rollup merge of #129417 - compiler-errors:refine-err, r=lqd
Don't trigger refinement lint if predicates reference errors

Fixes #129404
2024-08-23 06:26:54 +02:00
Matthias Krüger
65af38a0d2
Rollup merge of #129414 - GuillaumeGomez:fix-doc-hidden-crates, r=notriddle
Fix extern crates not being hidden with `doc(hidden)`

Fixes #126796.

Only the current crate should never be stripped, any other crate should be strippable.

r? ``@notriddle``
2024-08-23 06:26:54 +02:00
Matthias Krüger
79d36669b5
Rollup merge of #129400 - Amjad50:update-compiler-builtins, r=tgross35
Update `compiler_builtins` to `0.1.120`

Includes https://github.com/rust-lang/compiler-builtins/pull/672 which fixes regression issue with Apple and Windows compilers.

try-job: aarch64-apple
try-job: x86_64-apple-1
try-job: x86_64-msvc
2024-08-23 06:26:53 +02:00
Matthias Krüger
487b3d92cf
Rollup merge of #129386 - cjgillot:local-resolved-arg, r=compiler-errors
Use a LocalDefId in ResolvedArg.
2024-08-23 06:26:53 +02:00
Matthias Krüger
fe87433e8a
Rollup merge of #129055 - Oneirical:fortanix-fortification, r=jieyouxu
Migrate `x86_64-fortanix-unknown-sgx-lvi` `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).

The final Makefile! Every Makefile test is now claimed.

This is difficult to test due to the uncommon architecture it is specific to. I don't think it is in the CI (I didn't find it in `jobs.yml`, but if there is a way to test it, please do.

Locally, on Linux, it compiles and panics at the `llvm_filecheck` part (if I replace the `x86_64-fortanix-unknown-sgx` with `x86_64-unknown-linux-gnu`, of course), which is expected.

For this reason, the Makefile and associated script have been kept, but with a leading underscore.
2024-08-23 06:26:52 +02:00
Matthias Krüger
6a1418aafe
Rollup merge of #128876 - ColinFinck:rust-lld-with-runtime-dlls, r=Kobzol,petrochenkov,jieyouxu
Ship MinGW-w64 runtime DLLs along with `rust-lld.exe` for `-pc-windows-gnu` targets

`rust-lld.exe` built for `x86_64-pc-windows-gnu` depends on `libgcc_s_seh-1.dll` and `libwinpthread-1.dll` from MinGW-w64. Until now, they were not shipped alongside `rust-lld.exe`, and you could not run `rust-lld.exe` on most systems.

This problem didn't surface until now because:
* Most targets don't use `rust-lld` by default.
* Some people had these DLLs in their `PATH` from some other MinGW binary.
* `rustup` used to add `bin` to the `PATH`, which contains these DLLs for `rustc.exe`. But it no longer does that: ce3c09a0cb

Fixes #125809

try-job: dist-x86_64-mingw
2024-08-23 06:26:52 +02:00
Matthias Krüger
370b3265ff
Rollup merge of #127623 - lolbinarycat:fix_remove_dir_all, r=Amanieu
fix: fs::remove_dir_all: treat internal ENOENT as success

fixes #127576

try-job: test-various
2024-08-23 06:26:51 +02:00
Gurinder Singh
b544603c03 Fix typo in help diagnostic 2024-08-23 08:21:25 +05:30
Zalathar
585804fcee Check that library/profiler_builtins actually found some source files
The current `build.rs` will automatically skip source files that don't exist.
An unfortunate side-effect is that if _no_ files could be found (e.g. because
the directory was wrong), the build fails with a mysterious linker error.

We can reduce the awkwardness of this by explicitly checking that at least one
source file was found.
2024-08-23 10:10:34 +10:00
Pavel Grigorenko
9ad0b15a8e Fix a missing import in a doc in run-make-support 2024-08-23 02:44:15 +03:00
binarycat
d1b41f3747 remove dbg!() 2024-08-22 19:04:34 -04:00
bors
b5723af345 Auto merge of #129413 - jieyouxu:revert-remove-dir-all, r=compiler-errors
Revert #129187 and #129302

The two PRs naively switched to `std::fs::remove_dir_all`, but failed to gracefully handle the failure case where the top-level directory entry does not exist, causing https://github.com/rust-lang/rust/pull/129187#issuecomment-2304849757 `./x clean` to fail locally when `tmp` does not exist.

I plan to reland the two PRs with fixed top-level dir entry handling and more testing, but let's quickly revert to unblock people.

Reverts #129187.
Reverts #129302.

r? bootstrap
2024-08-22 22:51:03 +00:00
Michael Howell
8151de2820 rustdoc-search: use tighter json for names and parents
File size
---------

```console
$ du -hs doc.old/search-index1.82.0.js doc/search-index1.82.0.js
3.2M    doc.old/search-index1.82.0.js
2.8M    doc/search-index1.82.0.js
$ gzip doc/search-index1.82.0.js
$ gzip doc.old/search-index1.82.0.js
$ du -hs doc.old/search-index1.82.0.js.gz doc/search-index1.82.0.js.gz
464K    doc.old/search-index1.82.0.js.gz
456K    doc/search-index1.82.0.js.gz
$ du -hs compiler-doc.old/search-index.js compiler-doc/search-index.js
8.5M    compiler-doc.old/search-index.js
6.5M    compiler-doc/search-index.js
$ gzip compiler-doc/search-index1.82.0.js
$ gzip compiler-doc.old/search-index1.82.0.js
$ du -hs compiler-doc.old/search-index.js.gz compiler-doc/search-index.js.gz
1.4M    compiler-doc.old/search-index.js.gz
1.4M    compiler-doc/search-index.js.gz
```
2024-08-22 14:33:25 -07:00
bors
eff09483c6 Auto merge of #129410 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-08-22 20:25:09 +00:00
Guillaume Gomez
4de29c9047 Add regression test for #126796 2024-08-22 20:27:57 +02:00
Guillaume Gomez
e37e15dc0b Fix extern crates not being hidden with doc(hidden) 2024-08-22 20:27:57 +02:00
binarycat
988bc1c654 fix typos in new pointer conversion docs 2024-08-22 14:25:54 -04:00
binarycat
736f773844 fix: fs::remove_dir_all: treat ENOENT as success
fixes #127576

windows implementation still needs some work
2024-08-22 14:18:42 -04:00
Stephen Lazaro
e91f32829c Deduplicate Spans in Uninitialized Check
Prevents reporting labels or diagnostics on spans that are produced
multiple times.
2024-08-22 09:36:14 -07:00
Michael Goulet
8eb15586c6 Don't trigger refinement lint if predicates reference errors 2024-08-22 12:34:12 -04:00
许杰友 Jieyou Xu (Joe)
3957f39339 Revert "compiletest: use std::fs::remove_dir_all now that it is available"
This reverts commit 75ed089727.
2024-08-22 15:55:06 +00:00
许杰友 Jieyou Xu (Joe)
e0900a1bb7 Revert "bootstrap: fix clean's remove_dir_all implementation"
This reverts commit 1687c55168.
2024-08-22 15:54:52 +00:00
bors
5ad98b4026 Auto merge of #129257 - ChrisDenton:rename-null-descriptor, r=jieyouxu
Allow rust staticlib to work with MSVC's /WHOLEARCHIVE

This fixes #129020 by renaming the `__NULL_IMPORT_DESCRIPTOR` to prevent conflicts.

try-job: dist-i686-msvc
2024-08-22 15:53:02 +00:00
Oneirical
e276d22efc rewrite x86_64-fortanix-unknown-sgx-lvi to rmake 2024-08-22 10:22:17 -04:00
Krasimir Georgiev
f1fac42f4a llvm 20: adapt integer comparison tests
The LLVM commit abf69a167b
changed the IR in a few comparison tests:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/30500#01917017-26fe-4a4d-956b-725a2903e5a8

Adapted accordingly.
2024-08-22 13:23:00 +00:00
bors
8b10bda1e4 Auto merge of #3833 - JoJoDeveloping:tb-fix-stack-overflow, r=RalfJung
Make Tree Borrows Provenance GC no longer produce stack overflows

Most functions operating on Tree Borrows' trees are carefully written to not cause stack overflows due to too much recursion. The one exception is [`Tree::keep_only_needed`](94f5588faf/src/borrow_tracker/tree_borrows/tree.rs (L724)), which just uses regular recursion.
This function is part of the provenance GC, so it is called regularly for every allocation in the program.

Tests show that this is a problem in practice. For example, the test `fill::horizontal_line` in crate `tiny-skia` (version 0.11.4) is such a test.

This PR changes this, this test no now longer crashes. Instead, it succeeds (after a _long_ time).
2024-08-22 12:52:35 +00:00
Johannes Hostert
b5d77d849e
Make Tree Borrows Provenance GC no longer produce stack overflows 2024-08-22 14:28:55 +02:00
Urgau
6a878a9630 Fix handling of macro arguments within the `dropping_copy_types lint 2024-08-22 13:32:01 +02:00
bors
0f6e1ae678 Auto merge of #129338 - weihanglo:update-cargo, r=weihanglo
Update cargo

12 commits in ba8b39413c74d08494f94a7542fe79aa636e1661..8f40fc59fb0c8df91c97405785197f3c630304ea
2024-08-16 22:48:57 +0000 to 2024-08-21 22:37:06 +0000
- Tests rely on absence of RUST_BACKTRACE (rust-lang/cargo#14441)
- fix: -Cmetadata includes whether extra rustflags is same as host (rust-lang/cargo#14432)
- [mdman] Normalize newlines when rendering options (rust-lang/cargo#14428)
- fix: doctest respects Cargo's color options (rust-lang/cargo#14425)
- Be more permissive while packaging unpublishable crates. (rust-lang/cargo#14408)
- fix: Limiting pre-release match semantics to use only on `OptVersionReq::Req` (rust-lang/cargo#14412)
- test: add a regression test for Issue 14409 (rust-lang/cargo#14430)
- chore: update label trigger for Command-info (rust-lang/cargo#14422)
- doc: add lockfile-path unstable doc section (rust-lang/cargo#14423)
- doc: update lockfile-path tracking issue (rust-lang/cargo#14424)
- fix: remove list owners feature of info subcommand (rust-lang/cargo#14418)
- Lockfile path tests (follow-up) (rust-lang/cargo#14417)
2024-08-22 10:48:27 +00:00
Connor Horman
f4dc7830ed feat(core): Make unbounded_shl{l,r} unstably const and remove rustc_allow_const_fn_unstable 2024-08-22 10:28:48 +00:00
bors
695a4f918a Auto merge of #3832 - RalfJung:epoll-test, r=oli-obk
epoll test: avoid some subtly dangling pointers

Turns out `let data = MaybeUninit::<u64>::uninit().as_ptr();` is a dangling pointer, the memory gets freed at the end of that line. For these cases we don't care as we don't actually access the pointer, but let's not do such subtle things.
2024-08-22 08:54:26 +00:00
bors
8269be147b Auto merge of #129398 - matthiaskrgr:rollup-50l01ry, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #128432 (WASI: forbid `unsafe_op_in_unsafe_fn` for `std::{os, sys}`)
 - #129373 (Add missing module flags for CFI and KCFI sanitizers)
 - #129374 (Use `assert_unsafe_precondition!` in `AsciiChar::digit_unchecked`)
 - #129376 (Change `assert_unsafe_precondition` docs to refer to `check_language_ub`)
 - #129382 (Add `const_cell_into_inner` to `OnceCell`)
 - #129387 (Advise against removing the remaining Python scripts from `tests/run-make`)
 - #129388 (Do not rely on names to find lifetimes.)
 - #129395 (Pretty-print own args of existential projections (dyn-Trait w/ GAT constraints))

r? `@ghost`
`@rustbot` modify labels: rollup
2024-08-22 08:20:49 +00:00
apiraino
87e4b6789c
Update RELEASES.md
Co-authored-by: Josh Stone <cuviper@gmail.com>
2024-08-22 09:19:22 +02:00
Amjad Alsharafi
57b164a9d2
Update compiler_builtins to 0.1.120
Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
2024-08-22 14:26:31 +08:00
Ralf Jung
ebfa3e3f62 stabilize const_fn_floating_point_arithmetic 2024-08-22 08:25:54 +02:00
Matthias Krüger
9d39b59862
Rollup merge of #129395 - fmease:pp-dyn-w-gat, r=compiler-errors
Pretty-print own args of existential projections (dyn-Trait w/ GAT constraints)

Previously we would just drop them. This bug isn't that significant as it can only be triggered by user code that constrains GATs inside trait object types which is currently gated under the interim feature `generic_associated_types_extended` (whose future is questionable) or on stable if the GATs are 'disabled' in dyn-Trait via `where Self: Sized` (in which case the assoc type bindings get ignored anyway (and trigger the warn-by-default lint `unused_associated_type_bounds`)), so yeah.

Affects diagnostic output and output of `std::any::type_name{_of_val}`.
2024-08-22 08:17:23 +02:00
Matthias Krüger
8b3ca7918c
Rollup merge of #129388 - cjgillot:region-def-id, r=compiler-errors
Do not rely on names to find lifetimes.

For some reason, we were trying to find the lifetime parameter from its name, instead of using the def_id we have.

This PR uses it instead. This changes some ui tests, I think to be more sensible.
2024-08-22 08:17:23 +02:00
Matthias Krüger
d24e6b7e61
Rollup merge of #129387 - Zalathar:python-apologia, r=jieyouxu
Advise against removing the remaining Python scripts from `tests/run-make`

After some recent PRs (e.g. #129185), there are only two Python scripts left in `tests/run-make`.

Having come so far, it's tempting to try to get rid of the remaining ones. But after trying that myself, I've come to the conclusion that it's not worth the extra hassle, especially if it means pulling in an XML-parsing crate just for one test.

This PR therefore leaves behind a few signpost comments to explain why getting rid of these particular scripts has low value.
2024-08-22 08:17:22 +02:00
Matthias Krüger
28d4b8248e
Rollup merge of #129382 - tgross35:once-cell-const-into-inner, r=Noratrieb
Add `const_cell_into_inner` to `OnceCell`

`Cell` and `RefCell` have their `into_inner` methods const unstable. `OnceCell` has the same logic, so add it under the same gate.

Tracking issue: https://github.com/rust-lang/rust/issues/78729
2024-08-22 08:17:22 +02:00
Matthias Krüger
ae58bbfbce
Rollup merge of #129376 - ChaiTRex:assert_unsafe_precondition_check_language_ub, r=workingjubilee,the8472
Change `assert_unsafe_precondition` docs to refer to `check_language_ub`
2024-08-22 08:17:21 +02:00
Matthias Krüger
e7df7ba1e4
Rollup merge of #129374 - ChaiTRex:digit_unchecked_assert_unsafe_precondition, r=scottmcm
Use `assert_unsafe_precondition!` in `AsciiChar::digit_unchecked`
2024-08-22 08:17:20 +02:00
Matthias Krüger
8f2c4d18e1
Rollup merge of #129373 - samitolvanen:cfi-module-flags, r=compiler-errors
Add missing module flags for CFI and KCFI sanitizers

Set the cfi-normalize-integers and kcfi-offset module flags when Control-Flow Integrity sanitizers are used, so functions generated by the LLVM backend use the same CFI/KCFI options as rustc.

cfi-normalize-integers tells LLVM to also use integer normalization for generated functions when -Zsanitizer-cfi-normalize-integers is used.

kcfi-offset specifies the number of prefix nops between the KCFI type hash and the function entry when -Z patchable-function-entry is used. Note that LLVM assumes all indirectly callable functions use the same number of prefix NOPs with -Zsanitizer=kcfi.
2024-08-22 08:17:20 +02:00
Matthias Krüger
a8d5c6d151
Rollup merge of #128432 - g0djan:godjan/wasi_prohibit_implicit_unsafe, r=tgross35
WASI: forbid `unsafe_op_in_unsafe_fn` for `std::{os, sys}`

Part of https://github.com/rust-lang/rust/issues/127747 for WASI

try-job: test-various
2024-08-22 08:17:19 +02:00
Weihang Lo
89e7246875
Update cargo 2024-08-22 13:33:13 +08:00
onur-ozkan
0ce7705356 document miri and cargo-miri in build.tools
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-22 08:32:39 +03:00
onur-ozkan
0a8343c146 do not build cargo-miri by default on stable channel
miri skipped for stable channel by default, do the same for `cargo-miri`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-22 08:32:31 +03:00