about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2024-04-30rustc: document the jobserverMiguel Ojeda-0/+87
Explicitly document that the jobserver may be used by `rustc` and show the warning to increase the chances that this document is found when searching for solutions online. In particular, add a section about the interaction with build systems, which is intended to contain recommendations on how to integrate `rustc` with different built systems. For GNU Make, recommend using the `+` indicator. In addition, add a note about the issue with GNU Make 4.3 since it is important that users realize they should do this even if they do not expect parallelism from `rustc`. Finally, show how to workaround the issue of `$(shell ...)` calls in recursive Make (which e.g. was needed for the Linux kernel). The GNU Make 4.4 case under `--jobserver-style=pipe` is not added since it got fixed after Rust 1.76.0 already (i.e. `rustc` will not warn if it finds the negative file descriptors). For CMake, recommend using `JOB_SERVER_AWARE` and show a workaround using `$(MAKE)` for earlier versions (when using the Makefile generator). From: https://github.com/rust-lang/rust/issues/120515 Cc: @petrochenkov @belovdv @weihanglo @bjorn3 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-04-29arm target docs: small wording fixesJonathan Pallant-2/+2
2024-04-29Recommend to never display zero disambiguators when demangling v0 symbol namesMichael Woerister-0/+13
2024-04-29coverage: Replace boolean options with a `CoverageLevel` enumZalathar-6/+11
2024-04-29arm target docs: collapsed eabi and eabihf into oneJonathan Pallant-223/+56
2024-04-29Arm target doc wording tweaks based on review comments.Jonathan Pallant-27/+37
2024-04-29Adding new arm target docs to SUMMARY.mdJonathan Pallant-0/+7
2024-04-28typo traige->triageEmanuel Czirai-1/+1
2024-04-28Add tracking issue and unstable book page for `"vectorcall"` ABIbeetrees-0/+19
2024-04-26Fixed some typographical errors in arm-none-eabi.md.Jonathan Pallant-3/+3
2024-04-26Add pages for every Cortex-M targetJonathan Pallant-39/+646
Now explains how to, for example, support a Cortex-M55 with FPU and Integer Helium.
2024-04-25debuginfo: Stabilize `-Z debug-macros`, `-Z collapse-macro-debuginfo` and ↵Vadim Petrochenkov-0/+12
`#[collapse_debuginfo]` `-Z debug-macros` is "stabilized" by enabling it by default and removing. `-Z collapse-macro-debuginfo` is stabilized as `-C collapse-macro-debuginfo`. It now supports all typical boolean values (`parse_opt_bool`) in addition to just yes/no. Default value of `collapse_debuginfo` was changed from `false` to `external` (i.e. collapsed if external, not collapsed if local). `#[collapse_debuginfo]` attribute without a value is no longer supported to avoid guessing the default.
2024-04-25Add `--print=check-cfg` to get the expected configsUrgau-0/+25
2024-04-25Rollup merge of #124322 - whosehang:master, r=NilstriebMatthias Krüger-4/+4
chore: fix some typos in comments
2024-04-24Stabilise `inline_const`Gary Guo-34/+0
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-13/+14
And suggest adding the `#[coroutine]` to the closure
2024-04-24chore: fix some typos in commentswhosehang-4/+4
Signed-off-by: whosehang <whosehang@outlook.com>
2024-04-23Put the RFC behind a feature gate `result_ffi_guarantees`Arvind Mukund-0/+14
2024-04-22Update booksrustbot-0/+0
2024-04-22Auto merge of #115120 - icedrocket:ignore-strip-on-msvc, r=michaelwoeristerbors-15/+16
Ignore `-C strip` on MSVC tl;dr - Define `-Cstrip` to only ever affect the binary; no other build artifacts. This is necessary to improve cross-platform behavior consistency: if someone wanted debug information to be contained only in separate files on all platforms, they would set `-Cstrip=symbols` and `-Csplit-debuginfo=packed`, but this would result in no PDB files on MSVC. Resolves #114215
2024-04-20Auto merge of #121712 - mati865:provide-prebuilt-std-for-gnullvm, ↵bors-14/+28
r=Mark-Simulacrum Provide prebuilt std for gnullvm targets Revival of https://github.com/rust-lang/rust/pull/114346 which waiting on MCP that was accepted recently: https://github.com/rust-lang/compiler-team/issues/710#issuecomment-1942014308
2024-04-20Rollup merge of #123409 - ZhuUx:master, r=oli-obkMatthias Krüger-3/+3
Implement Modified Condition/Decision Coverage This is an implementation based on llvm backend support (>= 18) by `@evodius96` and branch coverage support by `@Zalathar.` ### Major changes: * Add -Zcoverage-options=mcdc as switch. Now coverage options accept either `no-branch`, `branch`, or `mcdc`. `mcdc` also enables `branch` because it is essential to work. * Add coverage mapping for MCDCBranch and MCDCDecision. Note that MCDCParameter evolves from llvm 18 to llvm 19. The mapping in rust side mainly references to 19 and is casted to 18 types in llvm wrapper. * Add wrapper for mcdc instrinc functions from llvm. And inject associated statements to mir. * Add BcbMappingKind::Decision, I'm not sure is it proper but can't find a better way temporarily. * Let coverage-dump support parsing MCDCBranch and MCDCDecision from llvm ir. * Add simple tests to check whether mcdc works. * Same as clang, currently rustc does not generate instrument for decision with more than 6 condtions or only 1 condition due to considerations of resource. ### Implementation Details 1. To get information about conditions and decisions, `MCDCState` in `BranchInfoBuilder` is used during hir lowering to mir. For expressions with logical op we call `Builder::visit_coverage_branch_operation` to record its sub conditions, generate condition ids for them and save their spans (to construct the span of whole decision). This process mainly references to the implementation in clang and is described in comments over `MCDCState::record_conditions`. Also true marks and false marks introduced by branch coverage are used to detect where the decision evaluation ends: the next id of the condition == 0. 2. Once the `MCDCState::decision_stack` popped all recorded conditions, we can ensure that the decision is checked over and push it into `decision_spans`. We do not manually insert decision span to avoid complexity from then_else_break in nested if scopes. 3. When constructing CoverageSpans, add condition info to BcbMappingKind::Branch and decision info to BcbMappingKind::Decision. If the branch mapping has non-zero condition id it will be transformed to MCDCBranch mapping and insert `CondBitmapUpdate` statements to its evaluated blocks. While decision bcb mapping will insert `TestVectorBitmapUpdate` in all its end blocks. ### Usage ```bash echo "[build]\nprofiler=true" >> config.toml ./x build --stage 1 ./x test tests/coverage/mcdc_if.rs ``` to build the compiler and run tests. ```shell export PATH=path/to/llvm-build:$PATH rustup toolchain link mcdc build/host/stage1 cargo +mcdc rustc --bin foo -- -Cinstrument-coverage -Zcoverage-options=mcdc cd target/debug LLVM_PROFILE_FILE="foo.profraw" ./foo llvm-profdata merge -sparse foo.profraw -o foo.profdata llvm-cov show ./foo -instr-profile=foo.profdata --show-mcdc ``` to check "foo" code. ### Problems to solve For now decision mapping will insert statements to its all end blocks, which may be optimized by inserting a final block of the decision. To do this we must also trace the evaluated value at each end of the decision and join them separately. This implementation is not heavily tested so there should be some unrevealed issues. We are going to check our rust products in the next. Please let me know if you had any suggestions or comments.
2024-04-19rustdoc-search: docs for reference syntaxMichael Howell-1/+9
2024-04-19Show files produced by --emit foo in json artifact notificationsMichael Baikov-1/+7
2024-04-19Auto merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiserbors-0/+10
Introduce perma-unstable `wasm-c-abi` flag Now that `wasm-bindgen` v0.2.88 supports the spec-compliant C ABI, the idea is to switch to that in a future version of Rust. In the meantime it would be good to let people test and play around with it. This PR introduces a new perma-unstable `-Zwasm-c-abi` compiler flag, which switches to the new spec-compliant C ABI when targeting `wasm32-unknown-unknown`. Alternatively, we could also stabilize this and then deprecate it when we switch. I will leave this to the Rust maintainers to decide. This is a companion PR to #117918, but they could be merged independently. MCP: https://github.com/rust-lang/compiler-team/issues/703 Tracking issue: https://github.com/rust-lang/rust/issues/122532
2024-04-19coverage. Add coverage-options=mcdc as gate for MC/DC instrumentzhuyunxing-3/+3
2024-04-18Auto merge of #123144 - dpaoliello:arm64eclib, ↵bors-17/+38
r=GuillaumeGomez,ChrisDenton,wesleywiser Add support for Arm64EC to the Standard Library Adds the final pieces so that the standard library can be built for arm64ec-pc-windows-msvc (initially added in #119199) * Bumps `windows-sys` to 0.56.0, which adds support for Arm64EC. * Correctly set the `isEC` parameter for LLVM's `writeArchive` function. * Add `#![feature(asm_experimental_arch)]` to library crates where Arm64EC inline assembly is used, as it is currently unstable.
2024-04-17Auto merge of #123978 - alexcrichton:update-wasi-toolchain, r=Mark-Simulacrumbors-20/+49
Update how WASI toolchains are used in CI and bootstrap This commit updates how the WASI targets are configured with their toolchain. Long ago a `config.toml` option of `wasi-root` was added to enable building with the WASI files produced by wasi-libc. Additionally for CI testing and release building the Rust toolchain has been using a hard-coded commit of wasi-libc which is bundled with the release of the `wasm32-wasip1` target, for example. Nowadays though the wasi-sdk project, the C/C++ toolchain for WASI, is the go-to solution for compiling/linking WASI code and contains the more-or-less official releases of wasi-libc. This commit migrates CI to using wasi-sdk releases and additionally updates `bootstrap` to recognize when this is configured. This means that with `$WASI_SDK_PATH` configured there's no further configuration necessary to get a working build. Notably this also works better for the new targets of WASI as well, such as `wasm32-wasip2` and `wasm32-wasip1-threads` where the wasi-sdk release now has libraries for all targets bundled within it.
2024-04-16Rollup merge of #123501 - Urgau:stabilize-check-cfg, r=petrochenkovMatthias Krüger-23/+26
Stabilize checking of cfgs at compile-time: `--check-cfg` option This PR stabilize the `--check-cfg` CLI option of `rustc` (and `rustdoc`) :tada:. In particular this PR does two things: 1. it makes the `--check-cfg` option stable 2. and it moves the documentation to the stable books FCP: https://github.com/rust-lang/rust/issues/82450#issuecomment-1965328542 Resolves #82450 ``@rustbot`` labels +S-blocked +F-check-cfg r? ``@petrochenkov``
2024-04-16Rollup merge of #121694 - davidtwco:stabilize-relro-level, r=Mark-SimulacrumGuillaume Gomez-0/+20
sess: stabilize `-Zrelro-level` as `-Crelro-level` Stabilise `-Zrelro-level` as `-Crelro-level`. There's no tracking issue for this flag to close.
2024-04-15Add support for Arm64EC to the Standard LibraryDaniel Paoliello-17/+38
2024-04-15Update how WASI toolchains are used in CI and bootstrapAlex Crichton-20/+49
This commit updates how the WASI targets are configured with their toolchain. Long ago a `config.toml` option of `wasi-root` was added to enable building with the WASI files produced by wasi-libc. Additionally for CI testing and release building the Rust toolchain has been using a hard-coded commit of wasi-libc which is bundled with the release of the `wasm32-wasip1` target, for example. Nowadays though the wasi-sdk project, the C/C++ toolchain for WASI, is the go-to solution for compiling/linking WASI code and contains the more-or-less official releases of wasi-libc. This commit migrates CI to using wasi-sdk releases and additionally updates `bootstrap` to recognize when this is configured. This means that with `$WASI_SDK_PATH` configured there's no further configuration necessary to get a working build. Notably this also works better for the new targets of WASI as well, such as `wasm32-wasip2` and `wasm32-wasip1-threads` where the wasi-sdk release now has libraries for all targets bundled within it.
2024-04-15Move --check-cfg documentation to stable booksUrgau-23/+26
2024-04-15Rollup merge of #123666 - mountcount:master, r=lqd许杰友 Jieyou Xu (Joe)-3/+3
Fix some typos in doc
2024-04-15Distribute LLVM bitcode linker as a preview componentKjetil Kjeka-0/+4
2024-04-15Fix some typos in docmountcount-3/+3
Signed-off-by: mountcount <cuimoman@outlook.com>
2024-04-15Provide prebuilt std for gnullvm targetsMateusz Mikuła-14/+28
2024-04-14Add documentation for unused-externs(-silent)Jeremy Fitzhardinge-0/+30
2024-04-13Add a note about checks with multiple revisions (#1963)Trevor Gross-2/+4
2024-04-12document `-Zlinker-features` in the unstable bookRémy Rakic-0/+35
2024-04-11compiletest: clarify that headers must be one header per line许杰友 Jieyou Xu (Joe)-1/+5
2024-04-10Add support for Arm64EC inline assemblyDaniel Paoliello-2/+30
2024-04-09chore: fix some typos in conmentsneedsure-7/+7
Signed-off-by: needsure <qinzhipeng@outlook.com>
2024-04-08compiletest: specify which special env var and which particular CI job (#1960)许杰友 Jieyou Xu (Joe)-2/+4
* compiletest: specify which special env var and which particular CI job * compiletest: fix grammar and add link to Dockerfile
2024-04-08Update booksrustbot-0/+0
2024-04-06Explicitly mention compiletest directives are supported in rmake.rs (#1949)许杰友 Jieyou Xu (Joe)-0/+3
2024-04-06Add docs for sharded descriptionsMichael Howell-36/+148
2024-04-06Add basic docs for the new `aux-bin` header (#1942)Martin Nordholts-1/+6
2024-04-06Add needs-threads header command (#1943)Eric Huss-0/+1
2024-04-06Fix some broken links under bootstrapping. (#1958)Prashanth Mundkur-8/+8
* Fix some broken links under bootstrapping. * Fix more broken links for bootstrapping.