about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-10-05Auto merge of #129244 - cjgillot:opaque-hir, r=compiler-errorsbors-39/+14
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
2024-10-05Auto merge of #131275 - workingjubilee:rollup-4yxqio3, r=workingjubileebors-5/+9
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
2024-10-04Rollup merge of #129517 - cjgillot:known-panic-array, r=pnkfelixJubilee-5/+9
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.
2024-10-05Auto merge of #131124 - weihanglo:update-cargo, r=weihanglobors-0/+0
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)
2024-10-05Bless clippy.Camille GILLOT-5/+9
2024-10-04Adapt clippy.Camille GILLOT-38/+13
2024-10-04rm `ItemKind::OpaqueTy`Noah Lev-1/+1
This introduce an additional collection of opaques on HIR, as they can no longer be listed using the free item list.
2024-10-04Rollup merge of #130518 - scottmcm:stabilize-controlflow-extra, r=dtolnayJubilee-2/+0
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.
2024-10-04Update cargoWeihang Lo-0/+0
2024-10-04Rollup merge of #131230 - GuillaumeGomez:no-sandbox, r=notriddleGuillaume Gomez-25/+1
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`
2024-10-04Enable `--no-sandbox` option by default for rustdoc GUI testsGuillaume Gomez-25/+1
2024-10-03Rollup merge of #131183 - compiler-errors:opaque-ty-origin, r=estebankMatthias Krüger-6/+5
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 😄
2024-10-03Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into ↵Philipp Krones-848/+2484
clippy-subtree-update
2024-10-03Auto merge of #131185 - workingjubilee:rollup-wkcqe2j, r=workingjubileebors-0/+6
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
2024-10-02Rollup merge of #126930 - Xaeroxe:file-checksum-hint, r=chenyukangJubilee-0/+6
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.
2024-10-03Auto merge of #127912 - joboet:tls_dtor_thread_current, r=cuviperbors-7/+7
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.
2024-10-02Use named fields for OpaqueTyOriginMichael Goulet-1/+1
2024-10-02Remove redundant in_trait from hir::TyKind::OpaqueDefMichael Goulet-5/+4
2024-10-02bless miri testsjoboet-7/+7
2024-10-01Rollup merge of #130885 - RalfJung:interp-error-discard, r=oli-obkJubilee-729/+740
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
2024-10-01add unstable support for outputting file checksums for use in cargoJacob Kiesel-0/+6
2024-10-01make InterpResult a dedicated type to avoid accidentally discarding the errorRalf Jung-733/+739
2024-09-30Update wasm-component-ld to 0.5.9Alex Crichton-1/+1
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.
2024-09-30Auto merge of #131044 - EnzymeAD:enzyme-testinfra, r=jieyouxubors-0/+15
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
2024-09-30panic when an interpreter error gets unintentionally discardedRalf Jung-3/+8
2024-09-30Auto merge of #131036 - RalfJung:miri-sync, r=RalfJungbors-474/+602
Miri subtree update r? `@ghost`
2024-09-29add has_enzyme/needs-enzyme to the test infraManuel Drehwald-0/+15
2024-09-29let rustfmt format importsRalf Jung-319/+255
2024-09-29Rollup merge of #131000 - rust-lang:cargo_update, r=clubby789Matthias Krüger-26/+26
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 ```
2024-09-29Rollup merge of #130383 - onur-ozkan:ignore-llvm-changes-on-ci-llvm-true, ↵Guillaume Gomez-0/+9
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.
2024-09-29bump few depsklensy-63/+24
2024-09-29skip old getrandom crate on SolarisRalf Jung-5/+10
2024-09-29create `CiEnv::is_rust_lang_managed_ci_job`onur-ozkan-0/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-09-29Auto merge of #129687 - Urgau:rfc3127-sysroot-2, r=jieyouxubors-4/+15
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
2024-09-29cargo updategithub-actions-26/+26
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
2024-09-28compiletest: normalize to `$SRC_DIR_REAL` before `$TEST_BUILD_DIR`Urgau-6/+6
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)
2024-09-28Auto merge of #3918 - devnexen:solaris_arc4random_buf, r=RalfJungbors-4/+31
implements arc4random_buf shim for freebsd/solarish platforms. close #3914
2024-09-28make sure the new function is testedRalf Jung-4/+4
2024-09-28implements arc4random_buf shim for freebsd/solarish platforms.David Carlier-0/+27
close #3914
2024-09-28Rollup merge of #130973 - matthiaskrgr:crash_rename, r=jieyouxuMatthias Krüger-1/+1
compiletest: rename "runtest/crash.rs" to "runtest/crashes.rs" to be in line with the test directory r? jieyouxu
2024-09-28Rollup merge of #128778 - RalfJung:atomic-read-read-races, r=Mark-SimulacrumMatthias Krüger-275/+262
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
2024-09-28add tests for validity of Box with custom allocatorRalf Jung-0/+99
2024-09-28Auto merge of #130964 - matthiaskrgr:rollup-suriuub, r=matthiaskrgrbors-3/+0
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
2024-09-28compiletest: rename "runtest/crash.rs" to "runtest/crashes.rs" to be in line ↵Matthias Krüger-1/+1
with the test directory r? jieyouxu
2024-09-28Further clarificarion for atomic and UnsafeCell docs:Ralf Jung-0/+17
- UnsafeCell: mention the term "data race", and reference the data race definition - atomic: failing RMWs are just reads, reorder and reword docs
2024-09-28allow mixed-size atomic readsRalf Jung-153/+202
2024-09-28miri: no longer complain about read-read racesRalf Jung-122/+43
2024-09-28Rollup merge of #130953 - workingjubilee:rename-a-few-ctypes-tests, r=fee1-deadMatthias Krüger-3/+0
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.
2024-09-28Auto merge of #130874 - klensy:bumpme, r=jieyouxubors-3/+5
bump few deps Bumps cargo_metadata, thorin-dwp, windows. Should dedupe some crates around.
2024-09-28Auto merge of #130929 - weihanglo:update-cargo, r=weihanglobors-0/+0
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 &lt;TAB&gt;` (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)