about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-09-09union padding computation: add fast-path for ZSTRalf Jung-0/+15
Also avoid even tracking empty ranges, and add fast-path for arrays of scalars
2024-09-09Remove unnecessary symbols and add missing symbolscuishuang-3/+5
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-09Rollup merge of #130130 - RalfJung:miri-sync, r=RalfJungJubilee-287/+523
Miri subtree update r? `@ghost`
2024-09-09Rollup merge of #130068 - madsmtm:deployment-target-test, r=jieyouxuJubilee-2/+19
Test codegen when setting deployment target Test our codegen in different scenarios when setting the deployment target. There are many places here where this is still incorrect, these will be fixed in https://github.com/rust-lang/rust/pull/129342, https://github.com/rust-lang/rust/pull/129367 and https://github.com/rust-lang/rust/pull/129369. See https://github.com/rust-lang/rust/issues/129432 for the bigger picture. Tested locally using: ```console ./x test tests/run-make/apple-deployment-target --target="aarch64-apple-darwin,aarch64-apple-ios,aarch64-apple-ios-macabi,aarch64-apple-ios-sim,aarch64-apple-tvos,aarch64-apple-tvos-sim,aarch64-apple-visionos,aarch64-apple-visionos-sim,aarch64-apple-watchos,aarch64-apple-watchos-sim,arm64_32-apple-watchos,armv7s-apple-ios,i386-apple-ios,x86_64-apple-darwin,x86_64-apple-ios,x86_64-apple-ios-macabi,x86_64-apple-tvos,x86_64-apple-watchos-sim,x86_64h-apple-darwin" ``` The only Apple targets that aren't tested by the above command are: - `arm64e-apple-darwin`, failed to build, see https://github.com/rust-lang/cc-rs/issues/1205. - `armv7k-apple-watchos`, failed to link, see https://github.com/rust-lang/rust/issues/130071. - `arm64e-apple-ios`, failed to link, see https://github.com/rust-lang/rust/issues/130085. - `i686-apple-darwin`, requires a bit of setup and an older machine, see [the docs](https://doc.rust-lang.org/nightly/rustc/platform-support/i686-apple-darwin.html). - `i386-apple-ios` requires you to set `IPHONEOS_DEPLOYMENT_TARGET=10.0` for the test helpers to work, will be fixed by https://github.com/rust-lang/cc-rs/issues/1030. But all of this is as it was before this PR. Fixes https://github.com/rust-lang/rust/issues/47825, since we now have a test that compiles a `dylib` for `aarch64-apple-ios`. Split out from https://github.com/rust-lang/rust/pull/129342, see that for a little bit of the review that this has gone through already. r? petrochenkov ```@rustbot``` label O-apple
2024-09-09Rollup merge of #130048 - nebulark:runmake_llvm_pdbutil, r=jieyouxuJubilee-0/+24
run-make-support: Add llvm-pdbutil Add llvm-pdbutil to run-make-support, so we can write better unit tests for PDB specific features. r? ````@jieyouxu```` ````@rustbot```` label: +O-windows
2024-09-09Rollup merge of #130034 - alexcrichton:fix-some-wasm-component-ld-comments, ↵Jubilee-2/+2
r=onur-ozkan Fix enabling wasm-component-ld to match other tools It was [pointed out recently][comment] that enabling `wasm-component-ld` as a host tool is different from other host tools. This commit refactors the logic to match by deduplicating selection of when to build other tools and then using the same logic for `wasm-component-ld`. While here I also fixed a typo pointed out in https://github.com/rust-lang/rust/pull/126967#pullrequestreview-2285267534 [comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720
2024-09-09Rollup merge of #128667 - its-the-shrimp:rustdoc_json_types_rename, ↵Jubilee-35/+36
r=aDotInTheVoid rustdoc: normalise type/field names Updates #100961 - `Import` -> `Use`, to better reflect the terminology of Rust & its syntax - `TypeBinding` -> `AssocItemConstraint`, to sync up with `clean` - `FnDecl` -> `FunctionSignature`, because that's what it is - `Header` -> `FunctionHeader`, because `Header` is a very word that's very heavily loaded with different meanings - `ItemEnum::AssocType`: `default` -> `type`, because those items appear in `impl` blocks as well, where they're _not_ the "default" - `ItemEnum::AssocConst`: `default` -> `value`, see the previous point - `ForeignType` -> `ExternType`, because "foreign" is not the right word there - boolean fields' names made to consistently be a phrase that can be a yes/no answer, e.g. `async` -> `is_async` The docs of `ItemEnum::AssocType::type_` & of `ItemEnum::AssocConst::value` are also updated to be up to date with the clarification of the name of the fields
2024-09-09Print a helpful message if any tests were skipped for being up-to-dateZalathar-0/+1
2024-09-09Add an explicit ignore message for "up-to-date" testsZalathar-2/+5
When running tests without the `--force-rerun` flag, compiletest will automatically skip any tests that (in its judgement) don't need to be run again since the last time they were run. This patch adds an explicit reason to those skipped tests, which is visible when running with `rust.verbose-tests = true` in `config.toml`.
2024-09-09detect when pthread_rwlock_t is movedKonstantinos Andrikopoulos-5/+68
For some implementations of pthreads, the address of pthread_rwlock_t (or its fields) is used to identify the lock. That means that if the contents of a pthread_rwlock_t are moved in memory, effectively a new lock object is created, which is completely independted from the original. Thus we want to detect when when such objects are moved and show an error.
2024-09-08bootstrap: handle worktrees in warn_old_master_branchbinarycat-16/+46
fixes #130111
2024-09-08Better testing infra for ratomlAli Bektas-103/+228
2024-09-08Automatically add semicolon when completing unit-returning functionsChayim Refael Friedman-40/+217
But provide a config to suppress that. I didn't check whether we are in statement expression position, because this is hard in completion (due to the natural incompleteness of source code when completion is invoked), and anyway using function returning unit as an argument to something seems... dubious.
2024-09-08interpret: reset padding during validationRalf Jung-15/+249
2024-09-08interpret: reset provenance on typed copiesRalf Jung-3/+212
2024-09-08interpret: remove Readable trait, we can use Projectable insteadRalf Jung-4/+4
2024-09-08run-make-support: Add llvm-pdbutilFlorian Schmiderer-0/+24
2024-09-08Auto merge of #129313 - RalfJung:coroutine-niches, r=compiler-errorsbors-0/+66
Supress niches in coroutines to avoid aliasing violations As mentioned [here](https://github.com/rust-lang/rust/issues/63818#issuecomment-2264915918), using niches in fields of coroutines that are referenced by other fields is unsound: the discriminant accesses violate the aliasing requirements of the reference pointing to the relevant field. This issue causes [Miri errors in practice](https://github.com/rust-lang/miri/issues/3780). The "obvious" fix for this is to suppress niches in coroutines. That's what this PR does. However, we have several tests explicitly ensuring that we *do* use niches in coroutines. So I see two options: - We guard this behavior behind a `-Z` flag (that Miri will set by default). There is no known case of these aliasing violations causing miscompilations. But absence of evidence is not evidence of absence... - (What this PR does right now.) We temporarily adjust the coroutine layout logic and the associated tests until the proper fix lands. The "proper fix" here is to wrap fields that other fields can point to in [`UnsafePinned`](https://github.com/rust-lang/rust/issues/125735) and make `UnsafePinned` suppress niches; that would then still permit using niches of *other* fields (those that never get borrowed). However, I know that coroutine sizes are already a problem, so I am not sure if this temporary size regression is acceptable. `@compiler-errors` any opinion? Also who else should be Cc'd here?
2024-09-07Auto merge of #130091 - matthiaskrgr:rollup-kalu1cs, r=matthiaskrgrbors-55/+219
Rollup of 10 pull requests Successful merges: - #126452 (Implement raw lifetimes and labels (`'r#ident`)) - #129555 (stabilize const_float_bits_conv) - #129594 (explain the options bootstrap passes to curl) - #129677 (Don't build by-move body when async closure is tainted) - #129847 (Do not call query to compute coroutine layout for synthetic body of async closure) - #129869 (add a few more crashtests) - #130009 (rustdoc-search: allow trailing `Foo ->` arg search) - #130046 (str: make as_mut_ptr and as_bytes_mut unstably const) - #130047 (Win: Add dbghelp to the list of import libraries) - #130059 (Remove the unused `llvm-skip-rebuild` option from x.py) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-07Rollup merge of #129555 - RalfJung:const_float_bits_conv, r=dtolnayMatthias Krüger-46/+186
stabilize const_float_bits_conv This stabilizes `const_float_bits_conv`, and thus fixes https://github.com/rust-lang/rust/issues/72447. With https://github.com/rust-lang/rust/pull/128596 having landed, this is entirely a libs-only question now. ```rust impl f32 { pub const fn to_bits(self) -> u32; pub const fn from_bits(v: u32) -> Self; pub const fn to_be_bytes(self) -> [u8; 4]; pub const fn to_le_bytes(self) -> [u8; 4] pub const fn to_ne_bytes(self) -> [u8; 4]; pub const fn from_be_bytes(bytes: [u8; 4]) -> Self; pub const fn from_le_bytes(bytes: [u8; 4]) -> Self; pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self; } impl f64 { pub const fn to_bits(self) -> u64; pub const fn from_bits(v: u64) -> Self; pub const fn to_be_bytes(self) -> [u8; 8]; pub const fn to_le_bytes(self) -> [u8; 8] pub const fn to_ne_bytes(self) -> [u8; 8]; pub const fn from_be_bytes(bytes: [u8; 8]) -> Self; pub const fn from_le_bytes(bytes: [u8; 8]) -> Self; pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self; } ```` Cc `@rust-lang/wg-const-eval` `@rust-lang/libs-api`
2024-09-07Auto merge of #129941 - BoxyUwU:bump-boostrap, r=albertlarsan68bors-7/+0
Bump boostrap compiler to new beta Accidentally left some comments on the update cfgs commit directly xd
2024-09-07Renamed variable and fixed comments referring to renamed FileDescriptorDeSevilla-8/+8
2024-09-07Test codegen when setting deployment targetMads Marquart-2/+19
2024-09-06Fix a typo in the wasm-component-ld READMEAlex Crichton-2/+2
2024-09-06Fix toolsMichael Goulet-9/+33
2024-09-06Ignore gcc submodule for tidy checksGuillaume Gomez-1/+5
2024-09-06fix: Properly prevent mir building with unknown types presentLukas Wirth-5/+14
2024-09-06fix: Always explicitly set trait ref self types when loweringLukas Wirth-64/+80
2024-09-06Bump lsp-serverLukas Wirth-7/+7
2024-09-06Fix comment in mutex_id_offsetKonstantinos Andrikopoulos-1/+0
We no longer store the kind inside the pthread_mutex_t, so this comment is outdated.
2024-09-06Auto merge of #129176 - EnzymeAD:enzyme-backend, r=albertlarsan68bors-0/+4
Autodiff Upstreaming - enzyme backend Tracking issue: https://github.com/rust-lang/rust/issues/124509 Part of https://github.com/rust-lang/rust/pull/129175 This PR should allow building Enzyme from source on Tier 1 targets (when also building LLVM), except MSVC. It's only a small fraction (~200 lines) of the whole upstream PR, but due to bootstrapping and the number of configurations in which rustc can be build I assume that this will be the hardest to merge, so I'm starting with it. Happy to hear what changes are required to be able to upstream this code. **Content:** It contains a new configure flag `--enable-llvm-enzyme`, and will build the new Enzyme submodule when it is set. **Discussion:** Apparently Rust CI isn't able to clone repositories outside the rust-lang org? At least I'm seeing this error in CI: ``` git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` Does that mean we would need to mirror github.com/EnzymeAD/Enzyme in rust-lang, until LLVM upgrades Enzyme from an Incubator project to something that ships as part of the monorepo? Tracking: - https://github.com/rust-lang/rust/issues/124509
2024-09-06Auto merge of #18066 - Veykril:lsp-server-no-panic, r=Veykrilbors-13/+11
fix: Don't panic lsp writer thread on dropped receiver Should reduce the noise a bit (https://github.com/rust-lang/rust-analyzer/issues/18055). This removes the panic (and a follow up panic) when the server incorrectly shuts down, turning it into a proper late exit error.
2024-09-06fix: Don't panic lsp writer thread on dropped receiverLukas Wirth-13/+11
2024-09-06Auto merge of #3864 - RalfJung:miri-bat-nightly, r=RalfJungbors-2/+2
miri.bat: use nightly toolchain Hopefully fixes https://github.com/rust-lang/miri/issues/3863 (but I can't test that)
2024-09-06miri.bat: use nightly toolchainRalf Jung-2/+2
2024-09-06Auto merge of #18065 - Veykril:catchy-diagnostics, r=Veykrilbors-12/+23
fix: Catch panics from diagnostics computation
2024-09-06fix: Catch panics from diagnostics computationLukas Wirth-12/+23
2024-09-06Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errorsMatthias Krüger-13/+11
Make `Ty::boxed_ty` return an `Option` Looks like a good place to use Rust's type system. --- Most of https://github.com/rust-lang/rust/blob/4ac7bcbaad8d6fd7a51bdf1b696cbc3ba4c796cf/compiler/rustc_middle/src/ty/sty.rs#L971-L1963 looks like it could be moved to `TyKind` (then I guess `Ty` should be made to deref to `TyKind`).
2024-09-06Merge from rustcThe Miri Cronjob Bot-24/+133
2024-09-06Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-09-06Auto merge of #129999 - matthiaskrgr:rollup-pzr9c8p, r=matthiaskrgrbors-0/+16
Rollup of 11 pull requests Successful merges: - #128919 (Add an internal lint that warns when accessing untracked data) - #129472 (fix ICE when `asm_const` and `const_refs_to_static` are combined) - #129653 (clarify that addr_of creates read-only pointers) - #129775 (bootstrap: Try to track down why `initial_libdir` sometimes fails) - #129939 (explain why Rvalue::Len still exists) - #129942 (copy rustc rustlib artifacts from ci-rustc) - #129943 (use the bootstrapped compiler for `test-float-parse` test) - #129944 (Add compat note for trait solver change) - #129947 (Add digit separators in `Duration` examples) - #129955 (Temporarily remove fmease from the review rotation) - #129957 (forward linker option to lint-docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-05Enzyme backendManuel Drehwald-0/+4
Co-authored-by: Lorenz Schmidt <bytesnake@mailbox.org>
2024-09-05fix: Updating settings should not clobber discovered projectsWilfred Hughes-61/+85
`linkedProjects` is owned by the user's configuration, so when users update this setting, `linkedProjects` is reset. This is problematic when `linkedProjects` also contains projects discovered with `discoverCommand`. The buggy behaviour occurred when: (1) The user configures `discoverCommand` and loads a Rust project. (2) The user changes any setting in VS Code, so rust-analyzer receives `workspace/didChangeConfiguration`. (3) `handle_did_change_configuration` ultimately calls `Client::apply_change_with_sink()`, which updates `config.user_config` and discards any items we added in `linkedProjects`. Instead, separate out `discovered_projects_from_filesystem` and `discovered_projects_from_command` from user configuration, so user settings cannot affect any type of discovered project. This fixes the subtle issue mentioned here: https://github.com/rust-lang/rust-analyzer/pull/17246#issuecomment-2185259122
2024-09-06Make `Ty::boxed_ty` return an `Option`Pavel Grigorenko-13/+11
2024-09-05Rollup merge of #129957 - chenx97:lint-docs-linker-opt, r=albertlarsan68Matthias Krüger-0/+13
forward linker option to lint-docs This fixes an error found when building the doc for a cross-built toolchain. ``` warning: the code example in lint `unstable_syntax_pre_expansion` in /buildroots/chenx97/rustc-1.80.1-src/compiler/rustc_lint_defs/src/builtin.rs failed to generate the expected output: did not find lint `unstable_syntax_p re_expansion` in output of example, got: error: linking with `cc` failed: exit status: 1 ... ``` Closes: #129956
2024-09-05Rollup merge of #128919 - Nadrieril:lint-query-leaks, r=cjgillotMatthias Krüger-0/+3
Add an internal lint that warns when accessing untracked data Some methods access data that is not tracked by the query system and should be used with caution. As suggested in https://github.com/rust-lang/rust/pull/128815#issuecomment-2275488683, in this PR I propose a lint (modeled on the `potential_query_instability` lint) that warns when using some specially-annotatted functions. I can't tell myself if this lint would be that useful, compared to renaming `Steal::is_stolen` to `is_stolen_untracked`. This would depend on whether there are other functions we'd want to lint like this. So far it seems they're called `*_untracked`, which may be clear enough. r? ``@oli-obk``
2024-09-05Add command to report unresolved referencesDavid Richey-0/+200
2024-09-05Rollup merge of #129973 - jieyouxu:rework-rmake-stdio, r=KobzolMatthias Krüger-23/+83
run_make_support: rename `Command::stdin` to `stdin_buf` and add `std{in,out,err}` config helpers Previously `Command::stdin` was actually just a stdin buffer helper, but this is different from `std::process::Command::stdin`. This is needlessly confusing, and blocks support to add `std{in,out,err}` config helpers that tests may want to use to e.g. redirect to `/dev/ptmx`.
2024-09-05update cfgsBoxy-7/+0
2024-09-05fix: Fix parser panicking on invalid asm optionsLukas Wirth-0/+6