| Age | Commit message (Collapse) | Author | Lines |
|
Make opaque types regular HIR nodes
Having opaque types as HIR owner introduces all sorts of complications. This PR proposes to make them regular HIR nodes instead.
I haven't gone through all the test changes yet, so there may be a few surprises.
Many thanks to `@camelid` for the first draft.
Fixes https://github.com/rust-lang/rust/issues/129023
Fixes #129099
Fixes #125843
Fixes #119716
Fixes #121422
|
|
Rollup of 9 pull requests
Successful merges:
- #129517 (Compute array length from type for unconditional panic lint. )
- #130367 (Check elaborated projections from dyn don't mention unconstrained late bound lifetimes)
- #130403 (Stabilize `const_slice_from_raw_parts_mut`)
- #130633 (Add support for reborrowing pinned method receivers)
- #131105 (update `Literal`'s intro)
- #131194 (Fix needless_lifetimes in stable_mir)
- #131260 (rustdoc: cleaner errors on disambiguator/namespace mismatches)
- #131267 (Stabilize `BufRead::skip_until`)
- #131273 (Account for `impl Trait {` when `impl Trait for Type {` was intended)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Compute array length from type for unconditional panic lint.
Fixes https://github.com/rust-lang/rust/issues/98444
The cases that involve slicing are harder, so https://github.com/rust-lang/rust/issues/38035 remains open.
|
|
Update cargo
17 commits in 80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a..ad074abe3a18ce8444c06f962ceecfd056acfc73
2024-09-27 17:56:01 +0000 to 2024-10-04 18:18:15 +0000
- test: Remove the last of our custom json assertions (rust-lang/cargo#14576)
- docs(ref): Expand on MSRV (rust-lang/cargo#14636)
- docs: Minor re-grouping of pages (rust-lang/cargo#14620)
- docs(ref): Highleft whats left for msrv-policy (rust-lang/cargo#14638)
- Fix `cargo:version_number` - has only one `:` (rust-lang/cargo#14637)
- docs: Declare support level for each crate in our Charter / docs (rust-lang/cargo#14600)
- chore(deps): update tar to 0.4.42 (rust-lang/cargo#14632)
- docs(charter): Declare new Intentional Artifacts as 'small' changes (rust-lang/cargo#14599)
- fix: Remove implicit feature removal (rust-lang/cargo#14630)
- docs(config): make `--config <PATH>` more prominent (rust-lang/cargo#14631)
- chore(deps): update rust crate unicode-width to 0.2.0 (rust-lang/cargo#14624)
- chore(deps): update embarkstudios/cargo-deny-action action to v2 (rust-lang/cargo#14628)
- docs(ref): Clean up language for `package.rust-version` (rust-lang/cargo#14619)
- docs: clarify `target.'cfg(...)'` doesnt respect cfg from build script (rust-lang/cargo#14312)
- test: relax compiler panic assertions (rust-lang/cargo#14618)
- refactor(compiler): zero-copy deserialization when possible (rust-lang/cargo#14608)
- test: add support for features in the sat resolver (rust-lang/cargo#14583)
|
|
|
|
|
|
This introduce an additional collection of opaques on HIR, as they can no
longer be listed using the free item list.
|
|
Stabilize the `map`/`value` methods on `ControlFlow`
And fix the stability attribute on the `pub use` in `core::ops`.
libs-api in https://github.com/rust-lang/rust/issues/75744#issuecomment-2231214910 seemed reasonably happy with naming for these, so let's try for an FCP.
Summary:
```rust
impl<B, C> ControlFlow<B, C> {
pub fn break_value(self) -> Option<B>;
pub fn map_break<T>(self, f: impl FnOnce(B) -> T) -> ControlFlow<T, C>;
pub fn continue_value(self) -> Option<C>;
pub fn map_continue<T>(self, f: impl FnOnce(C) -> T) -> ControlFlow<B, T>;
}
```
Resolves #75744
``@rustbot`` label +needs-fcp +t-libs-api -t-libs
---
Aside, in case it keeps someone else from going down the same dead end: I looked at the `{break,continue}_value` methods and tried to make them `const` as part of this, but that's disallowed because of not having `const Drop`, so put it back to not even unstably-const.
|
|
|
|
Enable `--no-sandbox` option by default for rustdoc GUI tests
It's apparently common enough for people to have issues with the `sandbox` mode in chromium, so better disable it by default.
r? `@notriddle`
|
|
|
|
Refactoring to `OpaqueTyOrigin`
Pulled out of a larger PR that uses these changes to do cross-crate encoding of opaque origin, so we can use them for edition 2024 migrations. These changes should be self-explanatory on their own, tho 😄
|
|
clippy-subtree-update
|
|
Rollup of 3 pull requests
Successful merges:
- #126930 (Add unstable support for outputting file checksums for use in cargo)
- #130725 (Parser: better error messages for ``@`` in struct patterns)
- #131166 (Fix `target_vendor` for `aarch64-nintendo-switch-freestanding`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add unstable support for outputting file checksums for use in cargo
Adds an unstable option that appends file checksums and expected lengths to the end of the dep-info file such that `cargo` can read and use these values as an alternative to file mtimes.
This PR powers the changes made in this cargo PR https://github.com/rust-lang/cargo/pull/14137
Here's the tracking issue for the cargo feature https://github.com/rust-lang/cargo/issues/14136.
|
|
std: make `thread::current` available in all `thread_local!` destructors
... and thereby allow the panic runtime to always print the right thread name.
This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by `std` have run. Unfortunately, this doesn't affect foreign TLS destructors, `thread::current` will still panic there.
Additionally, the thread ID returned by `current_id` will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS).
The mechanisms I added for this (`local_pointer` and `thread_cleanup`) will also allow finally fixing #111272 by moving the signal stack to a similar runtime-cleanup TLS variable.
|
|
|
|
|
|
|
|
panic when an interpreter error gets unintentionally discarded
One important invariant of Miri is that when an interpreter error is raised (*in particular* a UB error), those must not be discarded: it's not okay to just check `foo().is_err()` and then continue executing.
This seems to catch new contributors by surprise fairly regularly, so this PR tries to make it so that *if* this ever happens, we get a panic rather than a silent missed UB bug. The interpreter error type now contains a "guard" that panics on drop, and that is explicitly passed to `mem::forget` when an error is deliberately discarded.
Fixes https://github.com/rust-lang/miri/issues/3855
|
|
|
|
|
|
This updates the `wasm-component-ld` linker binary for the
`wasm32-wasip2` target to 0.5.9, pulling in a few bug fixes and recent
updates.
|
|
add has_enzyme/needs-enzyme to the test infra
This unblocks merging the Enzyme / Autodiff frontend.
For the full implementation, see: https://github.com/rust-lang/rust/pull/129175
We don't want to run tests that require Enzyme / Autodiff support when we build rustc without the required features.
It correctly filtered out a test which started with `//@ needs-enzyme`.
```
running 80 tests
i...............................................................................
test result: ok. 79 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 380.41ms
```
Tracking:
- https://github.com/rust-lang/rust/issues/124509
r? jieyouxu
|
|
|
|
Miri subtree update
r? `@ghost`
|
|
|
|
|
|
Weekly `cargo update`
Automation to keep dependencies in `Cargo.lock` current.
The following is the output from `cargo update`:
```txt
Locking 5 packages to latest compatible versions
Updating autocfg v1.3.0 -> v1.4.0
Updating flate2 v1.0.33 -> v1.0.34
Updating portable-atomic v1.8.0 -> v1.9.0
Updating syn v2.0.77 -> v2.0.79
Updating tempfile v3.12.0 -> v3.13.0
note: pass `--verbose` to see 81 unchanged dependencies behind latest
library dependencies:
Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 9 unchanged dependencies behind latest
rustbook dependencies:
Locking 13 packages to latest compatible versions
Updating autocfg v1.3.0 -> v1.4.0
Updating cc v1.1.21 -> v1.1.22
Updating flate2 v1.0.33 -> v1.0.34
Updating libc v0.2.158 -> v0.2.159
Updating pkg-config v0.3.30 -> v0.3.31
Updating redox_syscall v0.5.4 -> v0.5.6
Updating serde_spanned v0.6.7 -> v0.6.8
Updating syn v2.0.77 -> v2.0.79
Updating tempfile v3.12.0 -> v3.13.0
Updating thiserror v1.0.63 -> v1.0.64
Updating thiserror-impl v1.0.63 -> v1.0.64
Updating toml_edit v0.22.21 -> v0.22.22
Updating winnow v0.6.18 -> v0.6.20
note: pass `--verbose` to see 30 unchanged dependencies behind latest
```
|
|
r=Mark-Simulacrum
check if it's rust-lang/rust CI job in `llvm::is_ci_llvm_modified`
Changes `llvm::is_ci_llvm_modified` to only work on rust-lang/rust managed CI.
|
|
|
|
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
Implement RFC3137 trim-paths sysroot changes - take 2
This PR is a continuation of https://github.com/rust-lang/rust/pull/118149. Nothing really changed, except for https://github.com/rust-lang/rust/pull/129408 which I was able to trigger locally.
Original description:
> Implement parts of #111540
>
> Right now, backtraces into sysroot always shows /rustc/$hash in diagnostics, e.g.
>
> ```
> thread 'main' panicked at 'hello world', map-panic.rs:2:50
> stack backtrace:
> 0: std::panicking::begin_panic
> at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12
> 1: map_panic::main::{{closure}}
> at ./map-panic.rs:2:50
> 2: core::option::Option<T>::map
> at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29
> 3: map_panic::main
> at ./map-panic.rs:2:30
> 4: core::ops::function::FnOnce::call_once
> at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
> ```
>
> [RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc)
>
> > We want to change this behaviour such that, when rust-src source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a --remap-path-prefix that causes this local path to be remapped in the usual way.
>
> This PR implements this behaviour. When `rust-src` is present at compile time, rustc replaces /rustc/$hash with a real path into local rust-src with best effort. To sanitise this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo`.
cc `@cbeuw`
Fix #105907
Fix #85463
try-job: dist-x86_64-linux
try-job: x86_64-msvc
try-job: dist-x86_64-msvc
try-job: armhf-gnu
|
|
Locking 5 packages to latest compatible versions
Updating autocfg v1.3.0 -> v1.4.0
Updating flate2 v1.0.33 -> v1.0.34
Updating portable-atomic v1.8.0 -> v1.9.0
Updating syn v2.0.77 -> v2.0.79
Updating tempfile v3.12.0 -> v3.13.0
note: pass `--verbose` to see 81 unchanged dependencies behind latest
library dependencies:
Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 9 unchanged dependencies behind latest
rustbook dependencies:
Locking 13 packages to latest compatible versions
Updating autocfg v1.3.0 -> v1.4.0
Updating cc v1.1.21 -> v1.1.22
Updating flate2 v1.0.33 -> v1.0.34
Updating libc v0.2.158 -> v0.2.159
Updating pkg-config v0.3.30 -> v0.3.31
Updating redox_syscall v0.5.4 -> v0.5.6
Updating serde_spanned v0.6.7 -> v0.6.8
Updating syn v2.0.77 -> v2.0.79
Updating tempfile v3.12.0 -> v3.13.0
Updating thiserror v1.0.63 -> v1.0.64
Updating thiserror-impl v1.0.63 -> v1.0.64
Updating toml_edit v0.22.21 -> v0.22.22
Updating winnow v0.6.18 -> v0.6.20
note: pass `--verbose` to see 30 unchanged dependencies behind latest
|
|
in case the real paths into the libstd/libcore are located inside the
the build directory, maybe because it's coming from an extracted dist
component in the build dir (cc opt-dist)
|
|
implements arc4random_buf shim for freebsd/solarish platforms.
close #3914
|
|
|
|
close #3914
|
|
compiletest: rename "runtest/crash.rs" to "runtest/crashes.rs" to be in line with the test directory
r? jieyouxu
|
|
atomics: allow atomic and non-atomic reads to race
We currently define our atomics in terms of C++ `atomic_ref`. That has the unfortunate side-effect of making it UB for an atomic and a non-atomic read to race (concretely, [this code](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d1a743774e60923db33def7fe314d754) has UB). There's really no good reason for this, all the academic models of the C++ memory model I am aware of allow this -- C++ just disallows this because of their insistence on an "object model" with typed memory, where `atomic_ref` temporarily creates an "atomic object" that may not be accesses via regular non-atomic operations.
So instead of tying our operations to `atomic_ref`, let us tie them directly to the underlying C++ memory model. I am not sure what is the best way to phrase this, so here's a first attempt.
We also carve out an exception from the "no mixed-size atomic accesses" rule to permit mixed-size atomic reads -- given that we permit mixed-size non-atomic reads, it seems odd that this would be disallowed for atomic reads. However, when an atomic write races with any other atomic operation, they must use the same size.
With this change, it is finally the case that every non-atomic access can be replaced by an atomic access without introducing UB.
Cc `@rust-lang/opsem` `@chorman0773` `@m-ou-se` `@WaffleLapkin` `@Amanieu`
Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/483
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #125404 (Fix `read_buf` uses in `std`)
- #130866 (Allow instantiating object trait binder when upcasting)
- #130922 (Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4)
- #130924 (Make clashing_extern_declarations considering generic args for ADT field)
- #130939 (rustdoc: update `ProcMacro` docs section on helper attributes)
- #130940 (Revert space-saving operations)
- #130944 (Allow instantiating trait object binder in ptr-to-ptr casts)
- #130953 (Rename a few tests to make tidy happier)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
with the test directory
r? jieyouxu
|
|
- UnsafeCell: mention the term "data race", and reference the data race definition
- atomic: failing RMWs are just reads, reorder and reword docs
|
|
|
|
|
|
Rename a few tests to make tidy happier
A somewhat random smattering of tests that I have recently looked at, and thus had cause to research and write down the reason for their existence.
|
|
bump few deps
Bumps cargo_metadata, thorin-dwp, windows.
Should dedupe some crates around.
|
|
Update cargo
19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a
2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000
- Update cc to 1.1.22 (rust-lang/cargo#14607)
- feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556)
- feat(toml): Add `autolib` (rust-lang/cargo#14591)
- fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598)
- test: relax panic output assertion (rust-lang/cargo#14602)
- feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588)
- feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404)
- fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579)
- fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587)
- feat: make lockfile v4 the default (rust-lang/cargo#14595)
- perf: Improve quality of completion performance traces (rust-lang/cargo#14592)
- test: Remove completion tests (rust-lang/cargo#14590)
- feat: Add support for completing `cargo update <TAB>` (rust-lang/cargo#14552)
- test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577)
- fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569)
- chore: Bump MSRV to 1.81 (rust-lang/cargo#14585)
- Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280)
- fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568)
- feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
|