about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2017-04-07Mention interrupts and green threadsJon Gjengset-1/+6
2017-04-07rustdoc needs space after # to ignoreJon Gjengset-6/+6
2017-04-07document some existing unstable featuresJorge Aparicio-4/+122
"msp430-interrupt", "ptx-kernel" and #![compiler_builtins_lib]
2017-04-07Auto merge of #39987 - japaric:used, r=arielb1bors-0/+154
#[used] attribute (For an explanation of what this feature does, read the commit message) I'd like to propose landing this as an experimental feature (experimental as in: no clear stabilization path -- like `asm!`, `#[linkage]`) as it's low maintenance (I think) and relevant to the "Usage in resource-constrained environments" exploration area. The main use case I see is running code before `main`. This could be used, for instance, to cheaply initialize an allocator before `main` where the alternative is to use `lazy_static` to initialize the allocator on its first use which it's more expensive (atomics) and doesn't work on ARM Cortex-M0 microcontrollers (no `AtomicUsize` on that platform) Here's a `std` example of that: ``` rust unsafe extern "C" fn before_main_1() { println!("Hello"); } unsafe extern "C" fn before_main_2() { println!("World"); } #[link_section = ".init_arary"] #[used] static INIT_ARRAY: [unsafe extern "C" fn(); 2] = [before_main_1, before_main_2]; fn main() { println!("Goodbye"); } ``` ``` $ rustc -C lto -C opt-level=3 before_main.rs $ ./before_main Hello World Goodbye ``` In general, this pattern could be used to let *dependencies* run code before `main` (which sounds like it could go very wrong in some cases). There are probably other use cases; I hope that the people I have cc-ed can comment on those. Note that I'm personally unsure if the above pattern is something we want to promote / allow and that's why I'm proposing this feature as experimental. If this leads to more footguns than benefits then we can just axe the feature. cc @nikomatsakis ^ I know you have some thoughts on having a process for experimental features though I'm fine with writing an RFC before landing this. - `dead_code` lint will have to be updated to special case `#[used]` symbols. - Should we extend `#[used]` to work on non-generic functions? cc rust-lang/rfcs#1002 cc rust-lang/rfcs#1459 cc @dpc @JinShil
2017-04-06Correct book examples for hardware re-orderingJon Gjengset-54/+62
2017-04-06ignore the .init_array doctestJorge Aparicio-1/+1
as it's specific to ELF and won't pass on macOS / Windows
2017-04-06add link to issue number, ignore snippet that requires custom linkingJorge Aparicio-2/+3
2017-04-06Point to tracking issue, not PRJon Gjengset-2/+2
2017-04-06Add unstable book entryJon Gjengset-0/+99
2017-04-06add documentation to the unstable bookJorge Aparicio-0/+153
2017-04-05Rollup merge of #41065 - jorendorff:slice-rsplit-41020, r=alexcrichtonAriel Ben-Yehuda-0/+11
[T]::rsplit() and rsplit_mut(), #41020
2017-04-05Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichtonAriel Ben-Yehuda-0/+8
Add ptr::offset_to This PR adds a method to calculate the signed distance (in number of elements) between two pointers. The resulting value can then be passed to `offset` to get one pointer from the other. This is similar to pointer subtraction in C/C++. There are 2 special cases: - If the distance is not a multiple of the element size then the result is rounded towards zero. (in C/C++ this is UB) - ZST return `None`, while normal types return `Some(isize)`. This forces the user to handle the ZST case in unsafe code. (C/C++ doesn't have ZSTs)
2017-04-05Add tracking issue for offset_toAmanieu d'Antras-2/+2
2017-04-04add [T]::rsplit() and rsplit_mut() #41020Jason Orendorff-0/+11
2017-04-03Add ptr::offset_toAmanieu d'Antras-0/+8
2017-04-01rustc: Stabilize the `#![windows_subsystem]` attributeAlex Crichton-11/+0
This commit stabilizes the `#![windows_subsystem]` attribute which is a conservative exposure of the `/SUBSYSTEM` linker flag on Widnows platforms. This is useful for creating applications as well as console programs. Closes #37499
2017-03-31Rollup merge of #40925 - DaseinPhaos:patch-5, r=steveklabnikCorey Farwell-0/+2
Add missing link in unstable-book add link to specialization's tracking issue
2017-03-31Sync all unstable features with Unstable Book; add tidy lint.Corey Farwell-16/+16
Add a tidy lint that checks for... * Unstable Book sections with no corresponding SUMMARY.md links * unstable features that don't have Unstable Book sections * Unstable Book sections that don't have corresponding unstable features
2017-03-30Add missing link in unstable-bookLuxko-0/+2
add link to specialization's tracking issue
2017-03-29Rollup merge of #40901 - MaloJaffre:fix-double-redirect, r=steveklabnikCorey Farwell-1/+1
Avoid linking to a moved page in rust.html
2017-03-29Avoid linking to a moved page in rust.htmlMalo Jaffré-1/+1
2017-03-29Rollup merge of #40786 - frewsxcv:unstable-book-remaining-features, ↵Corey Farwell-22/+876
r=steveklabnik Add all unstable features to Unstable Book. Add all unstable features to the Unstable Book, also remove a few that either no longer exist or were promoted to stable. These changes were extracted out of https://github.com/rust-lang/rust/pull/40694
2017-03-29Add all unstable features to Unstable Book.Corey Farwell-22/+876
Add all unstable features to the Unstable Book, also remove a few that either no longer exist or were promoted to stable. These changes were extracted out of https://github.com/rust-lang/rust/pull/40694
2017-03-27Update various book modulessteveklabnik-0/+0
This includes an important fix for rustc contributors in https://github.com/rust-lang/book/pull/571 I'm going to update the other ones as well here while we're at it; no need to spam PRs.
2017-03-25Rollup merge of #40740 - shepmaster:inclusive-range-unstable-doc, r=steveklabnikCorey Farwell-0/+10
Basic documentation for inclusive range syntax Done so that we can remove mention of this from the stable documentation ⚠️.
2017-03-22Rollup merge of #40732 - petrochenkov:booktidy, r=steveklabnikCorey Farwell-0/+0
Update the book submodule and fix tidy When the book was included into https://github.com/rust-lang/rust as a submodule, tidy started failing on Windows. https://github.com/rust-lang/book/pull/549 fixed the problem, now the submodule needs to be updated.
2017-03-22Basic documentation for inclusive range syntaxJake Goulding-0/+10
2017-03-22Update the book submodule and fix tidyVadim Petrochenkov-0/+0
2017-03-21Add docs for sort_unstable to unstable bookStjepan Glavina-0/+31
2017-03-20Rollup merge of #40685 - portal-chan:patch-1, r=eddybCorey Farwell-4/+4
Add missing associated type Item to Iterator
2017-03-20Rollup merge of #40556 - cramertj:stabilize-pub-restricted, r=petrochenkovCorey Farwell-11/+0
Stabilize pub(restricted) Fix https://github.com/rust-lang/rust/issues/32409
2017-03-20Add missing associated type Item to Iteratorportal-4/+4
2017-03-20Fix up various linkssteveklabnik-1/+1
The unstable book, libstd, libcore, and liballoc all needed some adjustment.
2017-03-20Update book and reference submodulessteveklabnik-0/+0
Some links needed adjustment to support this new scheme.
2017-03-20Import submodule for the book.steveklabnik-0/+0
It's all in the external repository now.
2017-03-20Remove the existing booksteveklabnik-17500/+0
We'll bring this back in with the next commit, as a submodule.
2017-03-19Rollup merge of #40441 - tschottdorf:promotable-rfc, r=eddybCorey Farwell-0/+24
Add feature gate for rvalue-static-promotion Probably needs more tests (which ones?) and there may be other things that need to be done. Also not sure whether the version that introduces the flag is really `1.15.1`. See https://github.com/rust-lang/rfcs/pull/1414. Updates #38865.
2017-03-17Rollup merge of #40586 - steveklabnik:add-unstable-sort-to-unstable-book, ↵Corey Farwell-0/+10
r=frewsxcv add sort_unstable to unstable book cc #40585
2017-03-17Rollup merge of #40496 - projektir:docs_number_headings, r=frewsxcvCorey Farwell-3/+3
Using X headings #39850 Fix for issue #39850, the headings should now be 1, 2, and 3.
2017-03-17Rollup merge of #40466 - projektir:outdated_docs_highlighting, r=steveklabnikCorey Farwell-19/+2
Remove doc about highlighting code in other languages #40301 This doesn't appear to be true any longer, so removing it to avoid confusion. See #40301 Thoughts: - may be a good idea to remove "Let's discuss the details of these code blocks.", as there's not much being discussed at this point; - does `text` still work? r? @steveklabnik
2017-03-17Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnikCorey Farwell-1/+1
Update usages of 'OSX' (and other old names) to 'macOS'. As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-03-17Rollup merge of #40456 - frewsxcv:frewsxcv-docs-function-parens, ↵Corey Farwell-5/+5
r=GuillaumeGomez Remove function invokation parens from documentation links. This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-16add sort_unstable to unstable booksteveklabnik-0/+10
cc #40585
2017-03-15Stabilize pub(restricted)Taylor Cramer-11/+0
2017-03-14Improve the documentation for `rvalue_static_promotion`Tobias Schottdorf-0/+18
2017-03-14Add feature toggle for rvalue-static-promotion RFCTobias Schottdorf-0/+6
See https://github.com/rust-lang/rfcs/pull/1414. Updates #38865.
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-5/+5
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13Rust unstable book: basic desc and example for `concat_idents`.Corey Farwell-0/+12
2017-03-13Rust unstable book: basic desc and example for `non_ascii_idents`.Corey Farwell-0/+8
2017-03-13Rust unstable book: basic desc and example for `i128_type`.Corey Farwell-0/+15