about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2024-01-20Add some explanations for frequently used rustbot commands (#1849)Yukang-5/+17
* add some explain for rustbot commands * add more details about shortcuts * fix words on `r=someone` Co-authored-by: Yuki Okushi <jtitor@2k36.org> --------- Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2024-01-20update some of the diagnostic translations info (#1711)Tshepang Mbambo-60/+19
2024-01-20Document unsafety checking (#1847)matthewjasper-6/+83
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2024-01-17Auto merge of #118708 - davidtwco:target-tier-assembly-test, r=Mark-Simulacrumbors-0/+2
tests: add sanity-check assembly test for every target Fixes #119910. Adds a basic assembly test checking that each target can produce assembly and update the target tier policy to require this. cc rust-lang/compiler-team#655 r? `@wesleywiser`
2024-01-17Auto merge of #119930 - Urgau:check-cfg-empty-values-means-empty, r=petrochenkovbors-12/+13
Add way to express that no values are expected with check-cfg This PR adds way to express no-values (no values expected) with `--check-cfg` by making empty `values()` no longer mean `values(none())` (internal: `&[None]`) and now be an empty list (internal: `&[]`). ### Context Currently `--check-cfg` has a way to express that _any value is expected_ with `values(any())`, but has no way to do the inverse and say that _no value is expected_. This would be particularly useful for build systems that control a config name and it's values as they could always declare a config name as expected and if in the current state they have values pass them and if not pass an empty list. To give a more concrete example, Cargo `--check-cfg` currently needs to generate: - `--check-cfg=cfg(feature, values(...))` for the case with declared features - and `--check-cfg=cfg()` for the case without any features declared This means that when there are no features declared, users will get an `unexpected config name` but from the point of view of Cargo the config name `feature` is expected, it's just that for now there aren't any values for it. See [Cargo `check_cfg_args` function](https://github.com/rust-lang/cargo/blob/92395d90106b3b61bcb68bcf2069052c93771764/src/cargo/core/compiler/mod.rs#L1263-L1281) for more details. ### De-specializing *empty* `values()` To solve this issue I propose that we "de-specialize" empty `values()` to no longer mean `values(none())` but to actually mean empty set/list. This is one of the last source of confusion for my-self and others with the `--check-cfg` syntax. > The confusing part here is that an empty `values()` currently means the same as `values(none())`, i.e. an expected list of values with the _none_ variant (as in `#[cfg(name)]` where the value is none) instead of meaning an empty set. Before the new `cfg()` syntax, defining the _none_ variant was only possible under certain circumstances, so in https://github.com/rust-lang/rust/pull/111068 I decided to make `values()` to mean the _none_ variant, but it is no longer necessary since https://github.com/rust-lang/rust/pull/119473 which introduced the `none()` syntax. A simplified representation of the proposed "de-specialization" would be: | Syntax | List/set of expected values | |-----------------------------------------|-----------------------------| | `cfg(name)`/`cfg(name, values(none()))` | `&[None]` | | `cfg(name, values())` | `&[]` | Note that I have my-self made the mistake of using an empty `values()` as meaning empty set, see https://github.com/rust-lang/cargo/pull/13011. `@rustbot` label +F-check-cfg r? `@petrochenkov` cc `@epage`
2024-01-17tests: add sanity-check assembly test for every targetDavid Wood-0/+2
Adds a basic assembly test checking that each target can produce assembly and update the target tier policy to require this. Signed-off-by: David Wood <david@davidtw.co>
2024-01-16Add unstable `-Z direct-access-external-data` cmdline flag for `rustc`WANG Rui-0/+16
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/707
2024-01-16Remove outdated references to `-Z dump-mir-spanview`Zalathar-26/+3
This flag was removed by <https://github.com/rust-lang/rust/pull/119566>.
2024-01-15update old bootstrap docsonur-ozkan-7/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-15Update booksrustbot-0/+0
2024-01-14Add guidelines for backport-accepted PRsLeón Orell Valerian Liehr-0/+13
2024-01-14Mention label has-merge-commitsLeón Orell Valerian Liehr-3/+7
2024-01-13Add doc and example for building a UEFI driverNicholas Bishop-0/+17
2024-01-13Add crate links to unknown-uefi.mdNicholas Bishop-5/+10
2024-01-13Add way to express no-values with check-cfgUrgau-12/+13
2024-01-13Auto merge of #119473 - Urgau:check-cfg-explicit-none, r=petrochenkovbors-1/+5
Add explicit `none()` value variant in check-cfg This PR adds an explicit none value variant in check-cfg values: `values(none())`. Currently the only way to define the none variant is with an empty `values()` which means that if someone has a cfg that takes none and strings they need to use two invocations: `--check-cfg=cfg(foo) --check-cfg=cfg(foo, values("bar"))`. Which would now be `--check-cfg=cfg(foo, values(none(),"bar"))`, this is simpler and easier to understand. `--check-cfg=cfg(foo)`, `--check-cfg=cfg(foo, values())` and `--check-cfg=cfg(foo, values(none()))` would be equivalent. *Another motivation for doing this is to make empty `values()` actually means no-values, but this is orthogonal to this PR and adding `none()` is sufficient in it-self.* `@rustbot` label +F-check-cfg r? `@petrochenkov`
2024-01-12Correct the link to rust referenceArthur Milchior-1/+1
The current link provides a link to two versions of the book, both redirecting to the "current version", which is the link this PR uses
2024-01-12Rename `--env` option flag to `--env-set`Guillaume Gomez-7/+7
2024-01-11Rollup merge of #115046 - joshtriplett:master, r=compiler-errorsMatthias Krüger-11/+104
Use version-sorting for all sorting Add a description of a version-sorting algorithm. (This algorithm does not precisely match `strverscmp`; it's intentionally simpler in its handling of leading zeroes, and produces a result easier for humans to easily understand and do by hand.) Change all references to sorting to use version-sorting. Change all references to "ASCIIbetically" to instead say "sort non-lowercase before lowercase".
2024-01-09Add explicit none() value variant in check-cfgUrgau-1/+5
2024-01-09Rollup merge of #118680 - djkoloski:shell_argfiles, r=compiler-errorsGuillaume Gomez-0/+11
Add support for shell argfiles Closes https://github.com/rust-lang/compiler-team/issues/684
2024-01-09Rollup merge of #119282 - Urgau:check-cfg-rework-unstable-doc, r=JohnTitorGuillaume Gomez-101/+123
Rework and improve the unstable documentation of check-cfg This PR rework and improve the unstable documentation of the check-cfg feature. The goal is to have a simpler to understand documentation with examples that are more practical and less theoretical. As well as making the documentation more explicit about the whereabouts of the feature. `@rustbot` label +T-compiler +F-check-cfg
2024-01-09Rework and improve unstable documentation of check-cfgUrgau-101/+123
2024-01-08Add support for shell argfilesDavid Koloski-0/+11
2024-01-08Add riscv32imafc-esp-espidf target for the ESP32-P4.Scott Mabin-0/+2
2024-01-07Explain the important concepts of exhaustiveness checkingNadrieril-8/+138
2024-01-06Add guide for rustdoc search implementation (#1846)Michael Howell-0/+245
2024-01-06Rollup merge of #118781 - RalfJung:core-panic-feature, r=the8472Matthias Krüger-5/+0
merge core_panic feature into panic_internals I don't know why those are two separate features, but it does not seem intentional. This merge is useful because with https://github.com/rust-lang/rust/pull/118123, panic_internals is recognized as an internal feature, but core_panic is not -- but core_panic definitely should be internal.
2024-01-06Rollup merge of #118194 - notriddle:notriddle/tuple-unit, r=GuillaumeGomezMatthias Krüger-11/+36
rustdoc: search for tuples and unit by type with `()` This feature extends rustdoc to support the syntax that most users will naturally attempt to use to search for tuples. Part of https://github.com/rust-lang/rust/issues/60485 Function signature searches already support tuples and unit. The explicit name `primitive:tuple` and `primitive:unit` can be used to match a tuple or unit, while `()` will match either one. It also follows the direction set by the actual language for parens as a group, so `(u8,)` will only match a tuple, while `(u8)` will match a plain, unwrapped byte—thanks to loose search semantics, it will also match the tuple. ## Preview * [`option<t>, option<u> -> (t, u)`](<https://notriddle.com/rustdoc-html-demo-5/tuple-unit/std/index.html?search=option%3Ct%3E%2C option%3Cu%3E -%3E (t%2C u)>) * [`[t] -> (t,)`](<https://notriddle.com/rustdoc-html-demo-5/tuple-unit/std/index.html?search=[t] -%3E (t%2C)>) * [`(ipaddr,) -> socketaddr`](<https://notriddle.com/rustdoc-html-demo-5/tuple-unit/std/index.html?search=(ipaddr%2C) -%3E socketaddr>) ## Motivation When type-based search was first landed, it was directly [described as incomplete][a comment]. [a comment]: https://github.com/rust-lang/rust/pull/23289#issuecomment-79437386 Filling out the missing functionality is going to mean adding support for more of Rust's [type expression] syntax, such as tuples (in this PR), references, raw pointers, function pointers, and closures. [type expression]: https://doc.rust-lang.org/reference/types.html#type-expressions There does seem to be demand for this sort of thing, such as [this Discord message](https://discord.com/channels/442252698964721669/443150878111694848/1042145740065099796) expressing regret at rustdoc not supporting tuples in search queries. ## Reference description (from the Rustdoc book) <table> <thead> <tr> <th>Shorthand</th> <th>Explicit names</th> </tr> </thead> <tbody> <tr><td colspan="2">Before this PR</td></tr> <tr> <td><code>[]</code></td> <td><code>primitive:slice</code> and/or <code>primitive:array</code></td> </tr> <tr> <td><code>[T]</code></td> <td><code>primitive:slice&lt;T&gt;</code> and/or <code>primitive:array&lt;T&gt;</code></td> </tr> <tr> <td><code>!</code></td> <td><code>primitive:never</code></td> </tr> <tr><td colspan="2">After this PR</td></tr> <tr> <td><code>()</code></td> <td><code>primitive:unit</code> and/or <code>primitive:tuple</code></td> </tr> <tr> <td><code>(T)</code></td> <td><code>T</code></td> </tr> <tr> <td><code>(T,)</code></td> <td><code>primitive:tuple&lt;T&gt;</code></td> </tr> </tbody> </table> A single type expression wrapped in parens is the same as that type expression, since parens act as the grouping operator. If they're empty, though, they will match both `unit` and `tuple`, and if there's more than one type (or a trailing or leading comma) it is the same as `primitive:tuple<...>`. However, since items can be left out of the query, `(T)` will still return results for types that match tuples, even though it also matches the type on its own. That is, `(u32)` matches `(u32,)` for the exact same reason that it also matches `Result<u32, Error>`. ## Future direction The [type expression grammar](https://doc.rust-lang.org/reference/types.html#type-expressions) from the Reference is given below: <pre><code>Syntax Type : TypeNoBounds | <a href="https://doc.rust-lang.org/reference/types/impl-trait.html">ImplTraitType</a> | <a href="https://doc.rust-lang.org/reference/types/trait-object.html">TraitObjectType</a> <br> TypeNoBounds : <a href="https://doc.rust-lang.org/reference/types.html#parenthesized-types">ParenthesizedType</a> | <a href="https://doc.rust-lang.org/reference/types/impl-trait.html">ImplTraitTypeOneBound</a> | <a href="https://doc.rust-lang.org/reference/types/trait-object.html">TraitObjectTypeOneBound</a> | <a href="https://doc.rust-lang.org/reference/paths.html#paths-in-types">TypePath</a> | <a href="https://doc.rust-lang.org/reference/types/tuple.html#tuple-types">TupleType</a> | <a href="https://doc.rust-lang.org/reference/types/never.html">NeverType</a> | <a href="https://doc.rust-lang.org/reference/types/pointer.html#raw-pointers-const-and-mut">RawPointerType</a> | <a href="https://doc.rust-lang.org/reference/types/pointer.html#shared-references-">ReferenceType</a> | <a href="https://doc.rust-lang.org/reference/types/array.html">ArrayType</a> | <a href="https://doc.rust-lang.org/reference/types/slice.html">SliceType</a> | <a href="https://doc.rust-lang.org/reference/types/inferred.html">InferredType</a> | <a href="https://doc.rust-lang.org/reference/paths.html#qualified-paths">QualifiedPathInType</a> | <a href="https://doc.rust-lang.org/reference/types/function-pointer.html">BareFunctionType</a> | <a href="https://doc.rust-lang.org/reference/macros.html#macro-invocation">MacroInvocation</a> </code></pre> ImplTraitType and TraitObjectType (and ImplTraitTypeOneBound and TraitObjectTypeOneBound) are not yet implemented. They would mostly desugar to `trait:`, similarly to how `!` desugars to `primitive:never`. ParenthesizedType and TuplePath are added in this PR. TypePath is already implemented (except const generics, which is not planned, and function-like trait syntax, which is planned as part of closure support). NeverType is already implemented. RawPointerType and ReferenceType require parsing and fixes to the search index to store this information, but otherwise their behavior seems simple enough. Just like tuples and slices, `&T` would be equivalent to `primitive:reference<T>`, `&mut T` would be equivalent to `primitive:reference<keyword:mut, T>`, `*T` would be equivalent to `primitive:pointer<T>`, `*mut T` would be equivalent to `primitive:pointer<keyword:mut, T>`, and `*const T` would be equivalent to `primitive:pointer<keyword:const, T>`. Lifetime generics support is not planned, because lifetime subtyping seems too complicated. ArrayType is subsumed by SliceType right now. Implementing const generics is not planned, because it seems like it would require a lot of implementation complexity for not much gain. InferredType isn't really covered right now. Its semantics in a search context are not obvious. QualifiedPathInType is not implemented, and it is not planned. I would need a use case to justify it, and act as a guide for what the exact semantics should be. BareFunctionType is not implemented. Along with function-like trait syntax, which is formally considered a TypePath, it's the biggest missing feature to be able to do structured searches over generic APIs like `Option`. MacroInvocation is not parsed (macro names are, but they don't mean the same thing here at all). Those are gone by the time Rustdoc sees the source code.
2024-01-05Rollup merge of #119588 - Nemo157:i586-netbsd-tier-3, r=NilstriebMichael Goulet-1/+1
Move `i586-unknown-netbsd` from tier 2 to tier 3 platform support table It appears it was intended to be tier 3, but was accidentally added to tier 2. Based on inspecting the PR adding it the table https://github.com/rust-lang/rust/pull/117170 and the fact that it is not built in CI which is one of the tier 2 requirements. cc ````@he32```` r? ````@Nilstrieb````
2024-01-04Fix broken markdown in csky-unknown-linux-gnuabiv2.mdMatt Brubeck-0/+1
2024-01-04Move `i586-unknown-netbsd` from tier 2 to tier 3 platform support tableWim Looman-1/+1
It appears it was intended to be tier 3, but was accidentally added to tier 2.
2024-01-04Rollup merge of #119431 - taiki-e:asm-s390x-reg-addr, r=AmanieuMatthias Krüger-2/+3
Support reg_addr register class in s390x inline assembly In s390x, `r0` cannot be used as an address register (it is evaluated as zero in an address context). Therefore, currently, in assemblies involving memory accesses, `r0` must be [marked as clobbered](https://github.com/taiki-e/atomic-maybe-uninit/blob/1a1155653a26667396c805954ab61c8cbb14de8c/src/arch/s390x.rs#L58) or [explicitly used to a non-address](https://github.com/taiki-e/atomic-maybe-uninit/blob/1a1155653a26667396c805954ab61c8cbb14de8c/src/arch/s390x.rs#L135) or explicitly use an address register to prevent `r0` from being allocated to a register for the address. This patch adds a register class for allocating general-purpose registers, except `r0`, to make it easier to use address registers. (powerpc already has a register class (reg_nonzero) for a similar purpose.) This is identical to the `a` constraint in LLVM and GCC: https://llvm.org/docs/LangRef.html#supported-constraint-code-list > a: A 32, 64, or 128-bit integer address register (excludes R0, which in an address context evaluates as zero). https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html > a > Address register (general purpose register except r0) cc ``@uweigand`` r? ``@Amanieu``
2024-01-04Rollup merge of #118704 - esp-rs:rv32-tier-2, r=davidtwcoMatthias Krüger-6/+6
Promote `riscv32{im|imafc}` targets to tier 2 Pending the approval of [the MCP](https://github.com/rust-lang/compiler-team/issues/701).
2024-01-03Support reg_addr register class in s390x inline assemblyTaiki Endo-2/+3
2024-01-01Update booksrustbot-0/+0
2023-12-30Prominently mention `profiler = true` on the coverage pageZalathar-0/+30
Enabling the profiler runtime is an essential part of being able to properly work on the coverage instrumentation code. There's already a mention of it on this page, but it's made in passing and is easy to miss. This patch adds a much more prominent section containing recommended `config.toml` settings, including `profiler = true`.
2023-12-29Add a description of `unpretty=hir` to the HIR docs (#1842)kim / Motoyuki Kimura-0/+8
2023-12-29Fix typo in unsize docs (#1843)Michael Goulet-4/+5
2023-12-26Add a few more docsMichael Howell-34/+14
2023-12-26rustdoc: search for tuples and unit by type with `()`Michael Howell-11/+56
2023-12-26Auto merge of #119129 - jyn514:verbose, r=compiler-errors,estebankbors-1/+1
rework `-Zverbose` implements the changes described in https://github.com/rust-lang/compiler-team/issues/706 the first commit is only a name change from `-Zverbose` to `-Zverbose-internals` and does not change behavior. the second commit changes diagnostics. possible follow up work: - `ty::pretty` could print more info with `--verbose` than it does currently. `-Z verbose-internals` shows too much info in a way that's not helpful to users. michael had ideas about this i didn't fully understand: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/uplift.20some.20-Zverbose.20calls.20and.20rename.20to.E2.80.A6.20compiler-team.23706/near/408984200 - `--verbose` should imply `-Z write-long-types-to-disk=no`. the code in `ty_string_with_limit` should take `--verbose` into account (apparently this affects `Ty::sort_string`, i'm not familiar with this code). writing a file to disk should suggest passing `--verbose`. r? `@compiler-errors` cc `@estebank`
2023-12-23Rollup merge of #112936 - Toasterson:illumos-aarch64-target, r=jackh726Matthias Krüger-0/+1
Add illumos aarch64 target for rust. This adds the newly being developed illumos aarch64 target to the rust compiler. `@rmustacc` `@citrus-it` `@richlowe` As promissed before my hiatus :)
2023-12-23Rollup merge of #119245 - GuillaumeGomez:improve-docs, r=fmeaseMatthias Krüger-0/+16
Improve documentation for using warning blocks in documentation From [this comment](https://github.com/rust-lang/rust/issues/79710#issuecomment-1868225357), I think markdown can be surprising sometimes so better explain a bit better how to use it correctly. r? `@notriddle`
2023-12-23Improve documentation for using warning blocks in documentationGuillaume Gomez-0/+16
2023-12-22style-guide: Rework version-sorting algorithmJosh Triplett-22/+69
Treat numeric chunks with equal value but differing numbers of leading zeroes as equal, unless we get to the end of the entire string in which case we use "more leading zeroes in the earliest differing chunk" as a tiebreaker. Treat `_` as a word separator, sorting it before anything other than space. Give more examples.
2023-12-22fix missed typoTakashi Idobe-1/+1
2023-12-22fix some typos found scrolling through the docsTakashi Idobe-4/+4
2023-12-21Add support for hexagon-unknown-none-elf as targetBrian Cain-0/+268
Signed-off-by: Brian Cain <bcain@quicinc.com>
2023-12-20Rollup merge of #119115 - GuillaumeGomez:env-docs, r=NilstriebGuillaume Gomez-1/+20
Update documentation for `--env` compilation flag Part of https://github.com/rust-lang/rust/issues/80792. As mentioned in https://github.com/rust-lang/rust/pull/118830. It adds a mention to `tracked_env::var` and also clarifies what triggers a new compilation. r? `@Nilstrieb`