about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2019-08-06redox: convert to target_family unixJeremy Soller-5/+0
2019-08-06update to rustc-guide that passes toolstateMark Mansi-0/+0
2019-07-31Replace AstBuilder with inherent methodsMark Rousskov-8/+0
2019-07-30Auto merge of #62766 - alexcrichton:stabilize-pipelined-compilation, r=oli-obkbors-0/+33
rustc: Stabilize options for pipelined compilation This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-29Rollup merge of #63077 - petrochenkov:nolangfeat, r=petrochenkovMazdak Farrokhzad-0/+0
cleanup: Remove some language features related to built-in macros They are now library features. Cleanup after https://github.com/rust-lang/rust/pull/62086. The unstable book files are moved because tidy complained.
2019-07-28cleanup: Remove some language features related to built-in macrosVadim Petrochenkov-0/+0
They are now library features.
2019-07-28Update unstable book wrt. subslice patterns.Mazdak Farrokhzad-1/+1
2019-07-27Remove run-pass test suitesVadim Petrochenkov-1/+1
2019-07-26rustc: Stabilize options for pipelined compilationAlex Crichton-0/+33
This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-25Rollup merge of #60938 - jonas-schievink:doc-include-paths, r=petrochenkovMazdak Farrokhzad-3/+2
rustdoc: make #[doc(include)] relative to the containing file This matches the behavior of other in-source paths like `#[path]` and the `include_X!` macros. Fixes https://github.com/rust-lang/rust/pull/58373#issuecomment-462349380 Also addresses https://github.com/rust-lang/rust/issues/44732#issuecomment-467660239 cc #44732 This is still missing a stdsimd change (https://github.com/jonas-schievink/stdsimd/commit/42ed30e0b5fb5e2d11765b5d1e1f36234af85984), so CI will currently fail. I'll land that change once I get initial feedback for this PR.
2019-07-23Normalize use of backticks in compiler messages for docSamy Kacimi-22/+22
https://github.com/rust-lang/rust/issues/60532
2019-07-23Adjust docs to new #[doc(include)] behaviourJonas Schievink-3/+2
2019-07-18Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddybbors-0/+11
rustc/rustc_mir: Implement RFC 2203. This PR implements RFC 2203, allowing constants in array repeat expressions. Part of #49147. r? @eddyb
2019-07-17Update mdbook, cargo, booksEric Huss-13/+13
This updates the last of the books using mdbook 0.1, finally removing it from the build.
2019-07-14Add newlineCaio-1/+1
2019-07-14Chapter for param_attrsCaio-0/+27
2019-07-11hygiene: Fix wording of desugaring descriptionsVadim Petrochenkov-1/+2
Use variant names rather than descriptions for identifying desugarings in `#[rustc_on_unimplemented]`. Both are highly unstable, but variant name is at least a single identifier.
2019-07-09Rollup merge of #60458 - KodrAus:debug_map_entry, r=alexcrichtonMazdak Farrokhzad-0/+9
Add key and value methods to DebugMap Implementation PR for an active (not approved) RFC: https://github.com/rust-lang/rfcs/pull/2696. Add two new methods to `std::fmt::DebugMap` for writing the key and value part of a map entry separately: ```rust impl<'a, 'b: 'a> DebugMap<'a, 'b> { pub fn key(&mut self, key: &dyn Debug) -> &mut Self; pub fn value(&mut self, value: &dyn Debug) -> &mut Self; } ``` I want to do this so that I can write a `serde::Serializer` that forwards to our format builders, so that any `T: Serialize` can also be treated like a `T: Debug`.
2019-07-08add key and value methods to DebugMapAshley Mannix-0/+9
2019-07-07syntax: Add feature gate.David Wood-0/+11
This commit adds a `const_in_array_repeat_expressions` feature gate and only create `Candidate::Repeat` if it is enabled.
2019-07-06rustdoc: set cfg(doctest) when collecting doctestsQuietMisdreavus-0/+30
2019-07-06Update rustc-guideYuki Okushi-0/+0
2019-07-03Rollup merge of #62255 - Centril:slice-patterns-change-issue, r=varkorMark Rousskov-2/+2
Switch tracking issue for `#![feature(slice_patterns)]` Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs. Closes https://github.com/rust-lang/rust/issues/23121. r? @varkor
2019-07-03Auto merge of #61775 - ↵bors-0/+29
nikomatsakis:issue-56238-multiple-lifetimes-async-fn-region-solver, r=MatthewJasper generalize impl trait to permit multiple lifetime bounds Generalizes the region solver to support "pick constraints". These have the form: ``` pick R0 from [R1..Rn] ``` where `R1..Rn` are called the "option regions". The idea is that `R0` must be equal to *some* region in the set `R1..Rn`. These constraints are then used to handle cases like this: ```rust fn foo<'a, 'b>(...) -> impl Trait<'a, 'b> { .. } ``` The problem here is that every region R in the hidden type must be equal to *either* `'a` *or* `'b` (or `'static`) -- in the past, the only kinds of constraints we had were outlives constraints, and since `'a` and `'b` are unrelated, there was no outlives constraint we could issue that would enforce that (`R: 'a` and `R: 'b` are both too strict, for example). But now we can issue a pick constraint: `pick R from ['a, 'b]`. In general, solving pick constraints is tricky. We integrate them into the solver as follows. In general, during the propagation phase, we are monotonically growing a set of inference regions. To handle a case like `pick R from [O...]`, where `O...` represents the option regions, we do the following: - Look for all the *lower bounds* of the region R -- that is, every region LB such that `R: LB` must hold. - Look for all the *upper bounds* of the region R -- that is, every region UB such that `UB: R` must hold. - Let the *viable options* be each option region O such that `UB: O` and `O: LB` for each UB, LB bound. - Find the *minimal viable option* M, where `O: M` holds for every option region O. If there is such a *minimal viable option*, then we make `R: M`. (This may in turn influence other bits of inference.) If there is no minimal viable option, either because all options were eliminated or because none of the remaining options are minimal, we do nothing. Ultimately, if the pick constraint is not satisfied, an error is reported. For this logic, we currently require that the option regions O are always lifetime parameters. To determine the bounds, we walk the various outlives edges that were otherwise introduced. r? @matthewjasper cc @cramertj Fixes #56238 TODO: - [ ] Error messages include region variable info sometimes, how to fix? - [ ] Tests for bare `existential type` and other impl Trait usage
2019-07-02Auto merge of #61268 - michaelwoerister:stabilize-pgo, r=alexcrichtonbors-0/+154
Stabilize support for Profile-guided Optimization This PR makes profile-guided optimization available via the `-C profile-generate` / `-C profile-use` pair of commandline flags and adds end-user documentation for the feature to the [rustc book](https://doc.rust-lang.org/rustc/). The PR thus ticks the last two remaining checkboxes of the [stabilization tracking issue](https://github.com/rust-lang/rust/issues/59913). From the tracking issue: > Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a program's typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion. If you are curious about how this can be used, there is a rendered version of the documentation this PR adds available [here]( https://github.com/michaelwoerister/rust/blob/stabilize-pgo/src/doc/rustc/src/profile-guided-optimization.md). r? @alexcrichton cc @rust-lang/compiler
2019-07-02Update src/doc/unstable-book/src/language-features/member-constraints.mdNiko Matsakis-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-02feature-gate member constraints outside of async-awaitNiko Matsakis-0/+29
Minimizes risk.
2019-07-01Revert "implicit `Option`-returning doctests"Guillaume Gomez-13/+0
This reverts commit 6bb6c001be34d0932a014df981ee18f165c43374.
2019-07-01Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, ↵bors-36/+0
r=petrochenkov Stabilize `type_alias_enum_variants` in Rust 1.37.0 Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write: ```rust enum Option<T> { None, Some(T), } type OptAlias<T> = Option<T>; fn work_on_alias(x: Option<u8>) -> u8 { match x { OptAlias::Some(y) => y + 1, OptAlias::None => 0, } } ``` Closes https://github.com/rust-lang/rfcs/issues/2218 Closes https://github.com/rust-lang/rust/issues/52118 r? @petrochenkov
2019-06-30Switch tracking issue for 'slice_patterns'.Mazdak Farrokhzad-2/+2
2019-06-27Rollup merge of #62156 - ehuss:update-books, r=ehussMazdak Farrokhzad-0/+0
Update books Update nomicon, reference, book, rust-by-example, rustc-guide ## nomicon 2 commits in c656171b749b7307f21371dd0d3278efee5573b8..341c221116a8b9f1010cf1eece952b80c5ec7f54 2019-04-25 15:31:26 -0400 to 2019-06-19 09:08:47 -0700 - Fix some links. - cleanup the intro, and clarify how it relates to the reference (rust-lang-nursery/nomicon#140) ## reference 2 commits in 08ae27a4921ca53967656a7391c82f6c0ddd1ccc..7a5aab5fd50d6290679beb4cf42fa5f46ed22aec 2019-06-17 11:24:13 -0700 to 2019-06-20 17:38:52 +0200 - Update for cfg on generic parameter. (rust-lang-nursery/reference#624) - Link to "const functions" section from constant expressions list (rust-lang-nursery/reference#623) ## book 2 commits in 9aacfcc4c5b102c8cda195932addefd32fe955d2..6c0d83499c8e77e06a71d28c5e1adccec278d4f3 2019-06-16 21:27:26 -0400 to 2019-06-23 20:25:30 -0400 - fancy quotes - Edits made in copyedit ## rust-by-example 2 commits in b27472962986e85c94f4183b1a6d2207660d3ed6..62b3ff2cb44dd8b648c3ef2a9347c3706d148014 2019-06-17 15:52:07 -0300 to 2019-06-24 09:17:21 -0300 - A couple of fixes for the `Box, stack and heap` chapter. (rust-lang/rust-by-example#1206) - [typo] Note, that it is -&gt; Note that, it is (rust-lang/rust-by-example#1207) ## rustc-guide 38 commits in f55e97c145cf37fd664db2e0e2f2d05df328bf4f..abf512fc9cc969dcbea69aa15b44586bbeb13c2d 2019-06-15 17:29:12 -0500 to 2019-06-26 11:05:58 -0500 - fix long line - add `point` to the glossary and link a use of it - fix indentation - Update src/borrow_check/region_inference/placeholders_and_universes.md - Update src/borrow_check/region_inference/placeholders_and_universes.md - Update src/borrow_check/region_inference/placeholders_and_universes.md - Update src/borrow_check/region_inference/member_constraints.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/member_constraints.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/member_constraints.md - Update src/borrow_check/region_inference/member_constraints.md - Update src/borrow_check/region_inference/lifetime_parameters.md - Update src/borrow_check/region_inference/member_constraints.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/constraint_propagation.md - Update src/borrow_check/region_inference/lifetime_parameters.md - Update src/borrow_check/region_inference/lifetime_parameters.md - Update src/borrow_check/region_inference/lifetime_parameters.md - Update src/borrow_check/region_inference/constraint_propagation.md - adjust overview slightly - describe region inference and member constraints in some detail - start filling out the constraint propagation chapter in more detail - break out parts of the region inference chapter into sub-chapters - fix typo - avoid ftp links - fix broken links - add bibligraphy appendix - Update to mdbook-linkcheck 0.3.0 - Update mdbook - Change stage0 cfg_attr to bootstrap - fix compiler-team - Added Rustc Debugger Support Chapter
2019-06-27Rollup merge of #62043 - Centril:remove-fnbox, r=cramertjMazdak Farrokhzad-35/+1
Remove `FnBox` Remove `FnBox` since we now have `Box<dyn FnOnce>`. Closes https://github.com/rust-lang/rust/issues/28796. r? @cramertj
2019-06-26Update booksEric Huss-0/+0
2019-06-25Auto merge of #60732 - jswrenn:arbitrary_enum_discriminant, r=pnkfelixbors-0/+37
Implement arbitrary_enum_discriminant Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).
2019-06-22Remove FnBox.Mazdak Farrokhzad-35/+1
2019-06-22Rollup merge of #61267 - michaelwoerister:update-xlto-table, r=alexcrichtonMazdak Farrokhzad-2/+3
rustc-book: Update the rustc/clang compatibility table for xLTO. Firefox is using these combinations successfully.
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-0/+37
2019-06-21rustc-book: Add documentation on how to use PGO.Michael Woerister-0/+154
2019-06-20Update mdbookEric Huss-0/+0
2019-06-19Closures implement Copy and Clone, generators don'tJake Goulding-1/+1
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-1/+1
2019-06-15type_alias_enum_variants: Remove from unstable book.Mazdak Farrokhzad-36/+0
2019-06-12Rollup merge of #61734 - mati865:books, r=alexcrichtonMazdak Farrokhzad-0/+0
Migrate rust-by-example to MdBook2
2019-06-11Migrate rust-by-example to MdBook2Mateusz Mikuła-0/+0
2019-06-10Implement RFC 2645 (transparent enums and unions)Michael Bradshaw-0/+176
Tracking issue: #60405
2019-06-09Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisabors-42/+0
Stabilize #![feature(repr_align_enum)] in Rust 1.37.0 On an `enum` item, you may now write: ```rust #[repr(align(X))] enum Foo { // ... } ``` This has equivalent effects to first defining: ```rust #[repr(align(X))] struct AlignX<T>(T); ``` and then using `AlignX<Foo>` in `Foo`'s stead. r? @nagisa
2019-06-08Auto merge of #61672 - Centril:rollup-jxo89ir, r=Centrilbors-6/+4
Rollup of 6 pull requests Successful merges: - #61646 (Remove useless allocations in macro_rules follow logic.) - #61658 (remove useless ident() functions in const tests) - #61660 (Minimize use of `#![feature(custom_attribute)]`) - #61666 (Add test for trait ICE) - #61669 ( syntax: Remove `Deref` impl from `Token`) - #61670 (Update RLS) Failed merges: r? @ghost
2019-06-08Remove some more `#![feature(custom_attribute)]`sVadim Petrochenkov-6/+4
2019-06-08Auto merge of #61529 - ehuss:update-books, r=GuillaumeGomezbors-0/+0
Update books ## reference 2 commits in 862b669c395822bb0938781d74f860e5762ad4fb..f8ae436d936f6f4891d3c1bbb1af5865eb8aeadb 2019-05-04 23:41:35 -0700 to 2019-05-31 14:59:12 +0200 - Document that literals with any suffixes are valid as tokens (rust-lang-nursery/reference#612) - Fix example code of derive macro (rust-lang-nursery/reference#611) ## book 2 commits in 29fe982990e43b9367be0ff47abc82fb2123fd03..62a8c6f25fbd981c80a046f3b04be9684749af3b 2019-05-15 17:48:40 -0400 to 2019-05-28 15:48:23 -0400 - Remove snapshots checked in layout - Remove snapshots that I've approved in layout ## rust-by-example 5 commits in 811c697b232c611ed754d279ed20643a0c4096f6..18566f4dedc3ef5bf61f5f85685d5966db99cc11 2019-04-28 18:56:42 -0300 to 2019-05-30 19:23:24 -0300 - Fixed wording in the `Seconds` struct description. (rust-lang/rust-by-example#1195) - Fix usage of the word "elision" (rust-lang/rust-by-example#1191) - Reword "Flow Control" to "Flow of Control" (rust-lang/rust-by-example#1190) - Copy edits to chapter 1 (rust-lang/rust-by-example#1189) - Fix typo in a mod/visibility.md (rust-lang/rust-by-example#1188) ## rustc-guide 9 commits in 3cb727b62b953d59b4360d39aa68b6dc8f157655..3ac9cfc9c9ab2e366feebf18718112737f572352 2019-05-07 09:53:32 -0500 to 2019-06-02 19:36:58 -0500 - Update information about debuginfo configuration - fix long line - Fixed misspelling - Add more info subsection with links to forge and rustc api docs (rust-lang/rustc-guide#324) - Renamed the file and title of the diagnostics chapter. - Added rustc phases diagram and explanation - Mention running tests for subdirectories - Fixed links broken by merging chalks rules and solve - Add documentation about profile-guided optimization. ## embedded-book 1 commits in 9858872bd1b7dbba5ec27dc30d34eba00acd7ef9..f0c75b75f9c18537b78f5d17c1015247e9a49c86 2019-05-02 18:56:54 +0000 to 2019-06-03 10:49:02 +0000 - Qemu md changes (rust-embedded/book#193)
2019-06-06Some code cleanup and tidy/test fixesVadim Petrochenkov-3/+3