Commit graph

5020 commits

Author SHA1 Message Date
bors
49a97ef010 Auto merge of #50070 - toidiu:ak-2093-outlives, r=nikomatsakis
2093 infer outlives requirements

Tracking issue:  #44493
RFC: https://github.com/rust-lang/rfcs/pull/2093

- [x] add `rustc_attrs` flag
- [x] use `RequirePredicates` type
- [x]  handle explicit predicates on `dyn` Trait
- [x] handle explicit predicates on projections
- [x] more tests
- [x]  remove `unused`, `dead_code` and etc..
- [x]  documentation
2018-05-26 01:09:02 +00:00
toidiu
3da712381d Implement outlives requirements inference for dyn and projections.
Add tests, documentation and attr for feature.
2018-05-25 09:58:00 -04:00
Vadim Petrochenkov
e60eaf59df Fix naming conventions for new lints 2018-05-25 02:35:07 +03:00
steveklabnik
292be70f9d build the 2018 edition 2018-05-22 11:30:15 -04:00
kennytm
974396b991
Rollup merge of #50858 - robinkrahl:rustdoc-fix-order, r=steveklabnik
Reorder description for snippets in rustdoc documentation

The example code snippets for the `no_run` and `compile_fail` attributes in the rustdoc documentation were followed by the description for the wrong attribute.  This patch reorders the descriptions to match the code snippets.
2018-05-20 04:16:08 +08:00
bors
ef8ee64774 Auto merge of #50760 - petrochenkov:legimp, r=nikomatsakis
Turn deprecation lint `legacy_imports` into a hard error

Closes https://github.com/rust-lang/rust/issues/38260

The lint was introduced in Dec 2016, then made deny-by-default in Jun 2017 when crater run found 0 regressions caused by it.

This lint requires some not entirely trivial amount of import resolution logic that (surprisingly or not) interacts with `feature(use_extern_macros)` (https://github.com/rust-lang/rust/issues/35896), so it would be desirable to remove it before stabilizing `use_extern_macros`.
In particular, this PR fixes the failing example in https://github.com/rust-lang/rust/issues/50725 (but not the whole issue, `use std::panic::{self}` still can cause other undesirable errors when `use_extern_macros` is enabled).
2018-05-19 12:16:50 +00:00
mandeep
8d74cf8705 Add println statement to rendered code block example 2018-05-18 10:06:38 -05:00
mandeep
6dc824257a Add doc comment to hiding portions of code example
Refactor hiding example to be more complete
2018-05-18 10:06:38 -05:00
Robin Krahl
cf1f0385a8
Reorder description for snippets in rustdoc documentation
The example code snippets for the `no_run` and `compile_fail` attributes
in the rustdoc documentation were followed by the description for the
wrong attribute.  This patch reorders the descriptions to match the code
snippets.
2018-05-18 14:12:25 +02:00
Mark Simulacrum
faa1f21298
Rollup merge of #50839 - glassresistor:master, r=steveklabnik
Make sure people know the book is free oline

I've used the tutorial a number of times to relearn rust basics.  When i saw this for a moment I was sad thinking it had been taken offline.
2018-05-17 13:51:30 -06:00
Mark Simulacrum
c95267e3a1
Rollup merge of #50791 - bstrie:null, r=QuietMisdreavus
Fix null exclusions in grammar docs

The grammar documentation incorrectly says that comments, character literals,
and string literals may not include null.
2018-05-17 13:51:25 -06:00
Mark Simulacrum
77a4296b07
Rollup merge of #50790 - bstrie:grammar, r=steveklabnik
Fix grammar documentation wrt Unicode identifiers

The grammar defines identifiers in terms of XID_start and XID_continue,
but this is referring to the unstable non_ascii_idents feature.
The documentation implies that non_ascii_idents is forthcoming, but this
is left over from pre-1.0 documentation; in reality, non_ascii_idents
has been without even an RFC for several years now, and will not be
stabilized anytime soon. Furthermore, according to the tracking issue at
https://github.com/rust-lang/rust/issues/28979 , it's highly
questionable whether or not this feature will use XID_start or
XID_continue even when or if non_ascii_idents is stabilized.
This commit fixes this by respecifying identifiers as the usual
[a-zA-Z_][a-zA-Z0-9_]*
2018-05-17 13:51:24 -06:00
Mikela
cfa26da963
Update tutorial.md 2018-05-17 12:25:24 -07:00
Mikela
ec0d946b28
Make sure people know the book is free oline 2018-05-17 09:49:28 -07:00
Irina Popa
b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00
bstrie
ab4735e2ea Null exclusions in grammar docs
The grammar documentation incorrectly says that comments, character literals,
and string literals may not include null.
2018-05-16 01:16:01 +00:00
bstrie
ce0b7cc529 Fix grammar documentation wrt Unicode identifiers
The grammar defines identifiers in terms of XID_start and XID_continue,
but this is referring to the unstable non_ascii_idents feature.
The documentation implies that non_ascii_idents is forthcoming, but this
is left over from pre-1.0 documentation; in reality, non_ascii_idents
has been without even an RFC for several years now, and will not be
stabilized anytime soon. Furthermore, according to the tracking issue at
https://github.com/rust-lang/rust/issues/28979 , it's highly
questionable whether or not this feature will use XID_start or
XID_continue even when or if non_ascii_idents is stabilized.
This commit fixes this by respecifying identifiers as the usual
[a-zA-Z_][a-zA-Z0-9_]*
2018-05-16 00:56:56 +00:00
Guillaume Gomez
30c0b56e8f
Rollup merge of #50594 - sanxiyn:man-print, r=steveklabnik
Update the man page with additional --print options

`\:` is a `groff` for `<wbr>` to get better line breaking.
2018-05-15 14:26:56 +02:00
Vadim Petrochenkov
d1b027421e Turn deprecation lint legacy_imports into a hard error 2018-05-15 02:25:04 +03:00
Alex Burka
394945ee36 stabilize :lifetime 2018-05-13 19:51:32 +00:00
Dan Aloni
37ed2ab910 Macros: Add a 'literal' fragment specifier
Implements RFC 1576.

See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md

Changes are mostly in libsyntax, docs, and tests. Feature gate is
enabled for 1.27.0.

Many thanks to Vadim Petrochenkov for following through code reviews
and suggestions.

Example:

````rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```
2018-05-13 19:17:02 +03:00
Seo Sanghyeon
37783563ed Update the man page with additional --print options 2018-05-10 12:11:47 +09:00
bors
295d98069f Auto merge of #50390 - hdhoang:46205_deny_by_default, r=nikomatsakis
lint: deny incoherent_fundamental_impls by default

Warn the ecosystem of the pending intent-to-disallow in #49799.

There are 4 ICEs on my machine, look unrelated (having happened before in https://github.com/rust-lang/rust/issues/49146#issuecomment-384473523)

```rust
thread 'main' panicked at 'assertion failed: position <= slice.len()', libserialize/leb128.rs:97:1
```

```
    [run-pass] run-pass/allocator/xcrate-use2.rs
    [run-pass] run-pass/issue-12133-3.rs
    [run-pass] run-pass/issue-32518.rs
    [run-pass] run-pass/trait-default-method-xc-2.rs
```

r? @nikomatsakis
2018-05-08 04:56:01 +00:00
Corey Farwell
7364d26921 Update books for the next release. 2018-05-05 19:02:13 -04:00
Hoàng Đức Hiếu
cabbe50c55 ignore erroneous example 2018-05-03 08:17:21 +07:00
Hoàng Đức Hiếu
8e4072cb4b fix error text 2018-05-03 08:16:34 +07:00
Hoàng Đức Hiếu
2fce5b34f6 doc: move incoherent_fundamental_impls to deny-by-default listing 2018-05-03 07:52:36 +07:00
Seiichi Uchida
8ad2d21a9c
Add tool_attributes feature to unstable book 2018-05-02 11:48:11 +02:00
bors
357bf00f1c Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakis
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)

r? @nikomatsakis
2018-04-30 22:02:33 +00:00
bors
4745092d60 Auto merge of #50163 - kornelski:error, r=Kimundi
Bury Error::description()

Second attempt of #49536 https://github.com/rust-lang/rfcs/pull/2230

The exact wording of the default implementation is still up in the air, but I think it's a detail that can be amended later.
2018-04-30 15:17:01 +00:00
Zack M. Davis
3dbdccc6a9 stabilize #[must_use] for functions and must-use operators
This is in the matter of RFC 1940 and tracking issue #43302.
2018-04-28 20:32:49 -07:00
kennytm
d403d82b0a
Rollup merge of #49707 - steveklabnik:rustc-book, r=QuietMisdreavus
Add "the Rustc book"

This PR introduces a new book into the documentation, "The rustc book". We already have books for Cargo, and for Rustdoc, rustc should have some too. This book is focused on *users* of rustc, and provides a nice place to write documentation for users.

I haven't put content here, but plan on scaffolding it out very soon, and wanted this PR open for a few discussions first. One of those is "what exactly should said TOC be?" I plan on having a proposed one up tomorrow, but figured I'd let people know to start thinking about it now.

The big one is that we also will want to put https://github.com/rust-lang-nursery/rustc-guide in-tree as well, and the naming is... tough. I'm proposing:

* doc.rust-lang.org/rustc is "The Rustc book", to mirror the other tools' books.
* doc.rust-lang.org/rustc-contribution is "The Rustc contribution guide", and contains that book

@nikomatsakis et al, any thoughts on this? I'm not attached to it in particular, but had to put something together to get this discussion going. I think mirroring the other tools is a good idea for this work, but am not sure where exactly that leaves yours.

Fixes https://github.com/rust-docs/team/issues/11
2018-04-27 14:16:42 +08:00
Kornel
1912f39e7c Update book submodule to pass linkchecker test 2018-04-25 21:56:06 +01:00
steveklabnik
36475d947b more nits 2018-04-24 12:21:08 -04:00
steveklabnik
ac79c41edc review nits 2018-04-23 11:58:11 -04:00
Guillaume Gomez
1ed3e77b8a Add doc about doc alias feature 2018-04-22 00:30:48 +02:00
tinaun
edc412c5a9 stabilize slice_rsplit feature 2018-04-17 00:48:23 -04:00
kennytm
932431ceda
Rollup merge of #49994 - frewsxcv:frewsxcv-doc-tests, r=QuietMisdreavus
Remove unnecessary indentation in rustdoc book codeblock.

None
2018-04-17 03:34:34 +08:00
steveklabnik
00c860e8a9 write docs for targets 2018-04-16 12:57:16 -04:00
steveklabnik
b204968239 fill out contributing 2018-04-16 12:57:09 -04:00
steveklabnik
cd3f6cf3fe fill out command line arguments 2018-04-16 12:57:01 -04:00
Corey Farwell
afa22d63d7 Remove unnecessary indentation in rustdoc book codeblock. 2018-04-16 16:25:57 +09:00
bors
3e70dfd655 Auto merge of #49956 - QuietMisdreavus:rustdoc-codegen, r=GuillaumeGomez
rustdoc: port the -C option from rustc

Blocked on https://github.com/rust-lang/rust/pull/49864. The included test won't work without those changes, so this PR includes those commits as well.

When documenting items that require certain target features, it helps to be able to force those target features into existence. Rather than include a flag just to parse those features, i instead decided to port the `-C` flag from rustc in its entirety. It takes the same parameters, because it runs through the same parsing function. This has the added benefit of being able to control the codegen of doctests as well.

One concern i have with the flag is that i set it to stable here. My rationale is that it is a direct port of functionality on rustc that is currently stable, used only in mechanisms that it is originally used for. If needed, i can set it back to be unstable.
2018-04-16 05:00:14 +00:00
Mike Hommey
4c8e9b9751 Replace remaining uses of deprecated std::heap with std::alloc 2018-04-14 16:47:38 +09:00
QuietMisdreavus
a5456bdd87 add -C to the rustdoc book 2018-04-13 16:21:27 -05:00
Simon Sapin
f607a3872a Rename alloc::Void to alloc::Opaque 2018-04-12 22:53:22 +02:00
Mike Hommey
fddf51ee0b Use NonNull<Void> instead of *mut u8 in the Alloc trait
Fixes #49608
2018-04-12 22:53:22 +02:00
Simon Sapin
86753ce1cc Use the GlobalAlloc trait for #[global_allocator] 2018-04-12 22:53:12 +02:00
bors
252a459d37 Auto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakis
Add ok-wrapping to catch blocks, per RFC

Updates the `catch{}` lowering to wrap the result in `Try::from_ok`.

r? @nikomatsakis

Fixes #41414
Fixes #43818
2018-04-12 05:38:49 +00:00
bors
47778811d9 Auto merge of #48528 - bitshifter:repr_packed, r=eddyb
Implementation of `#[repr(packed(n))]` RFC 1399.

Tracking issue https://github.com/rust-lang/rust/issues/33158.
2018-04-12 03:08:14 +00:00
Simon Sapin
b2027ef17c Deprecate the std_unicode crate 2018-04-12 00:13:51 +02:00
Cameron Hart
15d1c4d213 Implementation of #[repr(packed(n))] RFC 1399. 2018-04-11 22:13:13 +10:00
Scott McMurray
c88efe46b8 Fix the unstable book to account for ok-wrapping 2018-04-10 20:03:40 -07:00
steveklabnik
cb6a19925a add codegen options section 2018-04-10 16:35:28 -04:00
steveklabnik
142c52f4a3 fix tests 2018-04-09 14:04:58 -04:00
steveklabnik
758a77d46c more lints 2018-04-09 14:04:58 -04:00
steveklabnik
df81ca3764 document deny by default lints 2018-04-09 14:04:58 -04:00
steveklabnik
50b3a3d121 add a lot of text about lints 2018-04-09 14:04:58 -04:00
steveklabnik
78b076dadb add targets to TOC 2018-04-09 14:04:58 -04:00
steveklabnik
cd55364248 write 'what is rustc' 2018-04-09 14:04:58 -04:00
steveklabnik
5424dc46b7 write headings for command line arguments 2018-04-09 14:04:57 -04:00
steveklabnik
4f6ed513d1 fix authorship in book.toml 2018-04-09 14:04:57 -04:00
steveklabnik
c942bf42fc Add a TOC 2018-04-09 14:04:57 -04:00
steveklabnik
7de5b6034d update doc index to link to the rustc book 2018-04-09 14:04:57 -04:00
steveklabnik
0dd0a5bc03 initialize the rustc book 2018-04-09 14:04:10 -04:00
Pulkit Goyal
ee880b96ae Using X headings instead of 0.X #49739 2018-04-07 00:42:47 +05:30
kennytm
d6f19b676f
Rollup merge of #49628 - steveklabnik:learn-use-master, r=QuietMisdreavus
Re-write the documentation index

The docs team has decided that we're framing resources in three ways:
"learning Rust," "using Rust," "mastering Rust." This is a more useful
split than "beginner/intermediate/advanced." As we add more resources
in the future, we expect "using Rust" to grow. "the bookshelf" as a
concept is great, but isn't really organized along these lines. As such,
this reorganizes the docs along these lines.
2018-04-05 02:17:02 +08:00
steveklabnik
77b570f831 Re-write the documentation index
The docs team has decided that we're framing resources in three ways:
"learning Rust," "using Rust," "mastering Rust." This is a more useful
split than "beginner/intermediate/advanced." As we add more resources
in the future, we expect "using Rust" to grow. "the bookshelf" as a
concept is great, but isn't really organized along these lines. As such,
this reorganizes the docs along these lines.
2018-04-03 15:58:15 -04:00
Thayne McCombs
e75c6a741e Remove splice page from unstable book. 2018-04-02 19:41:22 -06:00
Mark Simulacrum
5d3916d566
Rollup merge of #49451 - QuietMisdreavus:epoch-doctests, r=GuillaumeGomez
rustdoc: add an --edition flag to compile docs/doctests with a certain edition

To correspond with the 2018 edition, this adds a (currently unstable) `--edition` flag to rustdoc that makes it compile crates and doctests with the given edition. Once this lands, Cargo should be updated to pass this flag when the edition configuration option is given.
2018-04-01 18:04:54 +02:00
kennytm
eb3e2feb0d
Rollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavus
Rename main theme into light theme

r? @QuietMisdreavus
2018-03-30 01:31:12 +02:00
Guillaume Gomez
772a8028ff Rename main theme into light theme 2018-03-29 13:45:56 +02:00
bors
d52c44ea8d Auto merge of #49460 - kennytm:rollup, r=kennytm
Rollup of 12 pull requests

- Successful merges: #49243, #49329, #49364, #49400, #49405, #49427, #49428, #49429, #49439, #49442, #49444, #49452
- Failed merges:
2018-03-28 22:18:13 +00:00
kennytm
43f56ce131
Rollup merge of #49243 - murarth:stabilize-retain, r=BurntSushi
Stabilize method `String::retain`

Closes #43874
2018-03-28 17:55:05 +02:00
Taylor Cramer
3c65f53620 Stabilize match_default_bindings
This includes a submodule update to rustfmt
in order to allow a stable feature declaration.
2018-03-28 11:13:13 +02:00
QuietMisdreavus
a0e48dde7c talk about --edition in the Rustdoc Book 2018-03-27 16:36:15 +02:00
Mark Mansi
07104692d5 Fix missed i128 feature gates 2018-03-26 08:37:56 -05:00
Mark Mansi
a249d25625 Rename unstable book correctly 2018-03-26 08:37:56 -05:00
Mark Mansi
a89d1d0b02 Rename unstable-book chapter 2018-03-26 08:37:56 -05:00
Mark Mansi
db7d9ea480 Stabilize i128 feature too 2018-03-26 08:37:56 -05:00
Mark Mansi
33d9d8e0c6 Update nightly book 2018-03-26 08:36:50 -05:00
Taylor Cramer
0f5b52e4a8 Stabilize conservative_impl_trait 2018-03-26 10:43:03 +02:00
Taylor Cramer
c393db67ba Stabilize universal_impl_trait 2018-03-26 07:39:38 +02:00
kennytm
54544515ce
Rollup merge of #49318 - steveklabnik:update-books, r=kennytm
update books for next release
2018-03-25 01:26:48 +08:00
kennytm
e2b89221f1
Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertj
Make resuming generators unsafe instead of the creation of immovable generators

cc @withoutboats

Fixes #47787
2018-03-25 01:26:34 +08:00
steveklabnik
36322d00df update books for next release 2018-03-24 15:31:02 +01:00
Alex Crichton
f74d01cf29 Rollup merge of #49028 - QuietMisdreavus:the-dark-forbidden-corners-of-rustdoc, r=frewsxcv
add an "unstable features" chapter to the rustdoc book

There are several rustdoc features that currently are undocumented, but also don't fit with the rest of the Rustdoc Book since they're also unstable. Some of these have corresponding feature gates and chapters in the Unstable Book, but many don't, and i wanted a place to talk about them officially.

Goal: talk about everything rustdoc can do that needs nightly

- [x] Feature gates (extensions to the doc attribute that can be caught by the compiler)
  - [x] doc(cfg)
  - [x] doc(masked)
  - [x] doc(spotlight)
  - [x] doc(include)
- [x] Command-line flags (features that require a CLI flag to use, where the flag itself is a `-Z` command or otherwise requires `-Z unstable-options` before rustdoc will accept it)
  - [x] markdown-before-content/markdown-after-content
  - [x] playground-url
  - [x] display-warnings
  - [x] crate-version
  - [x] linker
  - [x] sort-modules-by-appearance
  - [x] themes/theme-checker
  - [x] resource-suffix
  - [x] `-Z force-unstable-if-unmarked`
- [x] Nightly-gated functionality (features that are gated by requiring a nightly build without needing a CLI flag or a feature gate to unlock)
  - [x] intra-links
  - [x] error numbers for `compile_fail` doctests
2018-03-23 10:16:08 -07:00
Murarth
7c442e5c9b Stabilize method String::retain 2018-03-21 15:36:50 -07:00
QuietMisdreavus
b996f9d60f review comments 2018-03-21 09:52:18 -05:00
John Kåre Alsaker
57896abc38 Make resuming generators unsafe instead of the creation of immovable generators. Fixes #47787 2018-03-21 00:09:58 +01:00
QuietMisdreavus
83e9f395d1 talk about force-unstable-if-unmarked 2018-03-20 11:23:48 -05:00
QuietMisdreavus
5e93394d32 talk about --display-warnings 2018-03-20 11:18:42 -05:00
Vadim Petrochenkov
7c90189e13 Stabilize slice patterns without ..
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-20 02:27:40 +03:00
QuietMisdreavus
b5ab5ceb4b talk about --resource-suffix 2018-03-16 15:06:36 -05:00
QuietMisdreavus
6b2906018f talk about --themes and --theme-checker 2018-03-16 14:41:51 -05:00
QuietMisdreavus
cc4f97e883 talk about --sort-modules-by-appearance 2018-03-16 14:30:56 -05:00
QuietMisdreavus
33ed787b49 talk about --linker 2018-03-16 13:46:10 -05:00
QuietMisdreavus
f9d3845138 talk about --crate-version 2018-03-16 13:38:06 -05:00
bors
36b6687318 Auto merge of #49051 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests

- Successful merges: #48706, #48875, #48892, #48922, #48957, #48959, #48961, #48965, #49007, #49024, #49042, #49050, #48853, #48990, #49037, #49049, #48972
- Failed merges:
2018-03-16 00:09:14 +00:00
QuietMisdreavus
5d8443aeb1 talk about --playground-url 2018-03-15 14:44:17 -05:00
kennytm
97b489ef39
Rollup merge of #48961 - Songbird0:rustdoc_doctests_assertions, r=GuillaumeGomez
Rustdoc: example of use of assertions

I added this section at the beginning of the file because it seems to be basic information. Let me know if there's someplace more relevant.

See #47945.
2018-03-16 01:49:45 +08:00
QuietMisdreavus
bb328237fc talk about --markdown-(before|after)-content 2018-03-15 12:47:26 -05:00
QuietMisdreavus
43ed37711e add new section about CLI flags 2018-03-15 09:35:22 -05:00
QuietMisdreavus
c24a58c87c fix link 2018-03-15 09:29:54 -05:00
kennytm
92d1f8d8e4
Stabilize inclusive_range_syntax language feature.
Stabilize the syntax `a..=b` and `..=b`.
2018-03-15 16:58:02 +08:00
QuietMisdreavus
3d90b4d738 add headings to categorize the features 2018-03-14 17:22:15 -05:00
QuietMisdreavus
067553d5a1 talk about doc(include) 2018-03-14 17:13:52 -05:00
QuietMisdreavus
82bd146d60 talk about doc(masked) 2018-03-14 16:40:28 -05:00
QuietMisdreavus
23a1da4d63 talk about doc(spotlight) 2018-03-14 16:06:53 -05:00
QuietMisdreavus
0f96e145fb talk about doc(cfg) 2018-03-14 15:32:25 -05:00
QuietMisdreavus
30adb53f46 talk about intra-links 2018-03-13 17:00:51 -05:00
Anthony Defranceschi
a48224b9ac Add a section for using assertions into doc tests.
See #47945.
2018-03-13 14:20:57 +01:00
QuietMisdreavus
373b2cdcd1 talk about error numbers for compile_fail doctests 2018-03-12 17:26:20 -05:00
QuietMisdreavus
c685b57bf2 add page to the Rustdoc Book about unstable features 2018-03-12 17:16:21 -05:00
QuietMisdreavus
c80220436b big fences to show that ``rust is the same as `` 2018-03-12 16:15:38 -05:00
Oliver Schneider
45abb1ba84
Stabilize const_indexing feature 2018-03-08 08:34:14 +01:00
Oliver Schneider
e97089dae3
Move librustc_const_eval to librustc_mir 2018-03-08 08:08:14 +01:00
Manish Goregaokar
fac7d7cfb2
Rollup merge of #48359 - jsgf:remap-path-prefix, r=sanxiyn
Fixes #47311.
r? @nrc
2018-02-28 15:09:24 -08:00
kennytm
b443e57ce6
Rollup merge of #48166 - hedgehog1024:hedgehog1024-stabilize-entry_and_modify, r=alexcrichton
Stabilize 'entry_and_modify' feature

Stabilize `entry_and_modify` feature introduced by #44734.

Closes #44733
2018-02-25 15:54:42 +08:00
Jeremy Fitzhardinge
56a6828533 Implement --remap-path-prefix
Remove experimental -Zremap-path-prefix-from/to, and replace it with
the stabilized --remap-path-prefix=from=to variant.

This is an implementation for issue of #41555.
2018-02-22 15:13:21 -08:00
steveklabnik
ef48e0f2b9 Update the book to promote second edition
This updates the book repository, but mostly to include
https://github.com/rust-lang/book/pull/1180

TL;DR: the second edition is close enough to done that we should
universally recommend it over the first edition.
2018-02-21 14:26:09 -05:00
Guillaume Gomez
c5be497888 Fix unstable book 2018-02-17 18:27:46 +01:00
Guillaume Gomez
de8b429420 Update to last repository version 2018-02-17 16:31:07 +01:00
hedgehog1024
4360dfa126
Delete information about 'entry_and_modify' from Unstable book 2018-02-12 22:27:33 +03:00
bors
b8398d947d Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis
Implement `?` macro repetition

See rust-lang/rfcs#2298 (with disposition merge)
2018-02-11 18:11:01 +00:00
Mark Simulacrum
fe8e0d98f1 Update books for next release 2018-02-09 11:27:47 -07:00
kennytm
55aef3c9c7
Rollup merge of #47948 - pietroalbini:use-nested-groups-stabilize, r=petrochenkov
Stabilize use_nested_groups

As requested in #44494. Documentation PRs already sent.
2018-02-06 02:13:51 +08:00
kennytm
ddc4284b71
Rollup merge of #47753 - steveklabnik:update-book, r=alexcrichton
Update book

This PR does two things:

1. update the book to include https://github.com/rust-lang/book/pull/1088
2. update to mdbook 0.1

Both of these things are big changes, so I want to land them now, well before the next branch, so we can kick the tires.

------------------------------

Locally, I'm seeing some weirdness around the reference and this:

![image](https://user-images.githubusercontent.com/27786/35411917-8dcbb31a-01e8-11e8-8c30-0bd280d93b9d.png)

Putting this PR up so others can try and build and see if it reproduces for them.
2018-02-06 02:13:49 +08:00
Pietro Albini
01f0814a2a
Stabilize use_nested_groups 2018-02-05 10:23:40 +01:00
steveklabnik
b320829da4 update reference 2018-02-04 15:44:48 -05:00
steveklabnik
dcb3e21b06 update trpl
Includes https://github.com/rust-lang/book/pull/1088 and
62210e326c
2018-02-04 15:44:48 -05:00
kennytm
1439c2ac35
Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, r=petrochenkov
Stabilize feature(match_beginning_vert)

With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm.

Reference PR: rust-lang-nursery/reference#231

Closes #44101
2018-02-04 23:28:58 +08:00
Volker Mische
cf78ff3913
Fix lang items box example code
The `exchange_free` lang item is gone in favour of `box_free` [1].

Some warnings are also fixed by this commit.

[1]: https://github.com/rust-lang/rust/commit/ca115dd083a1fe1d2b4892c5e50e49eb83ff1f3
2018-02-01 00:21:43 +01:00
Jonathan Goodman
a99b5db56a stabilize match_beginning_vert 2018-01-30 16:00:55 -06:00
Mark Mansi
6943430e6d Add ? to unstable book 2018-01-30 12:42:51 -06:00
kennytm
19aac099a5 Rollup merge of #47515 - jimmantooth:patch-1, r=QuietMisdreavus
Punctuation and clarity fixes.
2018-01-30 17:10:48 +08:00
evelynmitchell
05652d2ae3
fix for documentation error issue 47716 2018-01-24 09:25:46 -07:00
bors
b887317da6 Auto merge of #47158 - rkruppe:repr-transparent, r=eddyb
Implement repr(transparent)

r? @eddyb for the functional changes. The bulk of the PR is error messages and docs, might be good to have a doc person look over those.

cc #43036
cc @nox
2018-01-22 08:10:41 +00:00
Guillaume Gomez
d3176efa78 Rollup merge of #47508 - QuietMisdreavus:rbe-bookshelf, r=steveklabnik
add Rust By Example to the bookshelf

cc #46194

With #46196 freshly merged, we should add a link to the main docs distribution so people can find it! We discussed this at the docs team meeting today and decided to go ahead with adding it to the bookshelf.
2018-01-20 22:32:43 +01:00
Simon Sapin
c97c1f7dc3 Mark Unique as perma-unstable, with the feature renamed to ptr_internals. 2018-01-20 11:09:23 +01:00
James Mantooth
c2e26121db
Punctuation and clarity fixes. 2018-01-17 05:23:21 -06:00
QuietMisdreavus
0e1ecbed83
add Rust By Example to the bookshelf 2018-01-16 19:35:39 -06:00
Robin Kruppe
2be697bc21 Implement repr(transparent) 2018-01-16 08:58:32 +01:00
Carol (Nichols || Goulding)
c698496f84
Reexport -> re-export in documentation section headings 2018-01-15 13:36:52 -05:00
kennytm
63f4285247
Rollup merge of #47414 - est31:master, r=alexcrichton
Enforce dashes in the unstable book file names

Also rename the existing underscore using files to use dashes.

Fixes #47394.
2018-01-15 18:49:37 +08:00
projektir
a2df413187 Adding RBE as a submodule #46194 2018-01-13 13:04:53 -08:00
est31
38e2667584 Enforce dashes in the unstable book file names
Also rename the existing underscore using files to use dashes.

Fixes #47394.
2018-01-13 15:44:44 +01:00
Corey Farwell
8fbfd2c940 Rollup merge of #47301 - GuillaumeGomez:fix-error-index-display, r=QuietMisdreavus
Fix error index display

Fixes #47284.

r? @QuietMisdreavus
2018-01-09 22:28:26 -05:00
Guillaume Gomez
265b234dd6 Fix error index display 2018-01-09 22:26:26 +01:00
Vadim Petrochenkov
ef2b131144 Add docs for crate_in_paths, extern_in_paths and extern_absolute_paths into the unstable book 2018-01-03 19:18:02 +03:00
kennytm
d6cf5a56ac Rollup merge of #47117 - tinaun:no_more_dups, r=frewsxcv
[unstable book] remove duplicate entries

if a unstable feature is a language feature, it shouldn't also have a library feature stub generated
2018-01-03 16:57:58 +08:00
bors
1bcc6dc7ea Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfried
Allow lifetimes in macros

This is a resurrection of PR #41927 which was a resurrection of #33135, which is intended to fix #34303.

In short, this allows macros_rules! to use :lifetime as a matcher to match 'lifetimes.

Still to do:
- [x]  Feature gate
2018-01-01 07:21:23 +00:00
steveklabnik
28d13f9edf update books for next release 2017-12-30 12:02:53 -05:00
Matt Peterson
0f9c9b66bb Add an entry in the unstable book 2017-12-28 11:33:44 -05:00
Guillaume Gomez
eb84f4243f fix markdown file differences 2017-12-07 23:56:21 +01:00
Zack M. Davis
207fc0bb45 template month/year, version into man pages while building dist tarball
This is meant to resolve #25689.
2017-12-04 23:47:59 -08:00
Kenjiro Nakayama
cac199fb27 Fix invalid link to lint_plugin_test.rs 2017-12-03 18:13:54 +09:00
Pietro Albini
91ba8b42fc
Implement RFC 2128 (use_nested_groups)
This commit adds support for nested groups inside `use` declarations,
such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-30 13:10:26 +01:00
kennytm
aa99bd96fd Rollup merge of #46174 - stjepang:stabilize-spinloophint, r=sfackler
Stabilize spin_loop_hint

Stabilize `spin_loop_hint` in release `1.23.0`.
I've also renamed feature `hint_core_should_pause` to `spin_loop_hint`.

cc #41196
2017-11-28 03:16:43 +08:00
Stjepan Glavina
a115fcd1a0 Remove spin-loop-hint from the unstable book 2017-11-22 11:24:57 +01:00
bors
3755fe9555 Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomez
rustdoc: include external files in documentation (RFC 1990)

Part of https://github.com/rust-lang/rfcs/pull/1990 (needs work on the error reporting, which i'm deferring to after this initial PR)

cc #44732

Also fixes #42760, because the prep work for the error reporting made it easy to fix that at the same time.
2017-11-22 09:58:07 +00:00
Stjepan Glavina
6ceb5f4bec Stabilize spin_loop_hint 2017-11-22 00:00:01 +01:00
QuietMisdreavus
f9f3611f5c allow loading external files in documentation
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990
(needs error reporting work)

cc #44732
2017-11-21 15:46:49 -06:00
Martin Lindhe
ece9a57d1b fix some typos 2017-11-21 15:33:45 +01:00
bors
421a2113a8 Auto merge of #45039 - QuietMisdreavus:doc-spotlight, r=GuillaumeGomez,QuietMisdreavus
show in docs whether the return type of a function impls Iterator/Read/Write

Closes #25928

This PR makes it so that when rustdoc documents a function, it checks the return type to see whether it implements a handful of specific traits. If so, it will print the impl and any associated types. Rather than doing this via a whitelist within rustdoc, i chose to do this by a new `#[doc]` attribute parameter, so things like `Future` could tap into this if desired.

### Known shortcomings

~~The printing of impls currently uses the `where` class over the whole thing to shrink the font size relative to the function definition itself. Naturally, when the impl has a where clause of its own, it gets shrunken even further:~~ (This is no longer a problem because the design changed and rendered this concern moot.)

The lookup currently just looks at the top-level type, not looking inside things like Result or Option, which renders the spotlights on Read/Write a little less useful:

<details><summary>`File::{open, create}` don't have spotlight info (pic of old design)</summary>

![image](https://user-images.githubusercontent.com/5217170/31209495-e59d027e-a950-11e7-9998-ceefceb71c07.png)

</details>

All three of the initially spotlighted traits are generically implemented on `&mut` references. Rustdoc currently treats a `&mut T` reference-to-a-generic as an impl on the reference primitive itself. `&mut Self` counts as a generic in the eyes of rustdoc. All this combines to create this lovely scene on `Iterator::by_ref`:

<details><summary>`Iterator::by_ref` spotlights Iterator, Read, and Write (pic of old design)</summary>

![image](https://user-images.githubusercontent.com/5217170/31209554-50b271ca-a951-11e7-928b-4f83416c8681.png)

</details>
2017-11-21 03:03:28 +00:00
steveklabnik
a3917b2b86 Update books for next release
Also includes a fix in std::ops
2017-11-20 08:30:22 -05:00
Guillaume Gomez
cdadb6c725 Rollup merge of #45767 - QuietMisdreavus:who-docs-the-doc-tool, r=frewsxcv
rustdoc book: talk about #![doc(test(no_crate_inject))] and #![doc(test(attr(...)))]

While investigating https://github.com/rust-lang/rust/issues/45750 i noticed that `#![doc(test(attr(...)))]` wasn't documented at all. Since this is useful for making your examples follow the same coding guidelines as your code, i wanted to add it to the Rustdoc Book. I also added `#![doc(test(no_crate_inject))]` since it's used in the same place and might be useful for macro-heavy crates. I added mentions for these to "The `doc` attribute" as well as "Documentation tests" since it's useful information in both places.

Technically the step reordering in the second commit is gated on https://github.com/rust-lang/rust/pull/45764, since before that lands attributes from the doctest come before the ones from `#![doc(test(attr(...)))]`.
2017-11-18 12:15:21 +01:00
QuietMisdreavus
be68d34a7e update links and tracking issue for doc_spotlight 2017-11-17 22:50:15 +01:00
QuietMisdreavus
831fd78341 add doc_highlight feature flag and tests 2017-11-17 22:50:15 +01:00
bors
42ea30c8b0 Auto merge of #45692 - steveklabnik:ship-cargo-book, r=alexcrichton
Start shipping the Cargo book

Fixes #44910
Fixes #39588

See both of those bugs for more details.
2017-11-16 01:16:58 +00:00
Christopher Vittal
b4c1aef1ca Add universal_impl_trait unstable-book entry 2017-11-15 15:46:01 -05:00
steveklabnik
3b32a3a104 link the cargo book into the bookshelf 2017-11-14 06:51:59 -05:00
Alex Crichton
6bc8f164b0 std: Remove rand crate and module
This commit removes the `rand` crate from the standard library facade as
well as the `__rand` module in the standard library. Neither of these
were used in any meaningful way in the standard library itself. The only
need for randomness in libstd is to initialize the thread-local keys of
a `HashMap`, and that unconditionally used `OsRng` defined in the
standard library anyway.

The cruft of the `rand` crate and the extra `rand` support in the
standard library makes libstd slightly more difficult to port to new
platforms, namely WebAssembly which doesn't have any randomness at all
(without interfacing with JS). The purpose of this commit is to clarify
and streamline randomness in libstd, focusing on how it's only required
in one location, hashmap seeds.

Note that the `rand` crate out of tree has almost always been a drop-in
replacement for the `rand` crate in-tree, so any usage (accidental or
purposeful) of the crate in-tree should switch to the `rand` crate on
crates.io. This then also has the further benefit of avoiding
duplication (mostly) between the two crates!
2017-11-08 20:41:17 -08:00
Ryan Scheel
6363b06ffc
Update reference link in doc's 404
It's currently linking to a page that says it's on the page I'm changing the link too.
2017-11-04 20:53:27 -07:00
QuietMisdreavus
ce7a3a4584 rustdoc book: talk about #![doc(test(...))] in doctests chapter 2017-11-04 14:54:15 -05:00
QuietMisdreavus
5fbadfcdbe rustdoc book: add #![doc(test(no_crate_inject))] and #![doc(test(attr(...)))] 2017-11-04 14:54:14 -05:00
bors
d762b1d6c6 Auto merge of #45394 - davidtwco:rfc-2008, r=petrochenkov
RFC 2008: Future-proofing enums/structs with #[non_exhaustive] attribute

This work-in-progress pull request contains my changes to implement [RFC 2008](https://github.com/rust-lang/rfcs/pull/2008). The related tracking issue is #44109.

As of writing, enum-related functionality is not included and there are some issues related to tuple/unit structs. Enum related tests are currently ignored.

WIP PR requested by @nikomatsakis [in Gitter](https://gitter.im/rust-impl-period/WG-compiler-middle?at=59e90e6297cedeb0482ade3e).
2017-11-04 18:07:07 +00:00
David Wood
d3babe5eaa
Added page to unstable book. 2017-11-03 19:36:19 +00:00
leonardo.yvens
94b07a91bc update unstable book and error example 2017-11-03 16:13:22 -02:00
Carol (Nichols || Goulding)
c285a4e8f7 Update the book for a fix to the print button
Fixes #45552.
2017-10-28 20:44:38 -04:00
kennytm
65f1df594a Rollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnik
Fixed rustc_on_unimplemented example in Unstable Book

I saw [this](https://doc.rust-lang.org/beta/unstable-book/language-features/on-unimplemented.html) example and it seemed wrong. This fixes the example to emit an error message that makes more sense.
2017-10-28 15:56:24 +08:00
bors
d9f1249655 Auto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrum
Bump to 1.23 and update bootstrap

This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies
2017-10-27 18:00:32 +00:00
Nadav Zingerman
880200ac6b Fixed rustc_on_unimplemented example in Unstable Book 2017-10-27 12:42:44 +03:00
Alex Crichton
ca18537197 Bump to 1.23 and update bootstrap
This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies
2017-10-26 13:59:18 -07:00
steveklabnik
a82ffa490c Fix formatting in unstable book's attr-literals section 2017-10-25 14:23:13 -04:00
bors
c2799fc9a5 Auto merge of #45446 - leodasvacas:remove-libcollections, r=alexcrichton
Remove deprecated `collections` crate.

The real `collections` was merged with `alloc`, this facade was introduced [in this PR](https://github.com/rust-lang/rust/pull/42720) to give `#[no_std]` users time to adapt. This was done at least two cycles ago, now we can consider removing it for good.
2017-10-24 20:46:17 +00:00
Zack M. Davis
214b0f2293 crate shorthand visibility modifier
With regrets, this breaks rustfmt and rls.

This is in the matter of #45388.
2017-10-22 23:58:13 -07:00
leonardo.yvens
19aa23b6d3 Remove deprecated collections crate.
This reverts commit 6484258f17.
2017-10-22 14:55:02 -02:00
kennytm
0350c2f783 Rollup merge of #45217 - SimonSapin:alloc-doc, r=steveklabnik
Fix out of date unstable book entries for `alloc_*` features.

The `alloc_jemalloc` crate does not provide a type to use with `#[global_allocator]`, and (according to Alex) `extern crate alloc_jemalloc;` alone became a no-op when `#[global_allocator]` was introduced.
2017-10-19 01:59:49 +08:00
kennytm
61c58c1584 Rollup merge of #45181 - Havvy:doc-unstable-lang-items, r=frewsxcv
List of all lang items in unstable book.

I don't know how to link to the source code correctly, so I just put the information aside the lang item name.
2017-10-19 01:59:48 +08:00
Havvy
12873006f6 List of all lang items in unstable book. 2017-10-17 07:22:08 -07:00
kennytm
2ff1ad08ad Rollup merge of #45308 - dbrgn:headlines, r=steveklabnik
Rustdoc book: Add missing headlines

Some options were missing headlines, which looked a bit inconsistent.
2017-10-17 22:20:59 +08:00
Danilo Bargen
fdb3e37126 Rustdoc book: Add missing headlines
Some options were missing headlines, which looked a bit inconsistent.
2017-10-15 17:02:45 +02:00
Danilo Bargen
b7d378a94c Fix typo in rustdoc book 2017-10-15 16:59:54 +02:00
kennytm
b6f4cea79d Rollup merge of #45250 - brauliobz:non-ascii-idents-details, r=steveklabnik
Moved details of unstable non-ascii identifiers from the Reference

Moved details of unstable non-ascii identifiers from the Reference to the Unstable book

r? @steveklabnik
2017-10-15 14:21:52 +08:00
bors
83922feec3 Auto merge of #45102 - petrochenkov:noar, r=alexcrichton
cleanup: rustc doesn't use an external archiver

cc https://github.com/rust-lang/rust/pull/45090
r? @alexcrichton
2017-10-14 01:43:42 +00:00
Bráulio Bezerra
8e6119f353 Fixed link to keywords page in the reference 2017-10-13 17:15:28 -03:00
tinaun
46cd410381 remove duplicate stubs 2017-10-13 02:09:22 -04:00
Bráulio Bezerra
8d20030a03 Moved details of unstable non-ascii identifiers from the Reference to the Unstable book 2017-10-12 23:30:46 -03:00
Simon Sapin
818d224947 Fix out of date unstable book entries for alloc_* features. 2017-10-12 07:46:02 +02:00
tinaun
d5ef9f9036 formatting fixes 2017-10-10 23:21:20 -04:00
tinaun
d07825258e unstable book: fn_traits 2017-10-10 04:59:28 -04:00
tinaun
364148dbf9 unstable book: unboxed_closures 2017-10-10 04:42:59 -04:00
tinaun
7735f59e80 unstable book: OIBIT 2017-10-10 04:20:49 -04:00
Vadim Petrochenkov
b434c84bab cleanup: rustc doesn't use an external archiver 2017-10-09 22:36:08 +03:00
Tobias Schottdorf
de55b4f077 implement pattern-binding-modes RFC
See the [RFC] and [tracking issue].

[tracking issue]: https://github.com/rust-lang/rust/issues/42640
[RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-06 16:30:23 -04:00
bors
a8feaee5b6 Auto merge of #44734 - mchlrhw:wip/hashmap-entry-and-then, r=BurntSushi
Implement `and_modify` on `Entry`

## Motivation

`Entry`s are useful for allowing access to existing values in a map while also allowing default values to be inserted for absent keys. The existing API is similar to that of `Option`, where `or` and `or_with` can be used if the option variant is `None`.

The `Entry` API is, however, missing an equivalent of `Option`'s `and_then` method. If it were present it would be possible to modify an existing entry before calling `or_insert` without resorting to matching on the entry variant.

Tracking issue: https://github.com/rust-lang/rust/issues/44733.
2017-10-06 12:51:11 +00:00
mchlrhw
9e36111fc6 Implement entry_and_modify 2017-10-06 09:10:31 +01:00
steveklabnik
851b6d4762 update books for next release
Also fixes some stdlib links to the reference which have changed.
2017-10-02 12:07:28 -04:00
Danilo Bargen
eb59952fbd Docs: Add trace_macros! to unstable book 2017-09-30 15:27:42 +02:00
Alex Burka
e64efc91f4 Add support for ..= syntax
Add ..= to the parser

Add ..= to libproc_macro

Add ..= to ICH

Highlight ..= in rustdoc

Update impl Debug for RangeInclusive to ..=

Replace `...` to `..=` in range docs

Make the dotdoteq warning point to the ...

Add warning for ... in expressions

Updated more tests to the ..= syntax

Updated even more tests to the ..= syntax

Updated the inclusive_range entry in unstable book
2017-09-22 22:05:18 +02:00
bors
325ba23d55 Auto merge of #44620 - zackmdavis:rfc_1940_housekeeping, r=nikomatsakis
RFC 1940 housekeeping

* move test to own directory, as requested in https://github.com/rust-lang/rust/issues/43302#issuecomment-329579185
* exercise trait methods in test
* unstable book section

r? @nikomatsakis
2017-09-19 13:06:31 +00:00
bors
9a00f3cc30 Auto merge of #44026 - QuietMisdreavus:trimmed-std, r=steveklabnik
hide internal types/traits from std docs via new #[doc(masked)] attribute

Fixes #43701 (hopefully for good this time)

This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs.

Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter.

To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.
2017-09-19 04:20:56 +00:00
Alex Crichton
fa9dd27168 Rollup merge of #44640 - budziq:stabilize_splice, r=dtolnay
Stabilized vec_splice and modified splice tracking issue

This stabilizes the vec_splice (Vec part of splice RFC)
Fixes #32310.
2017-09-18 11:04:23 -05:00
Tim Neumann
064f718247 Rollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton
stabilized compiler_fences (fixes #41091)

I did not know what to proceed with "unstable-book" entry. The feature would no longer be unstable so I have deleted it. If it was the wrong call I'll revert it (unfortunately his case is not described in the CONTRIBUTING.md).
2017-09-17 13:19:09 +02:00
Michal Budzynski
6b167f98d9 Updated tracking issue for String::splice and its unstable-book entry 2017-09-17 10:41:24 +02:00
Michal Budzynski
7b932d2e12 stabilized vec_splice (fixes #32310) 2017-09-17 10:32:59 +02:00
Michal Budzynski
b7152901ce stabilized iterator_for_each (closes #42986)
updated clippy and rls as it uses the iterator_for_each
2017-09-16 22:49:40 +02:00
Michal Budzynski
8a11172d6b stabilized compiler_fences (fixes #41091) 2017-09-16 22:18:46 +02:00
Zack M. Davis
d09db63d2f unstable book section for fn_must_use 2017-09-15 17:13:48 -07:00
bors
fd4bef54ab Auto merge of #43949 - GuillaumeGomez:compile_fail_stable, r=alexcrichton
Compile fail stable

Since #30726, we never made the `compile_fail` flag nor the error code check stable. I think it's time to change this fact.

r? @alexcrichton
2017-09-15 08:05:39 +00:00
bors
a7b7dce02d Auto merge of #44413 - est31:move_man, r=nikomatsakis
Move the man directory to a subdirectory

There is no reason it should be in the top directory.
2017-09-12 12:41:23 +00:00
est31
d587558269 Move the man directory to a subdirectory
There is no reason it should be in the top directory.
2017-09-08 12:51:19 +02:00
QuietMisdreavus
64f61113eb remove tests for doc(masked) 2017-09-05 13:56:30 -05:00
QuietMisdreavus
db09332b39 update doc_masked docs and tracking issue 2017-09-05 13:51:33 -05:00
QuietMisdreavus
bb6de3c9ce add feature gate doc_masked and tests 2017-09-05 13:51:08 -05:00
Jon Gjengset
9389d26ba2
use - for unstable book filenames 2017-09-05 14:21:44 -04:00
Jon Gjengset
35c7943fd2
Add or_default to Entry APIs 2017-09-05 13:11:38 -04:00
Guillaume Gomez
ebc195d292 Add precision for rustdoc block codes 2017-09-03 13:15:16 +02:00
Guillaume Gomez
2ffcfeb821 Add compile_fail documentation 2017-09-03 13:15:15 +02:00
Matt Ickstadt
22ca03bde6 Fix unstable book example 2017-09-01 16:16:36 -05:00
Matt Ickstadt
f866152991 Implement RFC 1925 2017-09-01 12:46:37 -05:00
Alex Crichton
16bbff0277 Rollup merge of #44172 - mattico:patch-2, r=frewsxcv
Fix link in unstable book entry for Generators
2017-08-30 13:17:05 -07:00
Alex Crichton
581dc93293 Rollup merge of #44044 - mattico:string-splice-return, r=dtolnay
Remove Splice struct return value from String::splice

The implementation is now almost identical to the one in the RFC.

Fixes #44038
cc #32310
2017-08-30 11:11:09 -05:00
Matt Ickstadt
6f7594d506 Fix link in unstable book entry for Generators 2017-08-29 22:27:50 -05:00
Matt Ickstadt
0c3c43c800 Remove Splice struct return value from String::splice 2017-08-26 15:07:32 -05:00
Alex Crichton
4b5f330c70 Merge remote-tracking branch 'origin/master' into gen 2017-08-17 13:23:20 -07:00
Corey Farwell
12bbae95f4 Rollup merge of #43914 - steveklabnik:update-books, r=QuietMisdreavus
Update the books for next release
2017-08-17 10:44:10 -04:00
steveklabnik
010f59750f Update the books for next release 2017-08-16 16:08:08 -04:00
Eduard-Mihai Burtescu
014333fbd4 Stabilize rvalue promotion to 'static. 2017-08-16 20:30:56 +03:00
Alex Crichton
1210ebff43 Merge remote-tracking branch 'origin/master' into gen 2017-08-16 10:03:47 -07:00
bors
82be83cf74 Auto merge of #43500 - murarth:string-retain, r=alexcrichton
Add method `String::retain`

Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool`
and reducing the string to only characters for which the predicate
returns `true`.
2017-08-15 16:21:28 +00:00
bors
c774c95919 Auto merge of #43863 - steveklabnik:ship-the-rustdoc-book, r=frewsxcv
Ship the rustdoc book

Fixes #42322, as it's the last step.

Blocked on https://github.com/rust-lang/rust/pull/43790, though they will not conflict.

r? @rust-lang/docs
2017-08-15 07:28:54 +00:00
Murarth
618ac89d25 Add method String::retain
Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool`
and reducing the string to only characters for which the predicate
returns `true`.
2017-08-14 20:42:26 -07:00
Alex Crichton
1413253a41 Merge remote-tracking branch 'origin/master' into gen 2017-08-14 19:36:13 -07:00
steveklabnik
2c6cf22a30 Remove plugins chapter
we don't want to support plugins
2017-08-14 20:33:30 -04:00
Corey Farwell
b1bdf13e6b Rollup merge of #43790 - steveklabnik:rustdoc-passes, r=QuietMisdreavus
Write the "passes" chapter of the rustdoc book

cc #42322

r? @rust-lang/docs
2017-08-14 20:28:44 -04:00
steveklabnik
7a5ee171c3 Write the "passes" chapter of the rustdoc book
cc #42322
2017-08-14 15:10:56 -04:00
steveklabnik
f7b3610b25 link to the rustdoc book from the main docs 2017-08-14 13:58:21 -04:00
bors
0ed03e5490 Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichton
Expose all OS-specific modules in libstd doc.

1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc.

2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness.

3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed.

Fixes #24658 (Does _not_ fully implement #1998).
2017-08-13 03:00:20 +00:00
bors
59f6b8338e Auto merge of #43812 - steveklabnik:rustdoc-doc-tests, r=QuietMisdreavus
rustdoc doc tests

This is mostly adapted from the book v1's chapter.

cc https://github.com/rust-lang/rust/issues/42322

r? @rust-lang/docs
2017-08-12 09:34:13 +00:00
steveklabnik
035d4ea2ca rustdoc doc tests 2017-08-11 16:43:38 -04:00
steveklabnik
1e4aaea431 address review feedback 2017-08-11 16:24:18 -04:00
steveklabnik
92f8442434 ignore more things 2017-08-10 20:17:41 -04:00
steveklabnik
640cf596ec review feedback 2017-08-10 18:59:51 -04:00
steveklabnik
bc9e0820e7 doc doc(inline) and doc(no_inline) 2017-08-10 18:52:10 -04:00
steveklabnik
99e943c8b8 Document the doc attribute
cc #42322
2017-08-10 17:53:36 -04:00
kennytm
a2b888675a
Implemented #[doc(cfg(...))].
This attribute has two effects:

1. Items with this attribute and their children will have the "This is
   supported on **** only" message attached in the documentation.

2. The items' doc tests will be skipped if the configuration does not
   match.
2017-08-10 13:43:59 +08:00
Alex Crichton
c25ddf21f1 Merge remote-tracking branch 'origin/master' into gen 2017-08-09 11:44:21 -07:00
Corey Farwell
abc76ae7e9 Bump 'src/doc/book' git submodule.
Primarily to pick up this change:

https://github.com/rust-lang/book/pull/866

...to move this PR forward:

https://github.com/rust-lang/rust/pull/43641
2017-08-05 16:29:10 -04:00
Simon Sapin
a8858eba98 Update nomicon 2017-08-03 00:36:43 +02:00
John Kåre Alsaker
ae1856cb9e Update rename State in docs 2017-07-28 15:47:55 +02:00
Alex Crichton
09a5d319ab Remove support for gen arg 2017-07-28 15:46:26 +02:00
John Kåre Alsaker
2ad0f89e86 Tweak docs 2017-07-28 15:46:25 +02:00
Alex Crichton
7eae8489fc Touch up unstable docs for generators 2017-07-28 15:46:25 +02:00
John Kåre Alsaker
bfd71c5b70 Fix examples 2017-07-28 15:46:24 +02:00
Alex Crichton
5d174f0035 Clarifying documentation for generator 2017-07-28 15:46:24 +02:00
Alex Crichton
55bb1c08d3 Add documentation for generators 2017-07-28 15:46:23 +02:00
bors
ddaab61101 Auto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturon
Stabilize more APIs for the 1.20.0 release

In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
2017-07-26 23:40:48 +00:00
Mark Simulacrum
b5b7266b78 Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfackler
Make the "main" constructors of NonZero/Shared/Unique return Option

Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441.

This is a breaking change to unstable APIs.

The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts.

In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
2017-07-26 06:15:01 -06:00
Alex Crichton
20b4f86d13 Stabilize the compile_error_macro feature
Stabilizes:

* `compile_error!` as a macro defined by rustc

Closes #40872
2017-07-25 07:09:31 -07:00
Simon Sapin
0a08ad0443 Rename {NonZero,Shared,Unique}::new to new_unchecked 2017-07-22 20:38:16 +02:00
Joe Ranweiler
e74f611405
Document use of compiler_builtins with no_std binaries
The docs for the `compiler_builtins_lib` library feature were removed
in #42899. But, though the `compiler_builtins` library has been
migrated out-of-tree, the feature remains, and is needed to use the
stand-alone crate. We reintroduce the docs for the feature, and add a
reference to them when describing how to create a `no_std` executable.
2017-07-20 21:51:06 -07:00
steveklabnik
e760ba2fa1 Update the books. 2017-07-14 13:33:19 -04:00
Mark Simulacrum
50799265ca Test src/doc once more 2017-07-10 11:43:02 -06:00
Sean McArthur
74b2d69358 remove associated_consts feature gate 2017-07-06 11:52:25 -07:00
bors
8cab2c73d4 Auto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakis
Switch to rust-lang-nursery/compiler-builtins

This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-06 02:34:29 +00:00
bors
1685c92986 Auto merge of #42727 - alexcrichton:allocators-new, r=eddyb
rustc: Implement the #[global_allocator] attribute

This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389
2017-07-06 00:16:16 +00:00
Alex Crichton
695dee063b rustc: Implement the #[global_allocator] attribute
This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/197

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389
2017-07-05 14:37:01 -07:00
Alex Crichton
fd95db25b3 Merge remote-tracking branch 'origin/master' into proc_macro_api 2017-07-05 08:42:13 -07:00
Alex Crichton
7e6c9f3635 Switch to rust-lang-nursery/compiler-builtins
This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-05 07:08:36 -07:00
bors
1d2db7b9e8 Auto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichton
Stabilize feature sort_unstable

Closes #40585
2017-07-02 23:54:32 +00:00
est31
1561954ea4 Documentation 2017-07-02 13:53:29 +02:00
Stjepan Glavina
5350e22366 Stabilize feature sort_unstable 2017-07-02 02:09:21 +02:00
Sergio Benitez
d280b40b18 Stabilize 'more_io_inner_methods' feature. 2017-06-30 18:05:04 -07:00
Josh Stone
741dc2bad5 Track iterator_for_each in #42986 2017-06-30 10:21:46 -07:00
bors
919c4a6707 Auto merge of #42782 - cuviper:iterator_for_each, r=alexcrichton
Add `Iterator::for_each`

This works like a `for` loop in functional style, applying a closure to
every item in the `Iterator`.  It doesn't allow `break`/`continue` like
a `for` loop, nor any other control flow outside the closure, but it may
be a more legible style for tying up the end of a long iterator chain.

This was tried before in #14911, but nobody made the case for using it
with longer iterators.  There was also `Iterator::advance` at that time
which was more capable than `for_each`, but that no longer exists.

The `itertools` crate has `Itertools::foreach` with the same behavior,
but thankfully the names won't collide.  The `rayon` crate also has a
`ParallelIterator::for_each` where simple `for` loops aren't possible.

> I really wish we had `for_each` on seq iterators. Having to use a
> dummy operation is annoying.  - [@nikomatsakis][1]

[1]: https://github.com/nikomatsakis/rayon/pull/367#issuecomment-308455185
2017-06-30 09:15:21 +00:00
Masaki Hara
141265dfe8
Give a tracking-issue number for unsized tuple coercion. 2017-06-29 21:25:35 +09:00
Masaki Hara
03660b6476
Move unsized_tuple_coercion behind a feature gate. 2017-06-29 21:25:35 +09:00
Andreas Sommer
4fb67dcf8f Fix link reference 2017-06-28 10:55:57 +02:00
Jeffrey Seyfried
e42836b208 Implement quote! and other proc_macro API. 2017-06-26 02:06:26 +00:00
Corey Farwell
d33e2c5181 Rollup merge of #42620 - wesleywiser:compile_error, r=brson
Add compile_error!

Related to #40872
2017-06-21 10:40:15 -04:00
Steven Fackler
ecbb896b9e Add Read::initializer.
This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.
2017-06-20 20:26:22 -07:00
Josh Stone
b4038977a3 Add Iterator::for_each
This works like a `for` loop in functional style, applying a closure to
every item in the `Iterator`.  It doesn't allow `break`/`continue` like
a `for` loop, nor any other control flow outside the closure, but it may
be a more legible style for tying up the end of a long iterator chain.

This was tried before in #14911, but nobody made the case for using it
with longer iterators.  There was also `Iterator::advance` at that time
which was more capable than `for_each`, but that no longer exists.

The `itertools` crate has `Itertools::foreach` with the same behavior,
but thankfully the names won't collide.  The `rayon` crate also has a
`ParallelIterator::for_each` where simple `for` loops aren't possible.

> I really wish we had `for_each` on seq iterators. Having to use a
> dummy operation is annoying.  - [@nikomatsakis][1]

[1]: https://github.com/nikomatsakis/rayon/pull/367#issuecomment-308455185
2017-06-20 15:25:51 -07:00
Corey Farwell
4c43bc32b7 Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichton
add `FromStr` Impl for `char`

fixes #24939.

is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?
2017-06-20 16:28:25 -04:00
tinaun
fd9d7aa2cf added FromStr Impl for char 2017-06-20 04:38:02 -04:00
bors
753fee4ab6 Auto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrum
Bump to 1.20.0 and update stage0 compiler

Betas are hot off the bots, let's get them while they're fresh.
2017-06-20 07:22:38 +00:00
Alex Crichton
be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
bors
1143eb26a2 Auto merge of #42313 - pnkfelix:allocator-integration, r=alexcrichton
Allocator integration

Lets start getting some feedback on `trait Alloc`.

Here is:
 *  the `trait Alloc` itself,
 * the `struct Layout` and `enum AllocErr` that its API relies on
 * a `struct HeapAlloc` that exposes the system allocator as an instance of `Alloc`
 * an integration of `Alloc` with `RawVec`
 * ~~an integration of `Alloc` with `Vec`~~

 TODO
 * [x] split `fn realloc_in_place` into `grow` and `shrink` variants
 * [x] add `# Unsafety` and `# Errors` sections to documentation for all relevant methods
 * [x] remove `Vec` integration with `Allocator`
 * [x] add `allocate_zeroed` impl to `HeapAllocator`
 * [x] remove typedefs e.g. `type Size = usize;`
 * [x] impl `trait Error` for all error types in PR
 * [x] make `Layout::from_size_align` public
 * [x] clarify docs of `fn padding_needed_for`.
 * [x] revise `Layout` constructors to ensure that [size+align combination is valid](https://github.com/rust-lang/rust/pull/42313#issuecomment-306845446)
 * [x] resolve mismatch re requirements of align on dealloc. See [comment](https://github.com/rust-lang/rust/pull/42313#issuecomment-306202489).
2017-06-20 05:02:19 +00:00
Wesley Wiser
2bec12f036 Add compile_error!() to the unsable book 2017-06-19 14:29:30 -04:00