Commit graph

5020 commits

Author SHA1 Message Date
Eric Huss
965dc6b74b Update books 2019-04-06 10:06:51 -07:00
Masaki Hara
7a63c7f010 Add ignore to doc code 2019-04-05 02:32:30 +08:00
Masaki Hara
440e873a47 Simplify fnbox docs. 2019-04-05 02:32:29 +08:00
Charles Lew
ecc3e89dd0 Stabilize boxed_closure_impls in 1.35.0. 2019-04-05 02:32:21 +08:00
Masaki Hara
4dcd6cc208 Fix failing tests. 2019-04-05 02:27:01 +08:00
Masaki Hara
219097ecf6 Add unstable-book articles on fnbox and boxed_closure_impls. 2019-04-05 02:26:56 +08:00
Mazdak Farrokhzad
4954cae241
Rollup merge of #59685 - lzutao:patch-1, r=GuillaumeGomez
Add description for -Os and -Oz in rustc.1
2019-04-04 15:09:07 +02:00
lzutao
4c9c2cf160
Add description for -Os and -Oz in rustc.1 2019-04-04 12:20:53 +07:00
Christian
7e37b46d20 Updated the environment description in rustc. 2019-04-03 15:50:20 +02:00
mark
abab4af7f9 update rustc-guide submodule 2019-03-31 19:36:00 -05:00
Mazdak Farrokhzad
7da27b261a
Rollup merge of #59569 - gruberb:add-title-for-unstable-book, r=frewsxcv
Add book.toml with title to unstable-book doc

Adding a title to the unstable book based on https://github.com/rust-lang/rust/issues/59554
2019-03-30 23:14:43 +01:00
Mazdak Farrokhzad
8a19973eed
Rollup merge of #59405 - benesch:docs-font, r=GuillaumeGomez
doc: use correct body font URLs

The CSS for the docs homepage (docs.rust-lang.org) was using the wrong
URL for the body font, resulting in the fallback serif font being used,
instead of the desired Source Serif Pro fonts.

(It's worth noting that the CSS for rustdoc's API generation got these URLs right.)
2019-03-30 23:14:40 +01:00
Bastian Gruber
aea5bf55f0 Add book.toml with title to unstable-book doc 2019-03-30 19:46:43 +01:00
Mazdak Farrokhzad
d050a157a8
Rollup merge of #59376 - davidtwco:finally-rfc-2008-variants, r=petrochenkov,QuietMisdreavus
RFC 2008: Enum Variants

Part of #44109. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion.

r? @petrochenkov
cc @nikomatsakis
2019-03-30 07:51:34 +01:00
Mazdak Farrokhzad
972a8ce2a9
Rollup merge of #59366 - ehuss:update-books, r=QuietMisdreavus
Update books

Update reference, book, rust-by-example, edition-guide, embedded-book

## reference

15 commits in 41493ffce5d0e17d54eaf5ec9a995054e2b9aece..27ad493a10364e907ec476e2ad61e8a1614b57e1
2019-03-05 12:32:22 +0100 to 2019-03-26 02:06:15 +0100
- Document wasm_import_module for #[link]. (rust-lang-nursery/reference#554)
- Fix tidy error. (rust-lang-nursery/reference#552)
- Some minor contributing updates. (rust-lang-nursery/reference#551)
- Document `type_length_limit`. (rust-lang-nursery/reference#546)
- Add some terms to the glossary. (rust-lang-nursery/reference#547)
- Document `target_feature` and `cfg_target_feature`. (rust-lang-nursery/reference#545)
- Remove undocumented page (rust-lang-nursery/reference#539)
- Reorg and update attributes (rust-lang-nursery/reference#537)
- Fix some minor link errors. (rust-lang-nursery/reference#538)
- Add linkchecker. (rust-lang-nursery/reference#521)
- Expand docs on Macros By Example. (rust-lang-nursery/reference#511)
- document #[panic_handler] (rust-lang-nursery/reference#362)
- document #[used] (rust-lang-nursery/reference#361)
- Note that UB is program-global (rust-lang-nursery/reference#490)
- Fix copy-paste error in procedural-macros.md (rust-lang-nursery/reference#533)

## book

16 commits in 9cffbeabec3bcec42d09432bfe7705125c848889..b93ec30bbc7b1b5c2f44223249ab359bed2ed5a6
2019-03-02 08:22:41 -0500 to 2019-03-26 16:54:10 -0400
- Unignore example that now compiles
- Fix code snippet (rust-lang/book#1863)
- Fix mdbook link text in readme (rust-lang/book#1881)
- Wrap to 80 cols
- Make sentence more complete (rust-lang/book#1885)
- consistenly use increment and decrement (rust-lang/book#1884)
- Fix link to Reference's conditional-compilation. (rust-lang/book#1878)
- Fix subject/verb agreement
- Remove nostarch snapshot files that have been incorporated and checked
- haha teach the dictionary steve's name
- Add authorship info to the front page
- fix accidental <ol>'s (rust-lang/book#1866)
- Edits to Macros (rust-lang/book#1848)
- Mention `lock` returns `MutexGuard` wrapped in a `LockResult`
- Add an example that illustrates NLL (rust-lang/book#1842)
- change the parameter name from `type` to `kind` (rust-lang/book#1845)

## rust-by-example

33 commits in 2ce92beabb912d417a7314d6da83ac9b50dc2afb..f68ef3d0f4959f6a7d92a08d9994b117f0f4d32d
2018-11-20 10:10:23 -0500 to 2019-03-12 15:32:12 -0300
- Fix some broken links. (rust-lang/rust-by-example#1161)
- Update links in README (rust-lang/rust-by-example#1167)
- Add score/lifetimes/trait.md (rust-lang/rust-by-example#1168)
- Fix rust-lang/rust-by-example#1147 - No more `open_mode` method (rust-lang/rust-by-example#1164)
- Fix for loop description in list print example (rust-lang/rust-by-example#1162)
- Add link to Cargo chapter in the index page (rust-lang/rust-by-example#1159)
- Fix grammar in sentence about integer notation (rust-lang/rust-by-example#1157)
- Do not use deprecated functions from `std::error::Error` trait (rust-lang/rust-by-example#1151)
- Update new_types.md to clarify conversion to base type (rust-lang/rust-by-example#1148)
- Fix compatibility with Rust 2018 (rust-lang/rust-by-example#1150)
- Hello: Fix hint link in `fmt` chapter. (rust-lang/rust-by-example#1146)
- Clarify pub(restricted) example a bit (rust-lang/rust-by-example#1133)
- Add "literal" to list of macro designators (rust-lang/rust-by-example#1153)
- Minor fixes for the macros chapter (rust-lang/rust-by-example#1113)
- Use new book links instead of the old second-edition ones (rust-lang/rust-by-example#1143)
- Recommend implementing Display over ToString (rust-lang/rust-by-example#1145)
- Remove unused import and format with `rustfmt` (rust-lang/rust-by-example#1144)
- fix typo (rust-lang/rust-by-example#1142)
- Update syntax for 2018 Edition (rust-lang/rust-by-example#1136)
- Added two missing full stops (rust-lang/rust-by-example#1138)
- Removed unnecessary spaces before macro designators in macros/dry (rust-lang/rust-by-example#1139)
- fix install mdbook command (rust-lang/rust-by-example#1128)
- Changed word `function` to `type` in comment of fn area (rust-lang/rust-by-example#1132)
- Added two missing backticks in generics/multi_bounds (rust-lang/rust-by-example#1129)
- Fixed small logic error in error/option_unwrap/and_then (rust-lang/rust-by-example#1127)
- Fix typo (rust-lang/rust-by-example#1125)
- The code of conduct link was dead. I fixed it. (rust-lang/rust-by-example#1122)
- I added a space in the Display fmt for Complex (rust-lang/rust-by-example#1123)
- Fix Rust install link in the index (rust-lang/rust-by-example#1124)
- Update cargo conventions section (rust-lang/rust-by-example#1121)
- Fixed curly braces in the `To and from Strings` chapter to be parentheses (rust-lang/rust-by-example#1120)
- Edit a typo (rust-lang/rust-by-example#1119)
- Fixes rust-lang/rust-by-example#1115 by correcting the typo from into_iterator to into_iter (rust-lang/rust-by-example#1118)

## edition-guide

1 commits in aa0022c875907886cae8f3ef8e9ebf6e2a5e728d..b56ddb11548450a6df4edd1ed571b2bc304eb9e6
2019-02-27 22:10:39 -0800 to 2019-03-10 10:23:16 +0100
- Links fixes (rust-lang-nursery/edition-guide#133)

## embedded-book

6 commits in 9e656ead82bfe869493dec82653a52e27fa6a05c..07fd3880ea0874d82b1d9ed30ad3427ec98b4e8a
2019-03-03 16:03:26 +0000 to 2019-03-27 15:40:52 +0000
- Fix test errors.  (rust-embedded/book#180)
- Update qemu.md  (rust-embedded/book#170)
- Update no-std.md to remove obsolete FAQ link  (rust-embedded/book#177)
- We've come a long way :)  (rust-embedded/book#176)
- Correct link to team  (rust-embedded/book#175)
- Update some book links to their new homes.  (rust-embedded/book#173)
2019-03-29 12:32:19 +01:00
David Wood
18938416e4
Update documentation.
This commit updates the unstable book and diagnostics to reflect that
the `#[non_exhaustive]` attribute is now available for enum variants.
2019-03-29 11:03:35 +01:00
Josh Stone
e5fa59735b
Rollup merge of #59268 - estebank:from-string, r=QuietMisdreavus
Add suggestion to use `&*var` when `&str: From<String>` is expected

Fix #53879.
2019-03-27 18:15:24 -07:00
Eric Huss
5113e73e81 Update books 2019-03-27 11:02:55 -07:00
Guillaume Gomez
3747868889
Rollup merge of #59197 - kornelski:redir, r=steveklabnik
Exclude old book redirect stubs from search engines

Adds `<meta name="robots" content="noindex,follow">` to the `<head>` of old stub pages pointing to the second edition of the book.

This is continuation of https://github.com/rust-lang/book/pull/1788
2019-03-26 22:26:40 +01:00
Nikhil Benesch
efac054037
doc: use correct body font URLs
The CSS for the docs homepage (docs.rust-lang.org) was using the wrong
URL for the body font, resulting in the fallback serif font being used,
instead of the desired Source Serif Pro fonts.
2019-03-24 22:06:34 -04:00
Esteban Küber
2f7b32091e extend on-unimplemented docs 2019-03-22 20:38:14 -07:00
Esteban Küber
ac3290e8d9 Add suggestion to use &*var when &str: From<String> is expected 2019-03-22 20:38:14 -07:00
Kornel
fbc4326f4b Track changes to robots.txt 2019-03-15 15:05:12 +00:00
Kornel
8b5a748d50 Exclude old book redirect stubs from search engines 2019-03-14 22:56:38 +00:00
Mazdak Farrokhzad
61e8cc571d
Rollup merge of #58626 - QuietMisdreavus:doc-coverage, r=GuillaumeGomez
rustdoc: add option to calculate "documentation coverage"

This PR adds a new flag to rustdoc, `--show-coverage`. When passed, this flag will make rustdoc count the number of items in a crate with documentation instead of generating docs. This count will be output as a table of each file in the crate, like this (when run on my crate `egg-mode`):

```
+-------------------------------------+------------+------------+------------+
| File                                | Documented |      Total | Percentage |
+-------------------------------------+------------+------------+------------+
| src/auth.rs                         |         16 |         16 |     100.0% |
| src/common/mod.rs                   |          1 |          1 |     100.0% |
| src/common/response.rs              |          9 |          9 |     100.0% |
| src/cursor.rs                       |         24 |         24 |     100.0% |
| src/direct/fun.rs                   |          6 |          6 |     100.0% |
| src/direct/mod.rs                   |         41 |         41 |     100.0% |
| src/entities.rs                     |         50 |         50 |     100.0% |
| src/error.rs                        |         27 |         27 |     100.0% |
| src/lib.rs                          |          1 |          1 |     100.0% |
| src/list/fun.rs                     |         19 |         19 |     100.0% |
| src/list/mod.rs                     |         22 |         22 |     100.0% |
| src/media/mod.rs                    |         27 |         27 |     100.0% |
| src/place/fun.rs                    |          8 |          8 |     100.0% |
| src/place/mod.rs                    |         35 |         35 |     100.0% |
| src/search.rs                       |         26 |         26 |     100.0% |
| src/service.rs                      |         74 |         74 |     100.0% |
| src/stream/mod.rs                   |         49 |         49 |     100.0% |
| src/tweet/fun.rs                    |         15 |         15 |     100.0% |
| src/tweet/mod.rs                    |         73 |         73 |     100.0% |
| src/user/fun.rs                     |         24 |         24 |     100.0% |
| src/user/mod.rs                     |         87 |         87 |     100.0% |
+-------------------------------------+------------+------------+------------+
| Total                               |        634 |        634 |     100.0% |
+-------------------------------------+------------+------------+------------+
```

Trait implementations are not counted because by default they "inherit" the docs from the trait, even though an impl can override those docs. Similarly, inherent impl blocks are not counted at all, because for the majority of cases such docs are not useful. (The usual pattern for inherent impl blocks is to throw all the methods on a type into a single impl block. Any docs you would put on that block would be better served on the type itself.)

In addition, `--show-coverage` can be combined with `--document-private-items` to get the coverage counts for everything in the crate, not just public items.

The coverage calculation is implemented as a late pass and two new sets of passes which strip out most of the work that rustdoc otherwise does when generating docs. The is because after the new pass is executed, rustdoc immediately closes instead of going on to generate documentation.

Many examples of coverage calculations have been included as `rustdoc-ui` tests.

r? @rust-lang/rustdoc
2019-03-09 17:18:13 +01:00
Eric Huss
06090290e2 Update books 2019-03-08 12:25:36 -08:00
bors
f3730f9b87 Auto merge of #58800 - ehuss:update-books, r=Centril
Update edition-guide

15 commits in 419edb885ec1a98c0747b3907003d79e3e6b93a9..5f3cc2a5618700efcde3bc00799744f21fa9ad2e
2018-12-04 16:43:38 -0500 to 2019-02-27 20:11:50 -0800
- Migrate to mdbook 0.2. (rust-lang-nursery/edition-guide#152)
- Remove automatic deployment. (rust-lang-nursery/edition-guide#151)
- Fix issue with rust's linkchecker and mdbook. (rust-lang-nursery/edition-guide#147)
- Fix test now that overflowing_literals is rejected in all editions. (rust-lang-nursery/edition-guide#148)
- overflowing_literals is deny on all editions (rust-lang-nursery/edition-guide#146)
- Update for uniform_path stabilization. (rust-lang-nursery/edition-guide#141)
- Add example to rustup to show overriding to specific version (rust-lang-nursery/edition-guide#144)
- Update for anonymous-lifetime stabilization. (rust-lang-nursery/edition-guide#142)
- Add minimum Rust version for Kleene operator (rust-lang-nursery/edition-guide#137)
- Add 2018-specific changes. (rust-lang-nursery/edition-guide#130)
- aborting-on-panic.md: Typo in example config (rust-lang-nursery/edition-guide#125)
- Clarify uniform paths are not yet in Rust 2018 (rust-lang-nursery/edition-guide#124)
- update several version numbers
- Fixes outdated link (rust-lang-nursery/edition-guide#131)
- Fixed typo in transitioning page. (rust-lang-nursery/edition-guide#127)
2019-03-01 22:12:27 +00:00
QuietMisdreavus
74cf1adfd6 tweak docs for rustdoc's --show-coverage 2019-02-28 16:13:55 -06:00
QuietMisdreavus
80b49191bb update docs for doc coverage 2019-02-28 16:11:21 -06:00
QuietMisdreavus
9e98a25b95 tabs -> spaces 2019-02-28 16:01:27 -06:00
QuietMisdreavus
009c91a294 add option to calculate documentation coverage 2019-02-28 16:01:27 -06:00
Eric Huss
3aca176fb2 Update edition-guide 2019-02-27 21:09:10 -08:00
Dan Robertson
1a6e9e2408
Add c_variadic to the unstable-book
- Add the c_variadic language feature
 - Add the c_variadic library feature
2019-02-27 10:21:45 -05:00
bors
f5b5f924eb Auto merge of #58709 - kornelski:book, r=QuietMisdreavus
Update book submodule

Updates the book to the latest commit

This is to include [documentation SEO fix](https://github.com/rust-lang/book/pull/1788) ASAP.
2019-02-27 07:53:56 +00:00
Kornel
19c302c89a Update book submodule 2019-02-25 13:30:51 +00:00
Mazdak Farrokhzad
554aed6c7d
Rollup merge of #55632 - ollie27:deny_overflowing_literals, r=Centril
Deny the `overflowing_literals` lint for all editions

The `overflowing_literals` was made deny by default for the 2018 edition by #54507, however I'm not aware of any reason it can't be made deny by default for the 2015 edition as well.
2019-02-25 11:42:18 +01:00
Andre Bogus
8cf3605c50 fix typo 2019-02-20 17:59:17 +01:00
kennytm
717aa46178
Rollup merge of #58544 - TheBiggerGuy:rustc-doc-cli-args, r=TimNN
Fix doc for rustc "-g" flag

The rustc `-g` CLI flag was miss documented to be a synonym of `-C debug-level=2` and not `-C debuglevel=2`. Also add links to the codegen docs for each synonym.

I am unsure of this will conflict with work on #52938
2019-02-20 11:58:58 +08:00
kennytm
51445830d2
Rollup merge of #58534 - dwijnand:mention-capping-forbid-lints, r=oli-obk
Mention capping forbid lints

I felt the description of forbid was misleading/incomplete without
mentioning how --cap-lints interacts with it.
2019-02-20 11:58:45 +08:00
kennytm
5a06eab1f5
Rollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomez
Modify doctest's auto-`fn main()` to allow `Result`s

This lets the default `fn main()` ~~return `impl Termination`~~ unwrap Results, which allows the use of `?` in most tests without adding it manually. This fixes #56260

~~Blocked on `std::process::Termination` stabilization.~~

Using `Termination` would have been cleaner, but this should work OK.
2019-02-20 01:13:12 +08:00
Guy Taylor
88e462bf7f Add links to codegen docs for rustc synonym flags
The rustc "-g" and "-o" fags are synonyms of the "-c" codegen flags.
This adds a link to the codegen docs for each synonym.
2019-02-17 19:45:13 +00:00
Guy Taylor
55c25f8c8d Fix doc for rustc "-g" flag
The rustc "-g" CLI flag was miss documented to be a synonym of "-C
debug-level=2" and not the correct "-C debuginfo=2".
2019-02-17 19:44:45 +00:00
Andre Bogus
dad211ef9f Modify doctest's auto-fn main() to allow Results
This lets the default `fn main()` unwrap any `Result`s, which
allows the use of `?` in most tests without adding it manually.
2019-02-17 16:42:49 +01:00
Dale Wijnand
8fbb013c1c
Mention capping forbid lints
I felt the description of forbid was misleading/incomplete without
mentioning how --cap-lints interacts with it.
2019-02-17 10:24:25 +00:00
Mazdak Farrokhzad
aa896f30bb
Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnik
Convert old first edition links to current edition one

r? @steveklabnik
2019-02-14 02:41:16 +01:00
Lzu Tao
e7f8e63ed4 Convert old doc links to current edition
Use footnote style to bypass the tidy check
2019-02-13 14:39:25 +00:00
Michael Woerister
3733b3267d Add documentation about -Clinker-plugin-lto to rustc book. 2019-02-12 15:42:04 +01:00
Guillaume Gomez
585f9a7acc
Rollup merge of #58350 - petrochenkov:embed, r=frewsxcv
Fix failing tidy (line endings on Windows)

Updates to `embedded-book` including https://github.com/rust-embedded/book/pull/127.
2019-02-10 21:45:25 +01:00
Vadim Petrochenkov
55f90c77e8 Fix failing tidy (line endings on Windows) 2019-02-10 16:21:47 +03:00
Robert Hayek
caf7126ee8
Some writing improvement, conciseness of intro 2019-02-09 00:46:27 -05:00