about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2019-11-08update rustc-guideMark Mansi-0/+0
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-104/+27
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-07Remove docs on --extern metadata precedence.Eric Huss-3/+2
2019-11-07Update extern linking documentation.Eric Huss-7/+27
2019-11-07Stabilize --extern flag without a path.Eric Huss-1/+6
2019-11-06rename cfg(rustdoc) into cfg(doc)Guillaume Gomez-6/+6
2019-11-06patterns_in_fns_without_body -> denyMazdak Farrokhzad-40/+40
2019-11-06parenthesized_params_in_types_and_modules -> errorMazdak Farrokhzad-25/+0
2019-11-06safe_extern_static -> errorMazdak Farrokhzad-5/+0
2019-11-06legacy_directory_ownership -> errorMazdak Farrokhzad-12/+0
2019-11-06legacy_ctor_visibility -> errorMazdak Farrokhzad-35/+0
2019-11-06gate rustc_on_unimplemented under rustc_attrsMazdak Farrokhzad-154/+0
2019-11-05Rollup merge of #65136 - ehuss:update-codegen-options, r=Dylan-DPCPietro Albini-68/+254
Update codegen option documentation. Some documentation updates: - Add more detail to codegen options. - Add missing options: - `force-frame-pointers` - `default-linker-libraries` - `linker-plugin-lto` - Add fragment anchors for all command-line-arguments. - Add some cross links between options.
2019-11-03Make Emscripten unwinding use a valid type_infoAmanieu d'Antras-1/+2
This allows catch_panic to ignore C++ exceptions.
2019-11-03Allow foreign exceptions to unwind through Rust codeAmanieu d'Antras-2/+1
2019-11-03Attempt to clarify LTO and codegen-units.Eric Huss-10/+21
2019-10-31Stabilize the `re_rebalance_coherence` featureOhad Ravid-23/+0
2019-10-31Auto merge of #63803 - GuillaumeGomez:stabilize-doctest, ↵bors-30/+46
r=ollie27,QuietMisdreavus,Mark-Simulacrum [rustdoc] stabilize cfg(doctest) Fixes #62210. Since we removed rustdoc from providing cfg(test) on test runs, it's been replaced by cfg(doctest). It'd be nice to have it in not too far in the future.
2019-10-29Update cargo, books.Eric Huss-0/+0
2019-10-29Update since version for doctest featureGuillaume Gomez-1/+1
2019-10-29improve documentation of rustdoc doctest featureGuillaume Gomez-7/+22
2019-10-29stabilize cfg(doctest)Guillaume Gomez-30/+31
2019-10-26Be more specific with -C inline-threshold.Eric Huss-6/+14
2019-10-26Apply suggestions from kinnisonEric Huss-5/+5
Co-Authored-By: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-26Update codegen option documentation.Eric Huss-68/+235
2019-10-25RFC 2008: StabilizationDavid Wood-76/+0
This commit stabilizes RFC 2008 (#44109) by removing the feature gate. Signed-off-by: David Wood <david@davidtw.co>
2019-10-22Target-feature documented as unsafe. rustc book and rustc -C help have been ↵togiberlin-1/+23
modified.
2019-10-21Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJungMazdak Farrokhzad-24/+0
Change untagged_unions to not allow union fields with drop This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass. Change untagged_unions to not allow union fields with drop Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar). The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature. Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-18Auto merge of #64925 - ehuss:document-json, r=Mark-Simulacrumbors-1/+240
Document JSON message output. This documents the JSON messages in the rustc book.
2019-10-16Auto merge of #65445 - ehuss:update-cargo-books, r=alexcrichtonbors-0/+0
Update cargo, books ## nomicon 3 commits in 4374786f0b4bf0606b35d5c30a9681f342e5707b..5004ad30d69f93553ceef74439fea2159d1f769e 2019-09-17 18:33:21 +0200 to 2019-10-12 19:52:40 +0200 - further clarify C11 and C/C++11 terminology (rust-lang-nursery/nomicon#169) - atomics: C11 -&gt; C++20 (rust-lang-nursery/nomicon#168) - use sound/unsound terminology ## cargo 12 commits in a429e8cc4614a46a86322a0777a477e2baa83f1c..3a9abe3f065554a7fbc59f440df2baba4a6e47ee 2019-10-04 17:36:12 +0000 to 2019-10-15 15:55:35 +0000 - Fix typo in git index initialization error path (rust-lang/cargo#7512) - Reject feature flags in a virtual workspace. (rust-lang/cargo#7507) - Rename `overrides` to `package` in profiles. (rust-lang/cargo#7504) - Allow publishing with dev-dependencies without a version. (rust-lang/cargo#7333) - Stabilize cache-messages (rust-lang/cargo#7450) - don't lock the package cache when cleaning target dir. (rust-lang/cargo#7502) - Document rustc wrapper (rust-lang/cargo#7499) - Migrate towards exclusively using serde for `Config` (rust-lang/cargo#7456) - Re-enable some MSVC tests. (rust-lang/cargo#7492) - when -Z unstable-options not specified, don't validate --profile (rust-lang/cargo#7489) - Improve error message for cyclic dependencies (rust-lang/cargo#7470) - Some minor clippy fixes. (rust-lang/cargo#7484) ## book 7 commits in 04806c80be0f54b1290287e3f85e84bdfc0b6ec7..9bb8b161963fcebc9d9ccd732ba26f42108016d5 2019-10-01 20:20:22 -0400 to 2019-10-14 18:42:55 -0500 - Make a portion of text less ambiguous (rust-lang/book#2092) - fix heading level (rust-lang/book#2117) - Add missing "of" before `"duck typing"`. (rust-lang/book#1951) - ch18-03: no need to debug print destructured int (rust-lang/book#1991) - Subtle fix to introduce ? on Option in Chapter 9.2 (rust-lang/book#2047) - make wording clearer (rust-lang/book#1976) - Update the version of rand we use ## rust-by-example 5 commits in a6288e7407a6c4c19ea29de6d43f40c803883f21..0b111eaae36cc4b4997684be853882a59e2c7ca7 2019-10-01 10:09:14 -0300 to 2019-10-14 18:34:25 -0300 - Some fix to three files (rust-lang/rust-by-example#1280) - Add reference to Generics (rust-lang/rust-by-example#1281) - Confusing and long sentence (rust-lang/rust-by-example#1282) - Explicit mention of slice range meaning (rust-lang/rust-by-example#1277) - Updated aliasing for nll (rust-lang/rust-by-example#1276)
2019-10-16Update cargo, booksEric Huss-0/+0
2019-10-14Add troubleshooting section to PGO chapter in rustc book.Michael Woerister-0/+11
2019-10-13Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomezMazdak Farrokhzad-0/+25
Document missing deny by default lints
2019-10-12Auto merge of #64873 - popzxc:prettify-test-time, r=wesleywiserbors-0/+80
Enhance report-time option ## Short overview This PR is a follow-up to a previously closed #64714 PR. ## Changes introduced by this PR * `libtest` now retrieves the type of the test within `TestDesc` (available types are: `UnitTest`, `IntegrationTest`, `DocTest`, `Unknown`). * `--report-time` subcommand of the `libtest` now supports colored output (disabled by default). * Colorized output depends on the threshold values. Default values (proposed by @wesleywiser): - For unit-tests: 50ms warn/100ms critical, - For integration-tests: 500ms warn/1000ms critical, - For doctests: same as for integration tests, - For unknown tests: `TEST_WARN_TIMEOUT_S` warn/ `TEST_WARN_TIMEOUT_S * 2` critical (it will only applied single-threaded mode, because otherwise test will be interrupted after reaching `TEST_WARN_TIMEOUT_S`). - These values can be overrided by setting environment variables (since those thresholds are somewhat constant for every project, it's more flexible to use environment variables than command line arguments). * New optional flag `--ensure-test-time` for `libtest`. With this flag applied, exectuion time limit excesss will cause test failure. ## What have not been done There was a comment that it would be nice to have an entry in the Cargo book about it. However, changes introduced by this PR (and #64663 in which `report-time` flag was added) aren't related directly to `cargo`, it's more about `libtest` itself. I'm considering that [The Unstable Book](https://doc.rust-lang.org/unstable-book/) is more appropriate place, but not sure if I'm right (and if so, how exactly it should be described). As one possible option, this PR may be merged without denoting it in the documentation, and in the next PR adding support of this feature to the `cargo` itself, I'll add a note in the Cargo book. ## Scope of this PR Logical scope of this PR is `libtest` only. However, to get test types, I had to modify also `libsyntax_ext` and `librustdoc` for them to provide information about test type. ## Rationale Rationale for colored output was submitted in #64714 Providing the information about kind of test was also proposed in #64714, and as an additional benefit this information may be useful for the tools using `libtest` (e.g. `cargo`). Adding flag to treat time limits excess seems logical to me, so projects that do care about test execution time won't have to invent a wheel. ## Backward compatibility All the changes are completely backward compatible. ## Demo ![rustc_enhanced_time](https://user-images.githubusercontent.com/12111581/65818381-c04f6800-e219-11e9-9875-322463abe24f.gif) r? @wesleywiser
2019-10-11Remove unions_with_drop_fields lintSimon Sapin-24/+0
Cases where it would trigger are now hard errors.
2019-10-09Move unstable book entry into compiler flags directoryIgor Aleksanov-0/+0
2019-10-09Add an entry to the unstable bookIgor Aleksanov-0/+80
2019-10-07[RFC 2091] Add #[track_caller] attribute.Ayose-0/+5
- The attribute is behind a feature gate. - Error if both #[naked] and #[track_caller] are applied to the same function. - Error if #[track_caller] is applied to a non-function item. - Error if ABI is not "rust" - Error if #[track_caller] is applied to a trait function. Error codes and descriptions are pending.
2019-10-06Update referenceTyler Mandry-0/+0
- 771c5d10cf944bf7d221f5d6cb7abd2a06c400e4 Add macros in extern blocks and new proc-macro support. - 8caabd62ef5fbe99e6be6aa9e76f55bbb8433d95 Update for "modern" `meta` matcher. - 1b44947d36ccf7eba2b3bd245769eff68abf6d4d Update await desugaring after rust-lang/rust#64292
2019-10-03Document current deny by default lintsAndreas Molzer-0/+25
2019-10-02rustc book: nitpick SLP vectorizationRobin Kruppe-1/+1
SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
2019-10-01Update booksEric Huss-0/+0
2019-09-30Document JSON message output.Eric Huss-1/+240
2019-09-30Remove legacy grammarErin Power-809/+4
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-18Update booksEric Huss-0/+0
2019-09-17update Nomicon and ReferenceRalf Jung-0/+0
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