summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-10-15Move `too_long_first_doc_paragraph` to `nursery`Philipp Krones-1/+1
2024-10-14bump channel to stableJosh Stone-1/+1
2024-10-11Use small runner for msvc-ext2 jobChris Denton-1/+5
(cherry picked from commit ebe4fc4e1269157e018cc127d69c8128d1a56702)
2024-10-11Fix bash syntaxChris Denton-1/+1
(cherry picked from commit 0d94e6bac90a804041cf1847e034001b7517e29a)
2024-10-11Fix checktools.sh non-msvc buildsChris Denton-6/+7
(cherry picked from commit 2f6307d1cca53c153bddee83f4331fe979c61fe4)
2024-10-11Split x86_64-msvc-ext into two jobsChris Denton-5/+21
(cherry picked from commit 7358429c00bb874420866d5f78b7166e79ad9f1f)
2024-10-11Update LLVM submoduleDianQK-0/+0
(cherry picked from commit e1c0f0488bb1eda68e45ff58c0eb5ce411a62275)
2024-09-26bootstrap: Set the dylib path when building books with rustdocJosh Stone-9/+11
The library path is needed when the toolchain has been configured with `[rust] rpath = false`. Otherwise, building the reference book will get an error when it tries to run rustdoc, like: rustdoc: error while loading shared libraries: librustc_driver-2ec457c3b8826b72.so (cherry picked from commit de4c8975aaa05063129196e470d3dcf7558f19b1)
2024-09-19Update LLVM to 19 327ca6cDianQK-0/+0
(cherry picked from commit 7c692e13b171c04b6bb6baa4d5aa138beecf8da8)
2024-09-06bump stage0Boxy-444/+342
2024-09-02Backport #129917Boxy-0/+1
2024-09-02bump channel to betaBoxy-1/+1
2024-08-31Auto merge of #129831 - matthiaskrgr:rollup-befq6zx, r=matthiaskrgrbors-19/+285
Rollup of 11 pull requests Successful merges: - #128523 (Add release notes for 1.81.0) - #129605 (Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen) - #129650 (Clean up `library/profiler_builtins/build.rs`) - #129651 (skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set) - #129684 (Enable Miri to pass pointers through FFI) - #129762 (Update the `wasm-component-ld` binary dependency) - #129782 (couple more crash tests) - #129816 (tidy: say which feature gate has a stability issue mismatch) - #129818 (make the const-unstable-in-stable error more clear) - #129824 (Fix code examples buttons not appearing on click on mobile) - #129826 (library: Fix typo in `core::mem`) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-31Rollup merge of #129824 - GuillaumeGomez:code-example-buttons-mobile, ↵Matthias Krüger-2/+8
r=notriddle Fix code examples buttons not appearing on click on mobile When browsing docs on mobile today, I realized that the buttons didn't appear when I tapped on the code example. One issue: I have no idea how to add a regression test for this case... r? ``@notriddle``
2024-08-31Rollup merge of #129816 - RalfJung:tidy-feature-issue-mismatch, ↵Matthias Krüger-1/+2
r=compiler-errors tidy: say which feature gate has a stability issue mismatch This gives some valuable context to what the error is actually about :)
2024-08-31Rollup merge of #129762 - alexcrichton:update-wasm-component-ld, r=jieyouxuMatthias Krüger-1/+1
Update the `wasm-component-ld` binary dependency This keeps it up-to-date by moving from 0.5.6 to 0.5.7. While here I've additionally updated some other wasm-related dependencies in the workspace to keep them up-to-date and try to avoid duplicate versions as well.
2024-08-31Rollup merge of #129684 - Strophox:miri-pass-pointer-to-ffi, r=RalfJungMatthias Krüger-5/+257
Enable Miri to pass pointers through FFI Following https://github.com/rust-lang/rust/pull/126787, the purpose of this PR is to now enable Miri to execute native calls that make use of pointers. > <details> > > <summary> Simple example </summary> > > ```rust > extern "C" { > fn ptr_printer(ptr: *mut i32); > } > > fn main() { > let ptr = &mut 42 as *mut i32; > unsafe { > ptr_printer(ptr); > } > } > ``` > ```c > void ptr_printer(int *ptr) { > printf("printing pointer dereference from C: %d\n", *ptr); > } > ``` > should now show `printing pointer dereference from C: 42`. > > </details> Note that this PR does not yet implement any logic involved in updating Miri's "analysis" state (byte initialization, provenance) upon such a native call. r? ``@RalfJung``
2024-08-31Rollup merge of #129651 - onur-ozkan:stage0-target-sanity-check, r=KobzolMatthias Krüger-8/+9
skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set When adding a new target to `rustc` and extending `STAGE0_MISSING_TARGETS`, there is a chance that in the merge CI bootstrap target sanity check might fail [here](https://github.com/rust-lang/rust/blob/26d27b7c8729fb61fe8321fcd2ce734a79aa695d/src/bootstrap/src/core/sanity.rs#L243-L256) because the stage 0 compiler will assume to already support the new target since `opt-dist` uses the previously compiled compiler as the stage 0 compiler. This PR skips this check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set, and makes `opt-dist` to set `BOOTSTRAP_SKIP_TARGET_SANITY` so bootstrap doesn't run this logic for opt-dist tests. Fixes https://github.com/rust-lang/rust/pull/127021#issuecomment-2308782315. Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/.60STAGE0_MISSING_TARGETS.60.20seems.20to.20check.20stage1 Blocker for https://github.com/rust-lang/rust/pull/127021
2024-08-31Rollup merge of #129605 - jieyouxu:needs-llvm-components, r=Mark-SimulacrumMatthias Krüger-2/+8
Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen Without suitable `needs-llvm-components` directives, some run-make tests exercising target-specific codegen can fail if the LLVM used is built without the necessary components. Currently, the list is: ``` tests\run-make\print-target-list tests\run-make\print-to-output tests\run-make\print-cfg tests\run-make\target-without-atomic-cas ``` This PR also skips tidy checks for revisions and `needs-llvm-components` for run-make tests since revisions are not supported. Fixes #129390. Fixes #127895. cc ``@petrochenkov`` who noticed this, thanks! Would be great if you could confirm that this fixes the test errors for you locally.
2024-08-31Fix code examples buttons not appearing on click on mobileGuillaume Gomez-2/+8
2024-08-31Rollup merge of #129785 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-441/+1197
Miri subtree update r? ```@ghost```
2024-08-31Rollup merge of #129774 - nnethercote:rm-extern-crate-tracing-remainder, ↵Matthias Krüger-10/+49
r=GuillaumeGomez Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt A follow-up to #129767 and earlier PRs doing this for `rustc_*` crates. r? ```@GuillaumeGomez```
2024-08-31Rollup merge of #129733 - lnicola:sync-from-ra, r=lnicolaMatthias Krüger-2888/+9203
Subtree update of `rust-analyzer` r? ````@ghost````
2024-08-31Rollup merge of #129711 - lqd:nll-mir-dumps, r=compiler-errorsMatthias Krüger-0/+1
Expand NLL MIR dumps This PR is a first step to clean up and expand NLL MIR dumps: - by restoring the "mir-include-spans" comments which are useful for `-Zdump-mir=nll` - by adding the list of borrows to NLL MIR dumps, where they are introduced in the CFG and in which region Comments in MIR dumps were turned off in #112346, but as shown in #114652 they were still useful for us working with NLL MIR dumps. So this PR pulls `-Z mir-include-spans` into its own options struct, so that passes dumping MIR can override them if need be. The rest of the compiler is not affected, only the "nll" pass dumps have these comments enabled again. The CLI still has priority when specifying the flag, so that we can explicitly turn them off in the `mir-opt` tests to keep blessed dumps easier to work with (which was one of the points of #112346). Then, as part of a couple steps to improve NLL/polonius MIR dumps and `.dot` visualizations, I've also added the list of borrows and where they're introduced. I'm doing all this to help debug some polonius scope issues in my prototype location-sensitive analysis :3. I'll probably add member constraints soon.
2024-08-31tidy: say which feature gate has a stability issue mismatchRalf Jung-1/+2
2024-08-31Rollup merge of #129751 - RalfJung:interpret-visit-field-order, ↵Matthias Krüger-8/+5
r=compiler-errors interpret/visitor: make memory order iteration slightly more efficient Finally I know enough about RPIT to write this iterator signature correctly. :D This means memory-order iteration now needs an allocation, but it avoids quadratic complexity (where it has to do a linear scan n times to find the n-th field in memory order), so that seems like a win overall. The changed code only affects Miri; the rustc changes are NOPs.
2024-08-31Rollup merge of #129731 - ferrocene:x-test-compiler, r=onur-ozkanMatthias Krüger-8/+3
Allow running `./x.py test compiler`
2024-08-31Rollup merge of #129725 - compiler-errors:predicates-of, r=fmeaseMatthias Krüger-16/+5
Stop using `ty::GenericPredicates` for non-predicates_of queries `GenericPredicates` is a struct of several parts: A list of of an item's own predicates, and a parent def id (and some effects related stuff, but ignore that since it's kinda irrelevant). When instantiating these generic predicates, it calls `predicates_of` on the parent and instantiates its predicates, and appends the item's own instantiated predicates too: https://github.com/rust-lang/rust/blob/acb4e8b6251f1d8da36f08e7a70fa23fc581839e/compiler/rustc_middle/src/ty/generics.rs#L407-L413 Notice how this should result in a recursive set of calls to `predicates_of`... However, `GenericPredicates` is *also* misused by a bunch of *other* queries as a convenient way of passing around a list of predicates. For these queries, we don't ever set the parent def id of the `GenericPredicates`, but if we did, then this would be very easy to mistakenly call `predicates_of` instead of some other intended parent query. Given that footgun, and the fact that we don't ever even *use* the parent def id in the `GenericPredicates` returned from queries like `explicit_super_predicates_of`, It really has no benefit over just returning `&'tcx [(Clause<'tcx>, Span)]`. This PR additionally opts to wrap the results of `EarlyBinder`, as we've tended to use that in the return type of these kinds of queries to properly convey that the user has params to deal with, and it also gives a convenient way of iterating over a slice of things after instantiating.
2024-08-31Rollup merge of #129366 - petrochenkov:libsearch, r=jieyouxuMatthias Krüger-1/+1
linker: Synchronize native library search in rustc and linker Also search for static libraries with alternative naming (`libname.a`) on MSVC when producing executables or dynamic libraries, and not just rlibs. This unblocks https://github.com/rust-lang/rust/pull/123436. try-job: x86_64-msvc
2024-08-31Rollup merge of #126183 - Folyd:search-core, r=GuillaumeGomez,notriddleMatthias Krüger-2281/+2319
Separate core search logic with search ui Currenty, the `search.js` mixed with UI/DOM manipulation codes and search logic codes, I propose to extract the search logic to a class for following benefits: - Clean code. Separation of DOM manipulation and search logic can lead better code maintainability and easy code testings. - Easy share the search logic for third party to utilize the search function, such as [Rust Search Extension](https://rust.extension.sh), https://query.rs. This PR added a new class called `DocSearch`, which mainly expose following methods: ```js class DocSearch { // Dependency inject searchIndex, rootPath and searchState constructor(rawSearchIndex, rootPath, searchState) { // build search index... } static parseQuery(userQuery) { } async execQuery(parsedQuery, filterCrates, currentCrate) { } } ```
2024-08-31Auto merge of #129797 - workingjubilee:cleanup-apple-ci, r=workingjubileebors-8/+23
Try to reduce space usage in dist CI We have had recurrent CI problems as a result of GitHub adding a new version of Xcode to its runners[^0], which has consumed ~40GB of space which served as padding. Try to reduce the number of Xcodes on our systems, because we only use Xcode 14 in actual practice. Also, try to move files instead of pointlessly copy them when we're at the end of the job. I could not resist addressing a few shellcheck lints while I was at it. [^0]: https://github.com/actions/runner-images/issues/10511
2024-08-30ci: Take tail instead of head to avoid broken pipesJubilee Young-3/+1
2024-08-30ci: Avoid legacy backticks in upload-artifacts.shJubilee Young-1/+1
2024-08-30ci: Use mv instead of cp in upload stepJubilee Young-4/+4
2024-08-30ci: Try to remove unused Xcode dirsJubilee Young-0/+17
2024-08-30enable Miri to pass const pointers through FFIStrophox-5/+257
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-08-30add borrows to NLL MIR dumpsRémy Rakic-0/+1
explicitly disable `-Zmir-include-spans` in mir-opt tests This will override the NLL default of true, and keep the blessed dumps easier to work with.
2024-08-30Merge from rustcThe Miri Cronjob Bot-119/+153
2024-08-30Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-08-30Remove `#[macro_use] extern crate tracing` from rustfmt.Nicholas Nethercote-2/+17
2024-08-30Remove `#[macro_use] extern crate tracing` from rustfmt helpers.Nicholas Nethercote-6/+2
2024-08-30Remove `#[macro_use] extern crate tracing` from rustdoc.Nicholas Nethercote-2/+30
2024-08-29Update the `wasm-component-ld` binary dependencyAlex Crichton-1/+1
This keeps it up-to-date by moving from 0.5.6 to 0.5.7. While here I've additionally updated some other wasm-related dependencies in the workspace to keep them up-to-date and try to avoid duplicate versions as well.
2024-08-29interpret/visitor: make memory order iteration slightly more efficientRalf Jung-8/+5
2024-08-29Rollup merge of #129743 - GuillaumeGomez:fix-rustdoc-clippy, r=notriddleGuillaume Gomez-105/+94
Fix rustdoc clippy lints Ran clippy on rustdoc and fixed the errors. r? `@notriddle`
2024-08-29Rollup merge of #129316 - dingxiangfei2009:riscv64-imac-scs, r=nnethercoteGuillaume Gomez-7/+33
riscv64imac: allow shadow call stack sanitizer cc `@Darksonn` for shadow call stack sanitizer support on RV64IMAC and RV64GC
2024-08-29Rollup merge of #128970 - DianQK:lint-llvm-ir, r=nikicGuillaume Gomez-0/+7
Add `-Zlint-llvm-ir` This flag is similar to `-Zverify-llvm-ir` and allows us to lint the generated IR. r? compiler
2024-08-29Rollup merge of #123940 - kornelski:remove-derived-debug, r=UrgauGuillaume Gomez-1/+17
debug-fmt-detail option I'd like to propose a new option that makes `#[derive(Debug)]` generate no-op implementations that don't print anything, and makes `{:?}` in format strings a no-op. There are a couple of motivations for this: 1. A more thorough stripping of debug symbols. Binaries stripped of debug symbols still retain some of them through `Debug` implementations. It's hard to avoid that without compiler's help, because debug formatting can be used in many places, including dependencies, and their loggers, asserts, panics, etc. * In my testing it gives about 2% binary size reduction on top of all other binary-minimizing best practices (including `panic_immediate_abort`). There are targets like Web WASM or embedded where users pay attention to binary sizes. * Users distributing closed-source binaries may not want to "leak" any symbol names as a matter of principle. 2. Adds ability to test whether code depends on specifics of the `Debug` format implementation in unwise ways (e.g. trying to get data unavailable via public interface, or using it as a serialization format). Because current Rust's debug implementation doesn't change, there's a risk of it becoming a fragile de-facto API that [won't be possible to change in the future](https://www.hyrumslaw.com/). An option that "breaks" it can act as a [grease](https://www.rfc-editor.org/rfc/rfc8701.html). This implementation is a `-Z fmt-debug=opt` flag that takes: * `full` — the default, current state. * `none` — makes derived `Debug` and `{:?}` no-ops. Explicit `impl Debug for T` implementations are left unharmed, but `{:?}` format won't use them, so they may get dead-code eliminated if they aren't invoked directly. * `shallow` — makes derived `Debug` print only the type's name, without recursing into fields. Fieldless enums print their variant names. `{:?}` works. The `shallow` option is a compromise between minimizing the `Debug` code, and compatibility. There are popular proc-macro crates that use `Debug::fmt` as a way to convert enum values into their Rust source code. There's a corresponding `cfg` flag: `#[cfg(fmt_debug = "none")]` that can be used in user code to react to this setting to minimize custom `Debug` implementations or remove unnecessary formatting helper functions.
2024-08-29riscv64imac: allow shadow call stack sanitizerDing Xiang Fei-7/+33
2024-08-29Fix clippy lintsGuillaume Gomez-105/+94