Skip to content

Rollup of 18 pull requests #40544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
13341f4
Reword the non-dropping of `src` for `ptr::write{,_unaligned}`
tbu- Mar 9, 2017
97a1b6a
Update usages of 'OSX' (and other old names) to 'macOS'.
frewsxcv Mar 12, 2017
b38992c
some style fixes
tshepang Mar 13, 2017
0644773
Remove doc about highlighting code in other languages #40301
projektir Mar 13, 2017
6b7b262
Updating README.md to point to the correct doc location
projektir Mar 13, 2017
eb203d5
Adjust wording #40301
projektir Mar 13, 2017
adba642
fix format grammar
llogiq Mar 13, 2017
5e49f79
Add test for issue #29595
mattico Mar 10, 2017
11d3344
Using X headings #39850
projektir Mar 13, 2017
8b9b3b6
Fix sidebar not extending to the bottom of the page
wesleywiser Mar 14, 2017
e06c515
Rust unstable book: basic desc and example for `const_fn`.
frewsxcv Mar 11, 2017
327e8e9
Rust unstable book: basic desc and example for `conservative_impl_tra…
frewsxcv Mar 11, 2017
0dd03ff
Rust unstable book: basic desc and example for `const_indexing`.
frewsxcv Mar 12, 2017
137c1e8
Rust unstable book: basic desc and example for `i128_type`.
frewsxcv Mar 12, 2017
e58e3d0
Rust unstable book: basic desc and example for `non_ascii_idents`.
frewsxcv Mar 12, 2017
d3ae2eb
Rust unstable book: basic desc and example for `concat_idents`.
frewsxcv Mar 12, 2017
1545f4e
std: remove a workaround for privacy limitations that isn't necessary…
swgillespie Mar 14, 2017
e7b0f2b
Remove function invokation parens from documentation links.
frewsxcv Mar 12, 2017
5cc056a
A few improvements to the `core::hash` top-level docs.
frewsxcv Mar 14, 2017
0671cc1
.gitmodules: use official URLs w/o redirect
nodakai Mar 14, 2017
8af3013
Inline functions Ordering::{then, then_with}
Mar 14, 2017
cc08edc
Remove incorrect feature from the 1.16 relnotes
steveklabnik Mar 14, 2017
8b7c7f3
Link core::slice to std::slice
steveklabnik Mar 14, 2017
e3b8550
Point out correct turbofish usage on `Foo<Bar<Baz>>`
estebank Mar 14, 2017
8ab12d7
Rollup merge of #40387 - tbu-:pr_doc_ptr_write2, r=steveklabnik
frewsxcv Mar 15, 2017
bb1c465
Rollup merge of #40433 - mattico:test-issue-29595, r=estebank
frewsxcv Mar 15, 2017
c4db59f
Rollup merge of #40452 - frewsxcv:frewsxcv-unstable-docs, r=Guillaume…
frewsxcv Mar 15, 2017
85f10d8
Rollup merge of #40456 - frewsxcv:frewsxcv-docs-function-parens, r=Gu…
frewsxcv Mar 15, 2017
23c87ab
Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnik
frewsxcv Mar 15, 2017
499b104
Rollup merge of #40463 - tshepang:nit, r=nikomatsakis
frewsxcv Mar 15, 2017
e62a282
Rollup merge of #40466 - projektir:outdated_docs_highlighting, r=stev…
frewsxcv Mar 15, 2017
d7ca11d
Rollup merge of #40467 - projektir:readme_docs, r=steveklabnik
frewsxcv Mar 15, 2017
488ad85
Rollup merge of #40495 - llogiq:format-docs, r=steveklabnik
frewsxcv Mar 15, 2017
430c607
Rollup merge of #40496 - projektir:docs_number_headings, r=frewsxcv
frewsxcv Mar 15, 2017
4aea360
Rollup merge of #40497 - wesleywiser:fix_sidebar, r=GuillaumeGomez
frewsxcv Mar 15, 2017
d9d365d
Rollup merge of #40500 - estebank:turbofish-help, r=pnkfelix
frewsxcv Mar 15, 2017
16aa039
Rollup merge of #40503 - swgillespie:thread-hack-removal, r=sfackler
frewsxcv Mar 15, 2017
cc1e513
Rollup merge of #40505 - frewsxcv:hash-docs, r=alexcrichton
frewsxcv Mar 15, 2017
e56ef86
Rollup merge of #40512 - nodakai:patch-1, r=alexcrichton
frewsxcv Mar 15, 2017
51738b3
Rollup merge of #40514 - stjepang:inline-then-ordering, r=alexcrichton
frewsxcv Mar 15, 2017
6bf3b36
Rollup merge of #40517 - rust-lang:release-notes-tweak, r=alexcrichton
frewsxcv Mar 15, 2017
a2d2a97
Rollup merge of #40520 - steveklabnik:link-core-slice, r=alexcrichton
frewsxcv Mar 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cargo
12 changes: 12 additions & 0 deletions src/doc/unstable-book/src/concat-idents.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,17 @@ The tracking issue for this feature is: [#29599]

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

The `concat_idents` feature adds a macro for concatenating multiple identifiers
into one identifier.

## Examples

```rust
#![feature(concat_idents)]

fn main() {
fn foobar() -> u32 { 23 }
let f = concat_idents!(foo, bar);
assert_eq!(f(), 23);
}
```
56 changes: 56 additions & 0 deletions src/doc/unstable-book/src/conservative-impl-trait.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,61 @@ The tracking issue for this feature is: [#34511]

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

The `conservative_impl_trait` feature allows a conservative form of abstract
return types.

Abstract return types allow a function to hide a concrete return type behind a
trait interface similar to trait objects, while still generating the same
statically dispatched code as with concrete types.

## Examples

```rust
#![feature(conservative_impl_trait)]

fn even_iter() -> impl Iterator<Item=u32> {
(0..).map(|n| n * 2)
}

fn main() {
let first_four_even_numbers = even_iter().take(4).collect::<Vec<_>>();
assert_eq!(first_four_even_numbers, vec![0, 2, 4, 6]);
}
```

## Background

In today's Rust, you can write function signatures like:

````rust,ignore
fn consume_iter_static<I: Iterator<u8>>(iter: I) { }

fn consume_iter_dynamic(iter: Box<Iterator<u8>>) { }
````

In both cases, the function does not depend on the exact type of the argument.
The type held is "abstract", and is assumed only to satisfy a trait bound.

* In the `_static` version using generics, each use of the function is
specialized to a concrete, statically-known type, giving static dispatch,
inline layout, and other performance wins.
* In the `_dynamic` version using trait objects, the concrete argument type is
only known at runtime using a vtable.

On the other hand, while you can write:

````rust,ignore
fn produce_iter_dynamic() -> Box<Iterator<u8>> { }
````

...but you _cannot_ write something like:

````rust,ignore
fn produce_iter_static() -> Iterator<u8> { }
````

That is, in today's Rust, abstract return types can only be written using trait
objects, which can be a significant performance penalty. This RFC proposes
"unboxed abstract types" as a way of achieving signatures like
`produce_iter_static`. Like generics, unboxed abstract types guarantee static
dispatch and inline data layout.
19 changes: 19 additions & 0 deletions src/doc/unstable-book/src/const-fn.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,24 @@ The tracking issue for this feature is: [#24111]

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

The `const_fn` feature allows marking free functions and inherent methods as
`const`, enabling them to be called in constants contexts, with constant
arguments.

## Examples

```rust
#![feature(const_fn)]

const fn double(x: i32) -> i32 {
x * 2
}

const FIVE: i32 = 5;
const TEN: i32 = double(FIVE);

fn main() {
assert_eq!(5, FIVE);
assert_eq!(10, TEN);
}
```
9 changes: 9 additions & 0 deletions src/doc/unstable-book/src/const-indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@ The tracking issue for this feature is: [#29947]

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

The `const_indexing` feature allows the constant evaluation of index operations
on constant arrays and repeat expressions.

## Examples

```rust
#![feature(const_indexing)]

const ARR: [usize; 5] = [1, 2, 3, 4, 5];
const ARR2: [usize; ARR[1]] = [42, 99];
```
15 changes: 15 additions & 0 deletions src/doc/unstable-book/src/i128-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,20 @@ The tracking issue for this feature is: [#35118]

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

The `i128_type` feature adds support for 128 bit signed and unsigned integer
types.

```rust
#![feature(i128_type)]

fn main() {
assert_eq!(1u128 + 1u128, 2u128);
assert_eq!(u128::min_value(), 0);
assert_eq!(u128::max_value(), 340282366920938463463374607431768211455);

assert_eq!(1i128 - 2i128, -1i128);
assert_eq!(i128::min_value(), -170141183460469231731687303715884105728);
assert_eq!(i128::max_value(), 170141183460469231731687303715884105727);
}
```

8 changes: 8 additions & 0 deletions src/doc/unstable-book/src/non-ascii-idents.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ The tracking issue for this feature is: [#28979]

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

The `non_ascii_idents` feature adds support for non-ASCII identifiers.

## Examples

```rust
#![feature(non_ascii_idents)]

const ε: f64 = 0.00001f64;
const Π: f64 = 3.14f64;
```