about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2019-10-01Update booksEric Huss-0/+0
2019-10-01Update feature gating docs to fit reality (#455)Mazdak Farrokhzad-5/+14
2019-10-01issues/issue-12345.rs is an anti-pattern (#456)Mazdak Farrokhzad-6/+7
2019-09-30Document JSON message output.Eric Huss-1/+240
2019-09-30Prefer https in GitHub pages urls (#454)lzutao-14/+14
2019-09-30Remove legacy grammarErin Power-809/+4
2019-09-25file has since been removed from content (#453)Tshepang Lekhonkhobe-1/+0
Should of been part of 2ef961e45465a5edfbd3d5c49e4a16cee356b44b
2019-09-21Rollup merge of #64010 - c410-f3r:stabilize-attrs-fn, r=CentrilMazdak Farrokhzad-27/+0
Stabilize `param_attrs` in Rust 1.39.0 # Stabilization proposal I propose that we stabilize `#![feature(param_attrs)]`. Tracking issue: #60406 Version: 1.39 (2019-09-26 => beta, 2019-11-07 => stable). ## What is stabilized It is now possible to add outer attributes like `#[cfg(..)]` on formal parameters of functions, closures, and function pointer types. For example: ```rust fn len( #[cfg(windows)] slice: &[u16], #[cfg(not(windows))] slice: &[u8], ) -> usize { slice.len() } ``` ## What isn't stabilized * Documentation comments like `/// Doc` on parameters. * Code expansion of a user-defined `#[proc_macro_attribute]` macro used on parameters. * Built-in attributes other than `cfg`, `cfg_attr`, `allow`, `warn`, `deny`, and `forbid`. Currently, only the lints `unused_variables` and `unused_mut` have effect and may be controlled on parameters. ## Motivation The chief motivations for stabilizing `param_attrs` include: * Finer conditional compilation with `#[cfg(..)]` and linting control of variables. * Richer macro DSLs created by users. * External tools and compiler internals can take advantage of the additional information that the parameters provide. For more examples, see the [RFC][rfc motivation]. ## Reference guide In the grammar of function and function pointer, the grammar of variadic tails (`...`) and parameters are changed respectively from: ```rust FnParam = { pat:Pat ":" }? ty:Type; VaradicTail = "..."; ``` into: ```rust FnParam = OuterAttr* { pat:Pat ":" }? ty:Type; VaradicTail = OuterAttr* "..."; ``` The grammar of a closure parameter is changed from: ```rust ClosureParam = pat:Pat { ":" ty:Type }?; ``` into: ```rust ClosureParam = OuterAttr* pat:Pat { ":" ty:Type }?; ``` More generally, where there's a list of formal (value) parameters separated or terminated by `,` and delimited by `(` and `)`. Each parameter in that list may optionally be prefixed by `OuterAttr+`. Note that in all cases, `OuterAttr*` applies to the whole parameter and not just the pattern. This distinction matters in pretty printing and in turn for macros. ## History * On 2018-10-15, @Robbepop proposes [RFC 2565][rfc], "Attributes in formal function parameter position". * On 2019-04-30, [RFC 2565][rfc] is merged and the tracking issue is made. * On 2019-06-12, a partial implementation was completed. The implementation was done in [#60669][60669] by @c410-f3r and the PR was reviewed by @petrochenkov and @Centril. * On 2019-07-29, [#61238][61238] was fixed in [#61856][61856]. The issue fixed was that lint attributes on function args had no effect. The PR was written by @c410-f3r and reviewed by @matthewjasper, @petrochenkov, and @oli-obk. * On 2019-08-02, a bug [#63210][63210] was filed wherein the attributes on formal parameters would not be passed to macros. The issue was about forgetting to call the relevant method in `fn print_arg` in the pretty printer. In [#63212][63212], written by @Centril on 2019-08-02 and reviewed by @davidtwco, the issue aforementioned was fixed. * This PR stabilizes `param_attrs`. ## Tests * [On Rust 2018, attributes aren't permitted on function parameters without a pattern in trait definitions.](https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.rs) * [All attributes that should be allowed. This includes `cfg`, `cfg_attr`, and lints check attributes.](https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2565-param-attrs/param-attrs-allowed.rs) * [Built-in attributes, which should be forbidden, e.g., `#[test]`, are.](https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs) * [`cfg` and `cfg_attr` are properly evaluated.](https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.rs) * [`unused_mut`](https://github.com/rust-lang/rust/blob/46f405ec4d7c6bf16fc2eaafe7541019f1da2996/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.rs) and [`unused_variables`](https://github.com/rust-lang/rust/blob/master/src/test/ui/lint/lint-unused-variables.rs) are correctly applied to parameter patterns. * [Pretty printing takes formal parameter attributes into account.](https://github.com/rust-lang/rust/blob/master/src/test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs) ## Possible future work * Custom attributes inside function parameters aren't currently supported but it is something being worked on internally. * Since documentation comments are syntactic sugar for `#[doc(...)]`, it is possible to allow literal `/// Foo` comments on function parameters. [rfc motivation]: https://github.com/rust-lang/rfcs/blob/master/text/2565-formal-function-parameter-attributes.md#motivation [rfc]: https://github.com/rust-lang/rfcs/pull/2565 [60669]: https://github.com/rust-lang/rust/pull/60669 [61856]: https://github.com/rust-lang/rust/pull/61856 [63210]: https://github.com/rust-lang/rust/issues/63210 [61238]: https://github.com/rust-lang/rust/issues/61238 [63212]: https://github.com/rust-lang/rust/pull/63212 This report is a collaborative work with @Centril.
2019-09-20Update the "Updating LLVM" documentation (#451)Alex Crichton-27/+63
Make sure existing sections are up-to-date and then also add some words about the recent convention we developed for updating LLVM versions with respect to branch naming as well.
2019-09-19Add guidance for making a PR fixes toolstateYuki Okushi-1/+11
2019-09-18Update booksEric Huss-0/+0
2019-09-18add some instructions to fix toolstate (#446)Who? Me?!-0/+28
2019-09-17update Nomicon and ReferenceRalf Jung-0/+0
2019-09-16minor typo fixes (#445)Youngsuk Kim-3/+3
* typo fix how to expose the them to any sort of external testing apparatus => how to expose them to any sort of external testing apparatus * typo fix These following image depicts => The following image depicts * typo fix trait itself is found in in => trait itself is found in * Update src/mir/passes.md following JohnTitor's suggestion Co-Authored-By: Yuki Okushi <huyuumi.dev@gmail.com> * Update src/test-implementation.md Also following JohnTitor's suggestion Co-Authored-By: Yuki Okushi <huyuumi.dev@gmail.com>
2019-09-16typo fix (#444)Youngsuk Kim-1/+1
that would get compile to => that would get compiled to
2019-09-11Stabilize `param_attrs` in Rust 1.39.0Caio-27/+0
2019-09-10Auto merge of #60387 - Goirad:test-expansion, r=ollie27bors-0/+50
Allow cross-compiling doctests This PR allows doctest to receive a --runtool argument, as well as possibly many --runtool-arg arguments, which are then used to run cross compiled doctests. Also, functionality has been added to rustdoc to allow it to skip testing doctests on a per-target basis, in the same way that compiletest does it. For example, tagging the doctest with "ignore-sgx" disables testing on any targets that contain "sgx". A plain "ignore" still skips testing on all targets. See [here](https://github.com/rust-lang/cargo/pull/6892) for the companion PR in the cargo project that extends functionality in Cargo so that it passes the appropriate parameters to rustdoc when cross compiling and testing doctests. Part of [#6460](https://github.com/rust-lang/cargo/issues/6460)
2019-09-09update referenceRalf Jung-0/+0
2019-09-08update guidemark-0/+0
2019-09-08update rustc-guideMark Mansi-0/+0
2019-09-08typo (#441)Tshepang Lekhonkhobe-1/+1
2019-09-05hack + drive-by-fixMark Mansi-3/+12
2019-09-05Made sure travis caches mdbook-linkcheck's cache fileMichael Bryan-0/+2
2019-09-05Updated the mdbook-linkcheck versionMichael Bryan-1/+1
2019-09-05fix broken linkMark Mansi-4/+4
2019-09-05Fix a link in the query docs.Edd Barrett-3/+3
2019-09-05Rollup merge of #64041 - matklad:token-stream-tt, r=petrochenkovMazdak Farrokhzad-3/+3
use TokenStream rather than &[TokenTree] for built-in macros That way, we don't loose the jointness info
2019-09-05Rollup merge of #64092 - michaelwoerister:update-xlto-table-rustc-book-1.37, ↵Mazdak Farrokhzad-0/+1
r=alexcrichton Update xLTO compatibility table in rustc book. This is a combination known to work reliable when building Firefox on all the major platforms. r? @alexcrichton
2019-09-04Update cargo, booksEric Huss-0/+0
2019-09-03added rustdoc book documentation, improved behavior when unstable flag not ↵Dario Gonzalez-0/+50
present
2019-09-03use TokenStream rather than &[TokenTree] for built-in macrosAleksey Kladov-3/+3
That way, we don't loose the jointness info
2019-09-02Update xLTO compatibility table in rustc book.Michael Woerister-0/+1
2019-09-01remove the unstable rustdoc parameter --linkerAndreas Jonson-13/+0
use the code generation parameter -Clinker (same parameter as rustc) to control what linker to use for building the rustdoc test executables. closes: #63816
2019-08-29Update section on "existential type" to "opaque type"varkor-48/+62
2019-08-27merge libtest build step with libstd (#434)Tshepang Lekhonkhobe-22/+9
Partially handles #431
2019-08-27immutable was meant here (#435)Tshepang Lekhonkhobe-1/+1
2019-08-26'or' skippedTshepang Lekhonkhobe-1/+1
2019-08-25mention stable-in-unstable issueRalf Jung-0/+7
2019-08-25Improve "Profiling the compiler" docsWesley Wiser-6/+13
Add mentions and links to `rustc-perf` and `measureme`.
2019-08-24minor fixesmark-2/+5
2019-08-24Update stability.mdOliver Scherer-0/+3
2019-08-24Update stability.mdOliver Scherer-0/+4
2019-08-24Apply suggestions from code reviewOliver Scherer-4/+4
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-08-24Update src/stability.mdOliver Scherer-1/+1
Co-Authored-By: Jake Goulding <shepmaster@mac.com>
2019-08-24Explain our stability attributesOliver Scherer-0/+36
2019-08-24remove flaky linkmark-3/+1
2019-08-22Update single-use-lifetimesNaja Melan-1/+1
When using this, rustc emits a warning that the lint has been renamed (to having an 's' at the end)
2019-08-22Auto merge of #63175 - jsgf:argsfile, r=jsgfbors-0/+7
rustc: implement argsfiles for command line Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line. This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`. See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters. This is useful for very large command lines, or when command lines are being generated into files by other tooling.
2019-08-21Auto merge of #63705 - mark-i-m:fix-guide-1, r=ehussbors-0/+0
Update rustc-guide Should fix toolstate failure r? @ehuss
2019-08-21update rustc-guideMark Mansi-0/+0