about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-0/+29
position.
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-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-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-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-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-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-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-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 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-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-11Update booksEric Huss-0/+0
2021-05-11Add initial asm!() support for PowerPCDr. Chat-1/+11
This includes GPRs and FPRs only
2021-05-09remove const_fn feature gateRalf Jung-10/+0
2021-05-07Rollup merge of #84815 - richkadel:coverage-docs-update-2021-05, r=tmandryYuki Okushi-324/+378
Update coverage docs and command line help r? `@tmandry` cc: `@wesleywiser`
2021-05-06Renamed compiler-flags file to name of compiler-flag: instrument-coverageRich Kadel-344/+349
And redirect users from the old file name.
2021-05-06Update coverage docs and command line helpRich Kadel-75/+124
2021-05-05Implement RFC 2951: Native link modifiersLuqman Aden-0/+86
This commit implements both the native linking modifiers infrastructure as well as an initial attempt at the individual modifiers from the RFC. It also introduces a feature flag for the general syntax along with individual feature flags for each modifier.
2021-05-03platform-support: Center the contents of the `std` and `host` columnsJosh Triplett-2/+2
2021-05-03Link to MCP from target tier policyJan-Erik Rediger-4/+6
2021-05-01Auto merge of #84658 - Amanieu:reserved_regs, r=petrochenkovbors-12/+12
Be stricter about rejecting LLVM reserved registers in asm! LLVM will silently produce incorrect code if these registers are used as operands. cc `@rust-lang/wg-inline-asm`
2021-05-01Reserve x18 on AArch64 and un-reserve x16Amanieu d'Antras-3/+2
2021-05-01Rollup merge of #84774 - kraai:fix-misspelling, r=jyn514Yuki Okushi-1/+1
Fix misspelling Fix a misspelling of "or" in the source_code_based_coverage section of *The Rust Unstable Book*.
2021-05-01Rollup merge of #84756 - badboy:toc-for-tier-policy, r=GuillaumeGomezYuki Okushi-0/+11
Add a ToC to the Target Tier Policy documentation The policy document is quite lengthy, I figured it might be good to have a quick way to jump to the specific tier policies.
2021-05-01Rollup merge of #84704 - joshtriplett:platform-support-target-tier-policy, ↵Yuki Okushi-131/+174
r=pietroalbini platform-support.md: Update for consistency with Target Tier Policy Split into five sections to match the tiers: "Tier 1 with Host Tools", "Tier 1", "Tier 2 with Host Tools", "Tier 2", and "Tier 3". Explain each tier briefly in prose, and link to the corresponding section of the policy for full requirements. Drop the `host` columns from the first four, since the different sections distinguish that. (Keep the `host` column for "Tier 3", since it's a single list and the `host` column just indicates if host tools are expected to work.) Targets with host tools always have full support for std, so drop the `std` column from those. Move the explanations of the `std` column next to the appropriate tables, and drop the unknown/WIP case for tier 2 targets. Use "target" terminology consistently throughout. Sort each table by target name.
2021-04-30Fix misspellingMatthew James Kraai-1/+1
2021-04-30Add a ToC to the Target Tier Policy documentationJan-Erik Rediger-0/+11
2021-04-29platform-support.md: Update for consistency with Target Tier PolicyJosh Triplett-131/+174
Split into five sections to match the tiers: "Tier 1 with Host Tools", "Tier 1", "Tier 2 with Host Tools", "Tier 2", and "Tier 3". Explain each tier briefly in prose, and link to the corresponding section of the policy for full requirements. Drop the `host` columns from the first four, since the different sections distinguish that. (Keep the `host` column for "Tier 3", since it's a single list and the `host` column just indicates if host tools are expected to work.) Targets with host tools always have full support for std, so drop the `std` column from those. Move the explanations of the `std` column next to the appropriate tables, and drop the unknown/WIP case for tier 2 targets. Use "target" terminology consistently throughout. Sort each table by target name.
2021-04-28Update booksEric Huss-0/+0
2021-04-28Be stricter about rejecting LLVM reserved registers in asm!Amanieu d'Antras-12/+13