about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-06-13Add suggested settings note for coc (#1144)Jade-0/+5
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-0/+29
position.
2021-06-09move 7/8 to proseGus Wynn-4/+5
2021-06-09Add a section on keeping things up to date in the git sectionGus Wynn-7/+47
2021-06-08Update booksEric Huss-0/+0
2021-06-08Rollup merge of #85951 - hyd-dev:force-unwind-tables, r=steveklabnikYuki Okushi-2/+1
Update the documentation of `-C force-unwind-tables` for #83482 `panic=unwind` does not require `force-unwind-tables` to be "yes" anymore. I forgot to update this in #83482.
2021-06-06Auto merge of #79608 - alessandrod:bpf, r=nagisabors-0/+10
BPF target support This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker. I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
2021-06-05Auto merge of #85457 - jyn514:remove-doc-include, r=GuillaumeGomezbors-59/+1
Remove `doc(include)` This nightly feature is redundant now that `extended_key_value_attributes` is stable (https://github.com/rust-lang/rust/pull/83366). `@rust-lang/rustdoc` not sure if you think this needs FCP; there was already an FCP in #82539, but technically it was for deprecating, not removing the feature altogether. This should not be merged before #83366. cc `@petrochenkov`
2021-06-04Auto merge of #85788 - rylev:force-warns, r=nikomatsakisbors-0/+21
Support for force-warns Implements https://github.com/rust-lang/rust/issues/85512. This PR adds a new command line option `force-warns` which will force the provided lints to warn even if they are allowed by some other mechanism such as `#![allow(warnings)]`. Some remaining issues: * https://github.com/rust-lang/rust/issues/85512 mentions that `force-warns` should also be capable of taking lint groups instead of individual lints. This is not implemented. * If a lint has a higher warning level than `warn`, this will cause that lint to warn instead. We probably want to allow the lint to error if it is set to a higher lint and is not allowed somewhere else. * One test is currently ignored because it's not working - when a deny-by-default lint is allowed, it does not currently warn under `force-warns`. I'm not sure why, but I wanted to get this in before the weekend. r? `@nikomatsakis`
2021-06-04Remove `doc(include)`Joshua Nelson-59/+1
2021-06-04Fix some links (#1137)Yuki Okushi-9/+9
* Fix some links * Address review comment
2021-06-03Satisfy unstable book lintJubilee Young-2/+5
2021-06-03Add run-make test testing flag stabilityRyan Levick-1/+1
2021-06-03Update the documentation of `-C force-unwind-tables`hyd-dev-2/+1
2021-06-02Add a page on force-warns in unstable bookRyan Levick-0/+21
2021-05-30Rollup merge of #85781 - badboy:document-aarch-ios-sim-support, r=AmanieuGuillaume Gomez-1/+58
Add documentation for aarch64-apple-ios-sim target Documentation as requested for [MCP 428](https://github.com/rust-lang/compiler-team/issues/428) to promote this target to Tier 2. Currently it calls out that it's Tier 3. That should be changed if this target is promoted, but this PR could also land before that. Note: probably should get signoff from the compiler team based on that MCP.
2021-05-30explain Miri engine vs Miri-the-toolRalf Jung-1/+6
2021-05-29Add documentation for aarch64-apple-ios-sim targetJan-Erik Rediger-1/+58
2021-05-29BPF: misc minor review fixesAlessandro Decina-3/+3
2021-05-28Fix typo on nvptx supportEric Huss-1/+1
2021-05-28Add more information about no_hash query modifier. (#1133)Michael Woerister-0/+20
2021-05-26improve section introductionRalf Jung-13/+10
2021-05-26not all tools require waiting for a nightly release before they can be fixedRalf Jung-6/+10
2021-05-26stabilize member constraintsNiko Matsakis-29/+0
2021-05-26Rollup merge of #85699 - ehuss:update-books, r=ehussYuki Okushi-0/+0
Update books ## reference 4 commits in 5aa457bf1b54bd2cd5d4cf49797f29299bdf89a7..9c68af3ce6ccca2395e1868addef26a0542e9ddd 2021-05-05 08:39:22 -0700 to 2021-05-24 09:53:32 -0700 - missing parameter name in Trait Implementations (rust-lang-nursery/reference#1030) - Add more content to impl-trait.md (rust-lang-nursery/reference#1017) - Document extended key-value attributes (rust-lang-nursery/reference#1029) - Document raw pointer <-> usize casts. (rust-lang-nursery/reference#970) ## rust-by-example 1 commits in 5f8c6da200ada77760a2fe1096938ef58151c9a6..805e016c5792ad2adabb66e348233067d5ea9f10 2021-04-29 08:08:01 -0300 to 2021-05-20 17:08:34 -0300 - Update structs.md (rust-lang/rust-by-example#1440) ## rustc-dev-guide 4 commits in 1e6c7fbda4c45e85adf63ff3f82fa9c870b1447f..50de7f0682adc5d95ce858fe6318d19b4b951553 2021-05-10 13:38:24 +0900 to 2021-05-20 15:02:20 +0200 - update rustfmt references to reflect change from submod to subtree (rust-lang/rustc-dev-guide#1129) - Remove `--stage 1` argument from `doc` invocations (rust-lang/rustc-dev-guide#1125) - Update coverage docs (rust-lang/rustc-dev-guide#1122) - Document -Zunpretty=thir-tree (rust-lang/rustc-dev-guide#1128) ## edition-guide 1 commits in 1da3c411f17adb1ba5de1683bb6acee83362b54a..302a115e8f71876dfc884aebb0ca5ccb02b8a962 2021-02-16 16:46:40 -0800 to 2021-05-21 10:46:11 -0400 - Minimize the edition guide (rust-lang/edition-guide#232) ## embedded-book 1 commits in 569c3391f5c0cc43433bc77831d17f8ff4d76602..7349d173fa28a0bb834cf0264a05286620ef0923 2021-04-07 08:32:11 +0000 to 2021-05-25 13:59:05 +0000 - Remove $ from cargo-binutils (rust-embedded/book#292)
2021-05-25Describe the difference of rustc_lint vs rustc_lint_defs.Eric Huss-1/+5
2021-05-25Update booksEric Huss-0/+0
2021-05-25Fix tasklist example in rustdoc book.Eric Huss-6/+4
2021-05-23Add BPF target to platform-support.mdAlessandro Decina-0/+2
2021-05-23Add support for BPF inline assemblyAlessandro Decina-0/+6
2021-05-23Add BPF targetAlessandro Decina-0/+2
This change adds the bpfel-unknown-none and bpfeb-unknown-none targets which can be used to generate little endian and big endian BPF
2021-05-20update rustfmt references to reflect change from submod to subtree (#1129)Caleb Cartwright-18/+17
* update rustfmt references to reflect change to subtree * clarify broken toolstate hypothetical scenario
2021-05-18Rollup merge of #83366 - jyn514:stabilize-key-value-attrs, r=petrochenkovJack Huey-0/+12
Stabilize extended_key_value_attributes Closes https://github.com/rust-lang/rust/issues/44732. Closes https://github.com/rust-lang/rust/issues/78835. Closes https://github.com/rust-lang/rust/issues/82768 (by making it irrelevant). # Stabilization report ## Summary This stabilizes using macro expansion in key-value attributes, like so: ```rust #[doc = include_str!("my_doc.md")] struct S; #[path = concat!(env!("OUT_DIR"), "/generated.rs")] mod m; ``` See Petrochenkov's excellent blog post [on internals](https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455) for alternatives that were considered and rejected ("why accept no more and no less?") This has been available on nightly since 1.50 with no major issues. ## Notes ### Accepted syntax The parser accepts arbitrary Rust expressions in this position, but any expression other than a macro invocation will ultimately lead to an error because it is not expected by the built-in expression forms (e.g., `#[doc]`). Note that decorators and the like may be able to observe other expression forms. ### Expansion ordering Expansion of macro expressions in "inert" attributes occurs after decorators have executed, analogously to macro expressions appearing in the function body or other parts of decorator input. There is currently no way for decorators to accept macros in key-value position if macro expansion must be performed before the decorator executes (if the macro can simply be copied into the output for later expansion, that can work). ## Test cases - https://github.com/rust-lang/rust/blob/master/src/test/ui/attributes/key-value-expansion-on-mac.rs - https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/external-doc.rs The feature has also been dogfooded extensively in the compiler and standard library: - https://github.com/rust-lang/rust/pull/83329 - https://github.com/rust-lang/rust/pull/83230 - https://github.com/rust-lang/rust/pull/82641 - https://github.com/rust-lang/rust/pull/80534 ## Implementation history - Initial proposal: https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412 - Experiment to see how much code it would break: https://github.com/rust-lang/rust/pull/67121 - Preliminary work to restrict expansion that would conflict with this feature: https://github.com/rust-lang/rust/pull/77271 - Initial implementation: https://github.com/rust-lang/rust/pull/78837 - Fix for an ICE: https://github.com/rust-lang/rust/pull/80563 ## Unresolved Questions ~~https://github.com/rust-lang/rust/pull/83366#issuecomment-805180738 listed some concerns, but they have been resolved as of this final report.~~ ## Additional Information There are two workarounds that have a similar effect for `#[doc]` attributes on nightly. One is to emulate this behavior by using a limited version of this feature that was stabilized for historical reasons: ```rust macro_rules! forward_inner_docs { ($e:expr => $i:item) => { #[doc = $e] $i }; } forward_inner_docs!(include_str!("lib.rs") => struct S {}); ``` This also works for other attributes (like `#[path = concat!(...)]`). The other is to use `doc(include)`: ```rust #![feature(external_doc)] #[doc(include = "lib.rs")] struct S {} ``` The first works, but is non-trivial for people to discover, and difficult to read and maintain. The second is a strange special-case for a particular use of the macro. This generalizes it to work for any use case, not just including files. I plan to remove `doc(include)` when this is stabilized (https://github.com/rust-lang/rust/pull/82539). The `forward_inner_docs` workaround will still compile without warnings, but I expect it to be used less once it's no longer necessary.
2021-05-18Remove `--stage 1` argument from `doc` invocations (#1125)Justus K-2/+2
2021-05-18Stabilize extended_key_value_attributesJoshua Nelson-0/+12
# Stabilization report ## Summary This stabilizes using macro expansion in key-value attributes, like so: ```rust #[doc = include_str!("my_doc.md")] struct S; #[path = concat!(env!("OUT_DIR"), "/generated.rs")] mod m; ``` See the changes to the reference for details on what macros are allowed; see Petrochenkov's excellent blog post [on internals](https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455) for alternatives that were considered and rejected ("why accept no more and no less?") This has been available on nightly since 1.50 with no major issues. ## Notes ### Accepted syntax The parser accepts arbitrary Rust expressions in this position, but any expression other than a macro invocation will ultimately lead to an error because it is not expected by the built-in expression forms (e.g., `#[doc]`). Note that decorators and the like may be able to observe other expression forms. ### Expansion ordering Expansion of macro expressions in "inert" attributes occurs after decorators have executed, analogously to macro expressions appearing in the function body or other parts of decorator input. There is currently no way for decorators to accept macros in key-value position if macro expansion must be performed before the decorator executes (if the macro can simply be copied into the output for later expansion, that can work). ## Test cases - https://github.com/rust-lang/rust/blob/master/src/test/ui/attributes/key-value-expansion-on-mac.rs - https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/external-doc.rs The feature has also been dogfooded extensively in the compiler and standard library: - https://github.com/rust-lang/rust/pull/83329 - https://github.com/rust-lang/rust/pull/83230 - https://github.com/rust-lang/rust/pull/82641 - https://github.com/rust-lang/rust/pull/80534 ## Implementation history - Initial proposal: https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412 - Experiment to see how much code it would break: https://github.com/rust-lang/rust/pull/67121 - Preliminary work to restrict expansion that would conflict with this feature: https://github.com/rust-lang/rust/pull/77271 - Initial implementation: https://github.com/rust-lang/rust/pull/78837 - Fix for an ICE: https://github.com/rust-lang/rust/pull/80563 ## Unresolved Questions ~~https://github.com/rust-lang/rust/pull/83366#issuecomment-805180738 listed some concerns, but they have been resolved as of this final report.~~ ## Additional Information There are two workarounds that have a similar effect for `#[doc]` attributes on nightly. One is to emulate this behavior by using a limited version of this feature that was stabilized for historical reasons: ```rust macro_rules! forward_inner_docs { ($e:expr => $i:item) => { #[doc = $e] $i }; } forward_inner_docs!(include_str!("lib.rs") => struct S {}); ``` This also works for other attributes (like `#[path = concat!(...)]`). The other is to use `doc(include)`: ```rust #![feature(external_doc)] #[doc(include = "lib.rs")] struct S {} ``` The first works, but is non-trivial for people to discover, and difficult to read and maintain. The second is a strange special-case for a particular use of the macro. This generalizes it to work for any use case, not just including files. I plan to remove `doc(include)` when this is stabilized. The `forward_inner_docs` workaround will still compile without warnings, but I expect it to be used less once it's no longer necessary.
2021-05-17Address review commentsJoshua Nelson-13/+20
- Simplify boolean expression - Give an example of invalid syntax - Remove explanation of why code block is text
2021-05-17Rename INVALID_RUST_CODEBLOCK{,S}Joshua Nelson-2/+2
2021-05-17Add back missing help for ignore blocksJoshua Nelson-1/+1
This also gives a better error message when a span is missing.
2021-05-17New rustdoc lint to respect -Dwarnings correctlyAlexis Bourget-0/+37
This adds a new lint to `rustc` that is used in rustdoc when a code block is empty or cannot be parsed as valid Rust code. Previously this was unconditionally a warning. As such some documentation comments were (unknowingly) abusing this to pass despite the `-Dwarnings` used when compiling `rustc`, this should not be the case anymore.
2021-05-16Fixed item typo which did not need prefixSpencer Imbleau-1/+1
2021-05-16Noted necessessity and fixed rustdoc:: prefixSpencer Imbleau-4/+4
Now shows that certain warnings are unnecessary but includes them for consistency.
2021-05-14Remove support for floating-point constants in asm!Amanieu d'Antras-1/+1
Floating-point constants aren't very useful anyways and this simplifies the code since the type check can now be done in typeck.
2021-05-13Update coverage docs (#1122)Rich Kadel-70/+72
2021-05-13Update global_asm! documentationAmanieu d'Antras-8/+41
2021-05-13Add support for const operands and options to global_asm!Amanieu d'Antras-10/+10
On x86, the default syntax is also switched to Intel to match asm!
2021-05-13Document -Zunpretty=thir-tree (#1128)Smittyvb-0/+3
* document -Zunpretty=thir-tree * Update position/wording
2021-05-13Auto merge of #84732 - DrChat:asm_powerpc, r=Amanieubors-1/+11
Add asm!() support for PowerPC This includes GPRs and FPRs only. Note that this does not include PowerPC64. For my reference, this was mostly duplicated from PR #73214.
2021-05-12Clarified all attributes which prompt warningsSpencer Imbleau-0/+4
All calls which trigger rustdoc warnings and are now properly verbose for consistency. This uses the attribute in the examples which provides the user with more context.
2021-05-12Clarified the attribute which prompts the warningSpencer Imbleau-0/+2
The example call was lacking clarification of the `#![warn(rustdoc::invalid_codeblock_attributes)]` attribute which generates the specified warning.
2021-05-11Update booksEric Huss-0/+0