about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2017-06-21Rollup merge of #42620 - wesleywiser:compile_error, r=brsonCorey Farwell-0/+20
Add compile_error! Related to #40872
2017-06-20Add `Read::initializer`.Steven Fackler-0/+7
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
2017-06-20Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichtonCorey Farwell-0/+5
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-20added `FromStr` Impl for `char`tinaun-0/+5
2017-06-20Auto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrumbors-13/+0
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-19Bump version and stage0 compilerAlex Crichton-13/+0
2017-06-20Auto merge of #42313 - pnkfelix:allocator-integration, r=alexcrichtonbors-0/+15
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-19Add compile_error!() to the unsable bookWesley Wiser-0/+20
2017-06-18Remove SUMMARY.md of the unstable book as its autogeneratedest31-225/+0
Its being autogenerated now, as of PR #42612. It seems I forgot to remove it.
2017-06-18Rollup merge of #42723 - ubsan:master, r=QuietMisdreavusMark Simulacrum-13/+13
Add `_` to the list of keywords also, make sure the keyword table is correctly spaced note: the reference also needs to be updated. This is not the only way to do this in the grammar, but it's my preferred way.
2017-06-17Reintroduce deprecated `collections` crateMurarth-0/+6
2017-06-17Add `_` to the list of keywordsubsan-13/+13
also, make sure the keyword table is correctly spaced
2017-06-17Correct location of unstable book docsAlex Crichton-0/+0
2017-06-16Rollup merge of #42660 - steveklabnik:gh42632, r=frewsxcvCorey Farwell-0/+0
update book with redirect fixes Fixes #42632
2017-06-16Auto merge of #42612 - est31:master, r=nagisabors-1130/+1
Autogenerate stubs and SUMMARY.md in the unstable book Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion. The PR contains three commits, separated in order to make review easy: * The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library * The second and main commit introduces autogeneration of SUMMARY.md and feature stub files * The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout): 1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book 2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs 3. choose a file to edit, then `git add` it and `git commit` 4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f` Or they can do this: 1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122 2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs 3. revert the change in 1 3. document one of the chosen unstable features The changes done by this PR also allow for further development: * tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR * we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes. The old way to simply click through the documentation after it has been uploaded to rust-lang.org works as well. r? @nagisa Fixes #42454
2017-06-16Rollup merge of #42656 - VBChunguk:struct-field-attributes, r=nikomatsakisCorey Farwell-11/+0
Remove struct_field_attributes feature gate Part of #41681. ~This PR only removes the feature gate; this *does not* update any documentations.~ This PR removes the feature gate and the corresponding chapter of the Unstable Book. I'm not very sure about the changes I made though... Just followed the stabilization guideline. r? @nikomatsakis
2017-06-15placeholder for documentation of `allocator_api` library feature.Felix S. Klock II-0/+15
Alpha-renamed `Allocator` to `Alloc`.
2017-06-15Auto merge of #42648 - murarth:merge-alloc-collections, r=alexcrichtonbors-6/+0
Merge crate `collections` into `alloc` This is a necessary step in order to merge #42565
2017-06-15Remove struct_field_attributes from the Unstable BookWonwoo Choi-11/+0
2017-06-15Remove some more stubsest31-78/+0
2017-06-14update book with redirect fixessteveklabnik-0/+0
Fixes #42632
2017-06-14Auto merge of #42433 - marco-c:profiling, r=alexcrichtonbors-0/+34
Build instruction profiler runtime as part of compiler-rt r? @alexcrichton This is #38608 with some fixes. Still missing: - [x] testing with profiler enabled on some builders (on which ones? Should I add the option to some of the already existing configurations, or create a new configuration?); - [x] enabling distribution (on which builders?); - [x] documentation.
2017-06-13Merge crate `collections` into `alloc`Murarth-6/+0
2017-06-14Don't require that stubs exist for features in the unstable bookest31-1061/+0
Also, remove stubs.
2017-06-14Autogenerate stubs and the summary of the unstable bookest31-1/+1
2017-06-13Rollup merge of #42496 - Razaekel:feature/integer_max-min, r=BurntSushiCorey Farwell-0/+8
Add max and min to Ord Pursuant to issue #25663, this PR adds max and min methods with default implementations to std::cmp::Ord. It also modifies std::cmp::max|min to internally alias to Ord::max|min, so that any overrides of the default implementations are automatically used by std::cmp::max|min. Closes #25663
2017-06-12Fill in tracking issue for the profile featureMarco Castelluccio-2/+2
2017-06-07Auto merge of #42378 - steveklabnik:rustdoc-docs, r=frewsxcvbors-0/+500
The Rustdoc book A work-in-progress start for docs for rustdoc. This doesn't actually generate the docs yet; I wanted to open this PR to get feedback on this approach, the chapters headings themselves, and to see if anyone wanted to help fill in the ones that aren't done yet. Start of #42322. /cc @rust-lang/dev-tools @rust-lang/docs
2017-06-06Add max and min default fns to Ord traitNick Whitney-0/+8
Pursuant to issue #25663, this commit adds the max and min functions to the Ord trait, enabling items that implement Ord to use UFCS (ex. 1.max(2)) instead of the longer std::cmp::max(1,2) format.
2017-06-06Suggest 'profile' flagMarco Castelluccio-2/+2
2017-06-06Add basic documentation for the profile featureMarco Castelluccio-0/+16
2017-06-05fix testssteveklabnik-0/+2
2017-06-05address review feedbacksteveklabnik-18/+10
2017-06-04Merge branch 'profiling' of github.com:whitequark/rust into profilingMarco Castelluccio-0/+18
2017-06-03Rollup merge of #42353 - steveklabnik:update-books, r=GuillaumeGomezCorey Farwell-0/+0
Update various book repos for the next release.
2017-06-02Coming soonsteveklabnik-0/+10
2017-06-02Auto merge of #41670 - scottmcm:slice-rotate, r=alexcrichtonbors-0/+8
Add an in-place rotate method for slices to libcore A helpful primitive for moving chunks of data around inside a slice. For example, if you have a range selected and are drag-and-dropping it somewhere else (Example from [Sean Parent's talk](https://youtu.be/qH6sSOr-yk8?t=560)). (If this should be an RFC instead of a PR, please let me know.) Edit: changed example
2017-06-01Update various book repos for the next release.steveklabnik-0/+0
2017-06-01wipsteveklabnik-3/+494
2017-06-01Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakisCorey Farwell-0/+57
Lower `?` to `Try` instead of `Carrier` The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments. Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs. Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following: - https://github.com/pfpacket/rust-9p/blob/00206e34c680198a0ac7c2f066cc2954187d4fac/src/serialize.rs#L38 - https://github.com/peterdelevoryas/bufparse/blob/b1325898f4fc2c67658049196c12da82548af350/src/result.rs#L50 The other results appear to be files from libcore or its tests. I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better. r? @nikomatsakis Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.
2017-05-31add a new mdbook for rustdocsteveklabnik-0/+5
2017-05-31Add some try_trait ramblings to the unstable bookScott McMurray-0/+43
2017-05-31Give the `try_trait` feature its own tracking issueScott McMurray-2/+2
2017-05-28Auto merge of #42167 - scottmcm:iter-stepby-sizehint, r=alexcrichtonbors-0/+1
Override size_hint and propagate ExactSizeIterator for iter::StepBy Generally useful, but also a prerequisite for moving a bunch of unit tests off `Range*::step_by`. A small non-breaking subset of https://github.com/rust-lang/rust/pull/42110 (which I closed). Includes two small documentation changes @ivandardi requested on that PR. r? @alexcrichton
2017-05-27Auto merge of #42162 - est31:closure-to-fn-coercion, r=aturonbors-8/+0
Stabilize non capturing closure to fn coercion Stabilisation PR for non capturing closure to fn coercion. closes #39817
2017-05-26Rollup merge of #42169 - scottmcm:new-step-trait-issue, r=alexcrichtonCorey Farwell-2/+2
Give step_trait a distinct tracking issue from step_by iterator_step_by has decoupled their futures, so the tracking issue should split. Old issue: https://github.com/rust-lang/rust/issues/27741 New issue: https://github.com/rust-lang/rust/issues/42168 r? @alexcrichton (another follow-up to closed PR https://github.com/rust-lang/rust/pull/42110#issuecomment-303176049)
2017-05-26Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakisbors-0/+13
add thiscall calling convention support This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-25Auto merge of #40847 - jseyfried:decl_macro, r=nrcbors-0/+10
Initial implementation of declarative macros 2.0 Implement declarative macros 2.0 (rust-lang/rfcs#1584) behind `#![feature(decl_macro)]`. Differences from `macro_rules!` include: - new syntax: `macro m(..) { .. }` instead of `macro_rules! m { (..) => { .. } }` - declarative macros are items: ```rust // crate A: pub mod foo { m!(); // use before definition; declaration order is irrelevant pub macro m() {} // `pub`, `pub(super)`, etc. work } fn main() { foo::m!(); // named like other items { use foo::m as n; n!(); } // imported like other items } pub use foo::m; // re-exported like other items // crate B: extern crate A; // no need for `#[macro_use]` A::foo::m!(); A::m!(); ``` - Racket-like hygiene for items, imports, methods, fields, type parameters, privacy, etc. - Intuitively, names in a macro definition are resolved in the macro definition's scope, not the scope in which the macro is used. - This [explaination](http://beautifulracket.com/explainer/hygiene.html) of hygiene for Racket applies here (except for the "Breaking Hygiene" section). I wrote a similar [explanation](https://github.com/jseyfried/rfcs/blob/hygiene/text/0000-hygiene.md) for Rust. - Generally speaking, if `fn f() { <body> }` resolves, `pub macro m() { <body> } ... m!()` also resolves, even if `m!()` is in a separate crate. - `::foo::bar` in a `macro` behaves like `$crate::foo::bar` in a `macro_rules!`, except it can access everything visible from the `macro` (thus more permissive). - See [`src/test/{run-pass, compile-fail}/hygiene`](https://github.com/rust-lang/rust/pull/40847/commits/afe7d89858fd72b983e24727d6f4058293153c19) for examples. Small example: ```rust mod foo { fn f() { println!("hello world"); } pub macro m() { f(); } } fn main() { foo::m!(); } ``` Limitations: - This does not address planned changes to matchers (`expr`,`ty`, etc.), c.f. #26361. - Lints (including stability and deprecation) and `unsafe` are not hygienic. - adding hygiene here will be mostly or entirely backwards compatible - Nested macro definitions (a `macro` inside another `macro`) don't always work correctly when invoked from external crates. - pending improvements in how we encode macro definitions in crate metadata - There is no way to "escape" hygiene without using a procedural macro. r? @nrc
2017-05-25Stabilize non capturing closure to fn coercionest31-8/+0
2017-05-25Lower `?` to `Try` instead of `Carrier`Scott McMurray-0/+14
The easy parts of RFC 1859. (Just the trait and the lowering, none of the error message improvements nor the insta-stable impl for Option.)