about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-11-23Update CoverageMappingFormat Support to Version6Arpad Borsos-2/+2
Version 5 adds Branch Regions which are a prerequisite for branch coverage. Version 6 can use the zeroth filename as prefix for other relative files.
2021-11-23Rollup merge of #91140 - nbdd0121:const_typeck, r=oli-obkMatthias Krüger-15/+26
Split inline const to two feature gates and mark expression position inline const complete This PR splits inline const in pattern position into its own `#![feature(inline_const_pat)]` feature gate, and make the usage in expression position complete. I think I have resolved most outstanding issues related to `inline_const` with #89561 and other PRs. The only thing left that I am aware of is #90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in #89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another. ``@rustbot`` label: T-compiler F-inline_const
2021-11-22Split inline const to two feature gatesGary Guo-15/+26
2021-11-22Update booksEric Huss-0/+0
2021-11-19Put back removed empty lineGuillaume Gomez-0/+1
2021-11-18Auto merge of #91019 - JohnTitor:rollup-q95ra7r, r=JohnTitorbors-40/+33
Rollup of 8 pull requests Successful merges: - #90386 (Add `-Zassert-incr-state` to assert state of incremental cache) - #90438 (Clean up mess for --show-coverage documentation) - #90480 (Mention `Vec::remove` in `Vec::swap_remove`'s docs) - #90607 (Make slice->str conversion and related functions `const`) - #90750 (rustdoc: Replace where-bounded Clean impl with simple function) - #90895 (require full validity when determining the discriminant of a value) - #90989 (Avoid suggesting literal formatting that turns into member access) - #91002 (rustc: Remove `#[rustc_synthetic]`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-11-18Auto merge of #90382 - alexcrichton:wasm64-libstd, r=joshtriplettbors-1/+103
std: Get the standard library compiling for wasm64 This commit goes through and updates various `#[cfg]` as appropriate to get the wasm64-unknown-unknown target behaving similarly to the wasm32-unknown-unknown target. Most of this is just updating various conditions for `target_arch = "wasm32"` to also account for `target_arch = "wasm64"` where appropriate. This commit also lists `wasm64` as an allow-listed architecture to not have the `restricted_std` feature enabled, enabling experimentation with `-Z build-std` externally. The main goal of this commit is to enable playing around with `wasm64-unknown-unknown` externally via `-Z build-std` in a way that's similar to the `wasm32-unknown-unknown` target. These targets are effectively the same and only differ in their pointer size, but wasm64 is much newer and has much less ecosystem/library support so it'll still take time to get wasm64 fully-fledged.
2021-11-18Clean up mess for --show-coverage documentationGuillaume Gomez-40/+33
2021-11-16Rollup merge of #90058 - joshtriplett:stabilize-strip, r=wesleywiserYuki Okushi-17/+16
Stabilize -Z strip as -C strip Leave -Z strip available temporarily as an alias, to avoid breaking cargo until cargo transitions to using -C strip.
2021-11-15Stabilize -Z strip as -C stripJosh Triplett-17/+16
Leave -Z strip available temporarily as an alias, to avoid breaking cargo until cargo transitions to using -C strip. (If the user passes both, the -C version wins.)
2021-11-15Stabilize format_args_captureJosh Triplett-47/+0
Works as expected, and there are widespread reports of success with it, as well as interest in it.
2021-11-12Auto merge of #89316 - asquared31415:multiple-clobber-abi, r=Amanieubors-3/+5
Add support for specifying multiple clobber_abi in `asm!` r? `@Amanieu` cc #72016 `@rustbot` label: +A-inline-assembly +F-asm
2021-11-11Auto merge of #83846 - torhovland:issue-10971, r=davidtwcobors-0/+10
Added the --temps-dir option Fixes #10971. The new `--temps-dir` option puts intermediate files in a user-specified directory. This provides a fix for the issue where parallel invocations of rustc would overwrite each other's intermediate files. No files are kept in the intermediate directory unless `-C save-temps=yes`. If additional files are specifically requested using `--emit asm,llvm-bc,llvm-ir,obj,metadata,link,dep-info,mir`, these will be put in the output directory rather than the intermediate directory. This is a backward-compatible change, i.e. if `--temps-dir` is not specified, the behavior is the same as before.
2021-11-10Rollup merge of #90736 - Lokathor:inline-asm-docs-updates, r=AmanieuMatthias Krüger-2/+5
adjust documented inline-asm register constraints This change more clearly specifies how `reg` and `reg_thumb` work with ARM, Thumb2, and Thumb1 code. Based upon the [llvm documentation](https://llvm.org/docs/LangRef.html#supported-constraint-code-list) for register constraint codes. To be clear, this just updates the docs to match what already happens with rustc/llvm. No change in the compiler is required to make it match this new documentation.
2021-11-10Add a missing doc linkAlex Crichton-0/+1
2021-11-10Update src/doc/rustc/src/platform-support.mdAlex Crichton-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-11-10Add target documentation for wasm64-unknown-unknownAlex Crichton-0/+101
2021-11-10Update platform support docsAlex Crichton-1/+1
2021-11-10Add support for specifying multiple clobber_abi in `asm!`asquared31415-3/+5
Allow multiple clobber_abi in asm Update docs Fix aarch64 test Combine abis Emit duplicate ABI error, empty ABI list error multiple clobber_abi
2021-11-09Update booksEric Huss-0/+0
2021-11-09Update src/doc/unstable-book/src/library-features/asm.mdLokathor-2/+2
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-11-09Update src/doc/unstable-book/src/library-features/asm.mdLokathor-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-11-09adjust documented register constraints to match ↵Lokathor-2/+5
https://llvm.org/docs/LangRef.html#supported-constraint-code-list
2021-11-09Rollup merge of #90035 - SparrowLii:rfc2528, r=jackh726Matthias Krüger-0/+33
implement rfc-2528 type_changing-struct-update This PR implement rfc2528-type_changing-struct-update. The main change process is as follows: 1. Move the processing part of `base_expr` into `check_expr_struct_fields` to avoid returning `remaining_fields` (a relatively complex hash table) 2. Before performing the type consistency check(`check_expr_has_type_or_error`), if the `type_changing_struct_update` feature is set, enter a different processing flow, otherwise keep the original flow 3. In the case of the same structure definition, check each field in `remaining_fields`. If the field in `base_expr` is not the suptype of the field in `adt_ty`, an error(`FeildMisMatch`) will be reported. The MIR part does not need to be changed, because only the items contained in `remaining_fields` will be extracted from `base_expr` when MIR is generated. This means that fields with different types in `base_expr` will not be used Updates #86618 cc `@nikomatsakis`
2021-11-07Made temps-dir an unstable option.Tor Hovland-9/+10
2021-11-07Auto merge of #90348 - Amanieu:asm_feature_gates, r=joshtriplettbors-2/+2
Add features gates for experimental asm features This PR splits off parts of `asm!` into separate features because they are not ready for stabilization. Specifically this adds: - `asm_const` for `const` operands. - `asm_sym` for `sym` operands. - `asm_experimental_arch` for architectures other than x86, x86_64, arm, aarch64 and riscv. r? `@nagisa`
2021-11-07Add features gates for experimental asm featuresAmanieu d'Antras-2/+2
2021-11-06Rollup merge of #90487 - NoraCodes:nora/how-to-read-rustdoc, r=jyn514Matthias Krüger-0/+108
Add a chapter on reading Rustdoc output Includes documentation for: - general page structure - navigation - searching - themes - deep-linking Doesn't include docs on the settings page. Per https://github.com/rust-lang/rust/issues/90309
2021-11-05Add a chapter on reading Rustdoc outputLeonora Tindall-0/+108
Includes documentation for: - general page structure - navigation - searching - themes - deep-linking Doesn't include docs on the settings page.
2021-11-04Mention possible future rejectionsSmittyvb-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-11-03Add note about x86 instruction prefixes in asm!Smittyvb-0/+2
Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes #82314 by mentioning that x86 instruction prefixes must not be used in inline assembly.
2021-11-02Rollup merge of #90084 - noncombatant:patch-2, r=steveklabnikMatthias Krüger-1/+1
Make printed message match the code comment I think this code is getting L0, not L1 cache size, if I'm reading the Intel manual right. (I might not be.) Either way, the code comment and the printed message should match, whichever way is right. :)
2021-11-02Documentation.Tor Hovland-0/+9
2021-11-02Add a template for target-specific documentationJosh Triplett-2/+56
2021-11-02Point to platform-support/ for target-specific documentationJosh Triplett-0/+6
Explain that target-specific documentation should appear in a subdirectory of platform-support, with a link from the target's entry on the platform-support page.
2021-11-02Clarify documentation about running binariesJosh Triplett-3/+3
The requirement for target documentation talks about "running tests", but tier 3 targets often don't support running the full testsuite, and in practice the documentation for how to run an individual binary may be more useful. Change "running tests" to "running binaries, or running tests".
2021-11-02Clarify dependency requirements in the face of cross-compilationJosh Triplett-11/+13
The requirement on dependencies was phrased in terms of "host tools", but it was also intended to apply equally to targets that only support cross-compilation. Only the exception (for libraries commonly needed for binaries on the target) was intended to apply to host tools. Reword the requirement to talk about the dependencies required for "compiling, linking,and emitting functional binaries, libraries, or other code for the target", rather than generically in terms of dependencies for rustc/cargo. This doesn't change the net effect of the requirements, since other requirements already stated that the target can't make the Rust toolchain depend on proprietary libraries. However, this should make the requirements clearer.
2021-11-02Clarify how to quote and respond to the target tier policy requirementsJosh Triplett-2/+4
Several times, people have seemed unclear on how to respond to some of the policy requirements, particularly those that just state things the target developers must *not* do (e.g. not posting to PRs that break the target). Add a note that such requirements just need acknowledgement, nothing more. Make quoting and responding a "must" rather than an "is encouraged to", since it's easier to review the requirements that way.
2021-11-01Rollup merge of #90398 - GuillaumeGomez:doc-keyword-doc, r=camelidMatthias Krüger-2/+20
Document `doc(keyword)` unstable attribute r? `@camelid`
2021-10-31Auto merge of #89062 - mikeleany:new-target, r=cjgillotbors-0/+78
Add new tier 3 target: `x86_64-unknown-none` Adds support for compiling OS kernels or other bare-metal applications for the x86-64 architecture. Below are details on how this target meets the requirements for tier 3: > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) I would be willing to be a target maintainer, though I would appreciate if others volunteered to help with that as well. > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. Uses the same naming as the LLVM target, and the same convention as many other bare-metal targets. > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. I don't believe there is any ambiguity here. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. I don't see any legal issues here. > The target must not introduce license incompatibilities. > Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. >If the target supports building host tools (such as rustc or cargo), those host tools must not depend on proprietary (non-FOSS) libraries, other than ordinary runtime libraries supplied by the platform and commonly used by other binaries built for the target. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. > Targets should not require proprietary (non-FOSS) components to link a functional binary or library. > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. I see no issues with any of the above. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Only relevant to those making approval decisions. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. `core` and `alloc` can be used. `std` cannot be used as this is a bare-metal target. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running tests (even if they do not pass), the documentation must explain how to run tests for the target, using emulation if possible or dedicated hardware if necessary. Use `--target=x86_64-unknown-none-elf` option to cross compile, just like any target. The target does not support running tests. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. I don't foresee this being a problem. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. No other targets should be affected by the pull request.
2021-10-31Add doc about doc(keyword) unstable attributeGuillaume Gomez-2/+20
2021-10-30Rollup merge of #90374 - GuillaumeGomez:unify-rustdoc-book-titles, r=camelidMatthias Krüger-2/+6
Unify titles in rustdoc book doc attributes chapter As discussed in https://github.com/rust-lang/rust/pull/90339. I wasn't able to find out where the link to the titles was used so let's see if the CI fails. :) r? ``@camelid``
2021-10-29Unify titles in rustdoc book doc attributes chapterGuillaume Gomez-2/+6
2021-10-29Rollup merge of #90082 - noncombatant:patch-1, r=GuillaumeGomezMatthias Krüger-2/+2
Fix minor typos
2021-10-28Auto merge of #90339 - GuillaumeGomez:doc-alias-doc, r=GuillaumeGomezbors-2/+49
Add missing documentation for doc alias
2021-10-28Add missing documentation for doc aliasGuillaume Gomez-2/+49
2021-10-28implement type-changing-struct-updateSparrowLii-0/+33
put the test dir in test/ui/rfcs
2021-10-27Auto merge of #89652 - rcvalle:rust-cfi, r=nagisabors-19/+202
Add LLVM CFI support to the Rust compiler This PR adds LLVM Control Flow Integrity (CFI) support to the Rust compiler. It initially provides forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their number of arguments. Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by defining and using compatible type identifiers (see Type metadata in the design document in the tracking issue #89653). LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto). Thank you, `@eddyb` and `@pcc,` for all the help!
2021-10-26Add documentation for LLVM CFI supportRamon de C Valle-19/+202
This commit adds initial documentation for LLVM Control Flow Integrity (CFI) support to the Rust compiler (see #89652 and #89653).
2021-10-25Update booksEric Huss-0/+0