Commit Graph

264989 Commits

Author SHA1 Message Date
Vadim Petrochenkov
ac8f132014 docs: Update docs for the rustc's -L option 2024-08-27 22:14:16 +03:00
Vadim Petrochenkov
05bd36de50 linker: Better support alternative static library naming on MSVC
Previously `libname.a` naming was supported as a fallback when producing rlibs, but not when producing executables or dynamic libraries
2024-08-27 22:13:31 +03:00
Vadim Petrochenkov
a1c36c6ae9 linker: Synchronize native library search in rustc and linker 2024-08-27 22:13:31 +03:00
bors
2d69baa6e3 Auto merge of #3804 - tiif:blockit, r=oli-obk
Support blocking for epoll

This PR enabled epoll to have blocking operation.

The changes introduced by this PR are:
- Refactored part of the logic in ``epoll_wait`` to ``blocking_epoll_callback``
- Added a new field ``thread_ids`` in ``Epoll`` for blocked thread ids
- Added a new ``BlockReason::Epoll``
2024-08-27 18:40:47 +00:00
bors
ab869e094a Auto merge of #129513 - cjgillot:fast-source-span, r=petrochenkov
Do not call source_span when not tracking dependencies.

Split from https://github.com/rust-lang/rust/pull/127241
2024-08-27 18:33:26 +00:00
Johannes Hostert
e26779e784
Make Tree Borrows Provenance GC compact the tree
Follow-up on #3833 and #3835. In these PRs, the TB GC was fixed to no
longer cause a stack overflow. One test that motivated it was the test
`fill::horizontal_line` in `tiny_skia`. But not causing stack overflows
was not a large improvents, since it did not fix the fundamental issue:
The tree was too large. The test now ran, but it required gigabytes of
memory and hours of time, whereas it finishes within seconds in Stacked
Borrows.

The problem in that test was that it used [`slice::chunked`](https://doc.rust-lang.org/std/primitive.slice.html#method.chunks) to iterate
a slice in chunks. That iterator is written to reborrow at each call to
`next`, which creates a linear tree with a bunch of intermediary nodes,
which also fragments the `RangeMap` for that allocation.

The solution is to now compact the tree, so that these interior nodes
are removed. Care is taken to not remove nodes that are protected, or
that otherwise restrict their children.
2024-08-27 20:26:02 +02:00
bors
4318bfe611 Auto merge of #3843 - JoJoDeveloping:tb-bottom-up-iteration, r=RalfJung
Make TB tree traversal bottom-up

In preparation for #3837, the tree traversal needs to be made bottom-up, because the current top-down tree traversal, coupled with that PR's changes to the garbage collector, can introduce non-deterministic error messages if the GC removes a parent tag of the accessed tag that would have triggered the error first.

This is a breaking change for the diagnostics emitted by TB. The implemented semantics stay the same.
2024-08-27 17:48:16 +00:00
Johannes Hostert
5be5cec23c
Add explanation to TB's "piecewise bottom-up" traversal 2024-08-27 19:40:39 +02:00
Ralf Jung
e17be955bb interpret: add missing alignment check in raw_eq 2024-08-27 19:29:52 +02:00
Jubilee Young
605d9cf3b5 miri: Remove feature(new_uninit) 2024-08-27 10:18:53 -07:00
Jubilee Young
2535a0f776 compiler: Remove feature(new_uninit) 2024-08-27 10:17:05 -07:00
Jubilee Young
169b2f0e6d library: Stabilize new_uninit for Box, Rc, and Arc
A partial stabilization that only affects:
- AllocType<T>::new_uninit
- AllocType<T>::assume_init
- AllocType<[T]>::new_uninit_slice
- AllocType<[T]>::assume_init
where "AllocType" is Box, Rc, or Arc
2024-08-27 10:17:05 -07:00
Matthias Krüger
ac0cc709c3
Rollup merge of #129652 - RalfJung:ptr-to-ref, r=traviscross
fix Pointer to reference conversion docs

The aliasing rules documented in https://github.com/rust-lang/rust/pull/128157 are wrong, this fixes them.
2024-08-27 18:59:30 +02:00
Matthias Krüger
5e226dd18b
Rollup merge of #129649 - RalfJung:unadjusted-abi-mismatch, r=petrochenkov
ABI compat check: detect unadjusted ABI mismatches
2024-08-27 18:59:30 +02:00
Matthias Krüger
489eb230dd
Rollup merge of #129648 - nnethercote:unreachable_pub-2, r=Urgau
More `unreachable_pub`

Add `unreachable_pub` checking to some more compiler crates. A follow-up to #126013.

r? ``@Urgau``
2024-08-27 18:59:29 +02:00
Matthias Krüger
02491259c2
Rollup merge of #129645 - beetrees:fix-float-docs, r=tgross35
Fix typos in floating-point primitive type docs

Fixes a few typos. Also reflows the text of a couple of paragraphs in the source code to the standard line width to make the source easier to read (will have no effect on the rendered documentation).
2024-08-27 18:59:29 +02:00
Matthias Krüger
3299e30abc
Rollup merge of #129635 - compiler-errors:unsafe-blocks, r=spastorino
Use unsafe extern blocks throughout the compiler

Making this change in preparation for edition 2024.

r? spastorino
2024-08-27 18:59:28 +02:00
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
Matthias Krüger
6ab180577f
Rollup merge of #129581 - RalfJung:exit, r=joshtriplett
exit: explain our expectations for the exit handlers registered in a Rust program

This documents the position of ``@Amanieu`` and others in https://github.com/rust-lang/rust/issues/126600: a library with an atexit handler that destroys state that other threads could still be working on is buggy. We do not consider it acceptable for a library to say "you must call the following cleanup function before exiting from `main` or calling `exit`". I don't know if this is established ``@rust-lang/libs-api``  consensus so I presume this will have to go through FCP.

Given that Rust supports concurrency, I don't think there is any way to write a sound Rust wrapper around a library that has such a required cleanup function: even if we made `exit` unsafe, and the Rust wrapper used the scope-with-callback approach to ensure it can run cleanup code before returning from the wrapper (like `thread::scope`), one could still call this wrapper in a second thread and then return from `main` while the wrapper runs. Making this sound would require `std` to provide a way to "block" returning from `main`, so that while the wrapper runs returning from `main` waits until the wrapper is done... that just doesn't seem feasible.

The `exit` docs do not seem like the best place to document this, but I also couldn't think of a better one.
2024-08-27 18:59:27 +02:00
Matthias Krüger
849c240c1e
Rollup merge of #129507 - RalfJung:per-fn-const_precise_live_drops, r=wesleywiser
make it possible to enable const_precise_live_drops per-function

This makes const_precise_live_drops work with rustc_allow_const_fn_unstable so that we can stabilize individual functions that rely on const_precise_live_drops.

The goal is that we can use that to stabilize some of https://github.com/rust-lang/rust/issues/67441 without having to stabilize const_precise_live_drops.
2024-08-27 18:59:27 +02:00
jdonszelmann
a507ec644c
add uitest for naked functions and the repr attr on functions 2024-08-27 17:17:55 +02:00
jdonszelmann
c3000ad3ba
add repr to the allowlist for naked functions, and test that it works 2024-08-27 17:17:47 +02:00
Chayim Refael Friedman
34e50f56d6 Create an assist to convert closure to freestanding fn
The assist converts all captures to parameters.
2024-08-27 17:07:55 +03:00
Jack Wrenn
1ad218f3af safe transmute: Rename BikeshedIntrinsicFrom to TransmuteFrom
As our implementation of MCP411 nears completion and we begin to
solicit testing, it's no longer reasonable to expect testers to
type or remember `BikeshedIntrinsicFrom`. The name degrades the
ease-of-reading of documentation, and the overall experience of
using compiler safe transmute.

Tentatively, we'll instead adopt `TransmuteFrom`.

This name seems to be the one most likely to be stabilized, after
discussion on Zulip [1]. We may want to revisit the ordering of
`Src` and `Dst` before stabilization, at which point we'd likely
consider `TransmuteInto` or `Transmute`.

[1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20should.20.60BikeshedIntrinsicFrom.60.20be.20named.3F
2024-08-27 14:05:54 +00: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
Johannes Hostert
2765444c15
Make TB tree traversal bottom-up
In preparation for #3837, the tree traversal needs to be made bottom-up,
because the current top-down tree traversal, coupled with that PR's
changes to the garbage collector, can introduce non-deterministic error
messages if the GC removes a parent tag of the accessed tag that would
have triggered the error first.

This is a breaking change for the diagnostics emitted by TB. The
implemented semantics stay the same.
2024-08-27 15:24:23 +02:00
bors
199c01df7a Auto merge of #17757 - alibektas:toggle_macro_delimiters, r=Veykril
assist: Add new assist toggle_macro_delimiter

Closes #17716
2024-08-27 12:25:43 +00:00
bors
9b82f3b729 Auto merge of #3847 - JoJoDeveloping:master, r=RalfJung
Disable tree traversal optimization that is wrong due to lazy nodes.

See #3846 for more information.

For now, the optimization is disabled in a very "hotfix" way, while we think about potential fixes. Nonetheless, this fixes #3846
2024-08-27 12:24:37 +00:00
Lukas Wirth
c9a3b02281 Fix tests 2024-08-27 14:23:23 +02:00
Johannes Hostert
664640f578
Add testcase for #3846 2024-08-27 14:13:24 +02:00
bors
2dce25020e Auto merge of #17974 - lnicola:rm-apache-appendix, r=lnicola
internal: Drop Apache license appendices

Closes #14586

Similar to https://github.com/rust-lang/rust/pull/67734
2024-08-27 12:08:25 +00:00
Kajetan Puchalski
0f871b5baa tests: Update with new aarch64 target features
Additionally, remove optional matching for +v8a given that the minimum LLVM version is now past 14.
2024-08-27 12:06:30 +00:00
bors
e4c404e2bd Auto merge of #17973 - Veykril:proc-macro-curr-dir, r=Veykril
Expand proc-macros in workspace root, not package root

Should fix https://github.com/rust-lang/rust-analyzer/issues/17748. The approach is generally not perfect though as rust-project.json projects don't benefit from this (still, nothing changes in that regard)
2024-08-27 11:53:04 +00:00
Laurențiu Nicola
b592256bf0 Drop Apache license appendices 2024-08-27 14:52:34 +03:00
Lukas Wirth
df4580b5c1 Expand proc-macros in workspace root, not package root 2024-08-27 13:40:24 +02:00
bors
9f35309ef0 Auto merge of #3849 - RalfJung:tb-test, r=RalfJung
tree_borrows test: ensure we can actually read the variable
2024-08-27 11:40:04 +00:00
Ralf Jung
6f8fb3c15d tree_borrows test: ensure we can actually read the variable 2024-08-27 13:38:29 +02:00
Ralf Jung
ab4a743a38 fix Pointer to reference conversion docs 2024-08-27 12:28:43 +02:00
Kajetan Puchalski
3a0fbb5d4e rustc_codegen_llvm: Filter out unavailable LLVM features
Convert to_llvm_features to return Option<LLVMFeature> so that it can
return None if the requested feature is not available for the current
LLVM version.

Add match rules to filter out aarch64 features not available in LLVM 17.
2024-08-27 11:13:01 +01:00
Kajetan Puchalski
4fc4019cbc rustc_target: Remove fpmr target feature
FEAT_FPMR has been removed from upstream LLVM as of LLVM 19.
Remove the feature from the target features list and temporarily hack
the LLVM codegen to always enable it until the minimum LLVM version is
bumped to 19.
2024-08-27 11:11:47 +01:00
Kajetan Puchalski
c3518067c7 rustc_target: Add SME aarch64 features
Add SME aarch64 features already supported by LLVM and Linux.

This commit adds compiler support for the following features:

- FEAT_SME
- FEAT_SME_F16F16
- FEAT_SME_F64F64
- FEAT_SME_F8F16
- FEAT_SME_F8F32
- FEAT_SME_FA64
- FEAT_SME_I16I64
- FEAT_SME_LUTv2
- FEAT_SME2
- FEAT_SME2p1
- FEAT_SSVE_FP8DOT2
- FEAT_SSVE_FP8DOT4
- FEAT_SSVE_FP8FMA
2024-08-27 11:11:47 +01:00
Kajetan Puchalski
4f847bd326 rustc_target: Add various aarch64 features
Add various aarch64 features already supported by LLVM and Linux.

The features are marked as unstable using a newly added symbol, i.e.
aarch64_unstable_target_feature.

Additionally include some comment fixes to ensure consistency of
feature names with the Arm ARM and support for architecture version
target features up to v9.5a.

This commit adds compiler support for the following features:

- FEAT_CSSC
- FEAT_ECV
- FEAT_FAMINMAX
- FEAT_FLAGM2
- FEAT_FP8
- FEAT_FP8DOT2
- FEAT_FP8DOT4
- FEAT_FP8FMA
- FEAT_FPMR
- FEAT_HBC
- FEAT_LSE128
- FEAT_LSE2
- FEAT_LUT
- FEAT_MOPS
- FEAT_LRCPC3
- FEAT_SVE_B16B16
- FEAT_SVE2p1
- FEAT_WFxT
2024-08-27 11:11:47 +01:00
joboet
e9566ce9e9
bless miri test 2024-08-27 11:58:20 +02:00
joboet
d456814842
std: move allocators to sys 2024-08-27 11:58:19 +02:00
onur-ozkan
1a743710aa set BOOTSTRAP_SKIP_TARGET_SANITY in opt-dist before running tests
opt-dist overrides the stage 0 compiler with previously compiled compilers,
which can cause confusion in bootstrap's target sanity checks. It is best to
skip that check.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-27 12:19:05 +03:00
onur-ozkan
6ba72c0c7e skip stage 0 target check if BOOTSTRAP_SKIP_TARGET_SANITY is set
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-08-27 12:18:54 +03:00
bors
65936887ff Auto merge of #17970 - ChayimFriedman2:unwrap-unsafe-block, r=Veykril
fix: Fix "Unwrap block" assist with block modifiers

The assist just assumes the `{` will be the first character, which led to strange outputs such as `nsafe {`.

Fixes #17964.
2024-08-27 09:17:10 +00:00
bors
eb7bf6e8f5 Auto merge of #3827 - RalfJung:gc-comment, r=RalfJung
provenance_gc: fix comment

Fixes https://github.com/rust-lang/miri/issues/3826

r? `@saethlin`
2024-08-27 08:20:27 +00:00
Zalathar
5b6ff4fe18 Don't skip nonexistent source files
This behaviour was introduced during the upgrade to LLVM 11. Now that the list
of source files has been cleaned up, we can reasonably expect _all_ of the
listed source files to be present.
2024-08-27 17:30:42 +10:00
Zalathar
7f90aa5538 Add cargo::rerun-if-changed directives for source directories 2024-08-27 17:30:25 +10:00