Commit graph

4821 commits

Author SHA1 Message Date
Masaki Hara
a0c422a752 Remove a now-unnecessary paragraph.
The paragraph described a case where we can't optimize away repetitive
dynamic stack allocation. However, as arielb1 pointed out, it can
actually optimizable by dynamically delaying the stack unwinding.
2018-08-19 08:07:33 +09:00
Masaki Hara
438edc3d5e Update the unstable book regarding [e; dyn n]. 2018-08-19 08:07:33 +09:00
Masaki Hara
c72e87e30a Add an unstable-book article about unsized_locals. 2018-08-19 08:07:33 +09:00
bors
33b923fd44 Auto merge of #53324 - alexreg:self_in_typedefs, r=eddyb
`Self` in type definitions (self_in_typedefs)

This implements the [`self_in_typedefs` feature](https://github.com/rust-lang/rfcs/blob/master/text/2300-self-in-typedefs.md) ([tracking issue 49303](https://github.com/rust-lang/rust/issues/49303)).

r? @eddyb

CC @Centril
2018-08-18 19:34:24 +00:00
Alexander Regueiro
4e7d3f5a5e Added page for feature to unstable book. 2018-08-18 18:56:31 +01:00
Eduard-Mihai Burtescu
9b1d3c70ac rustc_resolve: don't allow paths starting with ::crate. 2018-08-17 12:59:56 +03:00
kennytm
6e98ed9650
Rollup merge of #53395 - varkor:__Nonexhaustive-to-non_exhaustive, r=shepmaster
Use #[non_exhaustive] on internal enums

This replaces `__Nonexhaustive` variants (and variants thereof)  with `#[non_exhaustive]`. These were mostly unstable previously, with the exception of the `cloudabi` enums and `Level` in proc_macro: these were `#[doc(hidden)]`, so clearly intended not to be used directly. It should be safe to replace all of these.
2018-08-17 00:13:26 +08:00
varkor
27f2a8420f Remove outdated Unstable Book sections 2018-08-15 17:56:53 +01:00
Esteban Küber
d35e2677fc review comment 2018-08-13 12:57:21 -07:00
Esteban Küber
54e11c96a6 Extend documentation of rustc_on_unimplemented 2018-08-11 15:01:06 -07:00
Pietro Albini
8b31f00401
Rollup merge of #52831 - dsciarra:rm-ref-to-author-file, r=alexcrichton
remove references to AUTHORS.txt file

Rust does not ship an AUTHORS.txt file anymore.
2018-08-01 10:12:47 +02:00
bors
4fbd4a55f7 Auto merge of #52863 - steveklabnik:update-books, r=Mark-Simulacrum
update books for new release

r? @Mark-Simulacrum
2018-07-31 03:30:47 +00:00
steveklabnik
7a8693861e update books for new release 2018-07-30 11:09:48 -04:00
Donato Sciarra
c57deb923e Remove references to AUTHORS.txt file
Refer instead to thanks page.
2018-07-30 07:47:12 +02:00
bors
26e73dabeb Auto merge of #52711 - eddyb:unsized-manuallydrop, r=nikomatsakis
Change ManuallyDrop<T> to a lang item.

This PR implements the approach @RalfJung proposes in https://internals.rust-lang.org/t/pre-rfc-unions-drop-types-and-manuallydrop/8025 (lang item `struct` instead of `union`).

A followup PR can easily solve #47034 as well, by just adding a few `?Sized` to `libcore/mem.rs`.

r? @nikomatsakis
2018-07-28 14:26:16 +00:00
Ralf Jung
4e6aea1a10 uodate reference again to hopefully fix all link issues 2018-07-27 18:40:47 +02:00
toidiu
130e3ab31b add section in book 2018-07-27 10:18:06 -04:00
Ralf Jung
c9eef35429 update reference to fix links 2018-07-27 13:38:20 +02:00
mark
63c2d06a0d update nightly book 2018-07-23 21:54:43 -05:00
Eric Huss
3074c42bfe Fix links in rustdoc book.
Due to a change in how mdbook generates section anchors, headers
with non-alphabetic characters now start with "a".
2018-07-18 21:10:25 -07:00
kennytm
a07f213974
Rollup merge of #52338 - RalfJung:miri, r=oli-obk
update miri
2018-07-17 19:24:50 +08:00
Alex Crichton
65f3007fa8 rustc: Stabilize much of the proc_macro feature
This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
2018-07-16 07:58:06 -07:00
Ralf Jung
21a179649f update nomicon 2018-07-16 16:36:32 +02:00
eonil
d61540ed0b Update lint plugin sample code. 2018-07-14 21:23:31 +07:00
bors
3ea16c3493 Auto merge of #52018 - flip1995:rfc2103, r=oli-obk
Implementation of tool lints.

Tracking issue: #44690
2018-07-06 18:03:46 +00:00
bors
afaa406465 Auto merge of #51803 - lucasem:rustdoc-code-hash-escape, r=GuillaumeGomez
rustdoc codeblock hash escape

So that docstring text such as the following (in a code block) can be created ergonomically:

```rust
let s = "
    foo
    # bar
    baz
";
```

Such code in a docstring hide the <code>&nbsp;&nbsp;&nbsp;&nbsp;# bar</code> line.

Previously, using two consecutive hashes <code>&nbsp;&nbsp;&nbsp;&nbsp;## bar</code> would turn the line into _shown_ `# bar`, losing the leading whitespace. A line of code like <code>&nbsp;&nbsp;&nbsp;&nbsp;# bar</code> (such as in the example above) **could not be represented** in the docstring text.

This commit makes the two consecutive hashes not also trim the leading whitespace — the two hashes simply **escape** into a single hash and do not hide the line, leaving the rest of that line unaffected. The new docstring text to achieve the above code block is:

```rust
/// ```
/// let s = "
///     foo
///     ## bar
///     baz
/// ";
/// ```
```
2018-07-04 20:21:01 +00:00
Lucas Morales
ff2ff2b2b8
rustdoc book on codeblock hash escaping 2018-07-04 12:41:45 -04:00
flip1995
a9634fcd01
Unstable book documentation of tool lints 2018-07-04 12:16:46 +02:00
bors
309fd8a6fb Auto merge of #49469 - Nokel81:allow-irrefutable-let-patterns, r=nikomatsakis
Implementation of RFC 2086 - Allow Irrefutable Let patterns

This is the set of changes for RFC2086. Tracking issue #44495. Rendered [here](https://github.com/rust-lang/rfcs/pull/2086)
2018-06-26 09:20:33 +00:00
Niko Matsakis
91680347a7
make the while let loop terminate 2018-06-25 17:33:49 -04:00
kennytm
8ef9e2c260
Rollup merge of #51158 - ogham:patch-1, r=steveklabnik
Mention spec and indented blocks in doctest docs

Fixes #49717.

This commit adds a new section to the Documentation Test docs, which briefly mentions indented code blocks, and links to the CommonMark specification for both.

I’m not sure about saying "fenced code blocks the more popular choice in the Rust community” because it seems like I’m speaking for everyone, but I can’t think of a better way to phrase it!
2018-06-22 16:50:39 +08:00
Mark Simulacrum
deaba27861 Update books for next release 2018-06-18 10:34:48 -06:00
Niko Matsakis
d6f13c0e20 update wording, do not change parser 2018-06-12 14:49:17 -04:00
Simon Sapin
e2aef92c19 Stabilize #[repr(transparent)]
Tracking issue FCP: https://github.com/rust-lang/rust/issues/43036#issuecomment-394094318
Reference PR: https://github.com/rust-lang-nursery/reference/pull/353
2018-06-12 06:49:07 +02:00
Simon Sapin
b2d526cc8c Mark alloc_jemalloc as perma-unstable 2018-06-11 13:48:57 -07:00
Simon Sapin
a24924f683 Move Unstable Book sections for #[global_allocator] and System to std::alloc docs 2018-06-11 13:48:57 -07:00
Simon Sapin
fd6e08a1e6 Remove some '#[feature]' attributes for stabilized features 2018-06-11 13:48:57 -07:00
Mike Hommey
f6ab74b8e7 Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAlloc 2018-06-11 13:47:23 -07:00
Guillaume Gomez
861c7cb9fd Stabilize entry-or-default 2018-06-10 12:59:12 +02:00
Niko Matsakis
92d4ae2be2 rename irrefutable_let_pattern to irrefutable_let_patterns 2018-06-08 11:37:35 -04:00
Mark Simulacrum
1225faf1a4
Rollup merge of #51183 - teiesti:rustdoc-book-termination, r=steveklabnik
Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function

Closes #50721.

I suggest that someone double-checks my English since I am not a native speaker.

r? @steveklabnik
2018-06-05 08:33:45 -06:00
Mark Simulacrum
bcba3b9968
Rollup merge of #50852 - mandeep:fix-rustdoc-example-testing, r=GuillaumeGomez
Add doc comment to hiding portions of code example

fixes #50816

Not sure if this is all that's needed, but I think it's a good start. One thing to note is that the code block is a text block where it could possibly be a rust block.
2018-06-05 08:33:43 -06:00
Sebastian Malton
4fe40635ef Implementation of RFC 2086 - Allow Irrefutable Let patterns 2018-06-05 10:19:21 -04:00
Tobias Stolzmann
089da06cc4
Improve wording 2018-06-05 12:03:54 +02:00
Tobias Stolzmann
63885f7f72
Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function 2018-06-05 12:03:50 +02:00
Jorge Aparicio
63f18e108a s/panic_fmt/panic_impl/g in docs 2018-06-03 13:46:19 +02:00
Benjamin Sago
8f8a7b9a7b
Phrasing tweak in doctest docs 2018-05-29 16:04:37 +02:00
Benjamin Sago
9fcc61bf9f
Mention spec and indented blocks in doctest docs
This commit adds a new section to the Documentation Test docs, which briefly mentions indented code blocks, and links to the CommonMark specification for both.

I’m not sure about saying "fenced code blocks the more popular choice in the Rust community” because it seems like I’m speaking for everyone, but I can’t think of a better way to phrase it!
2018-05-29 11:31:14 +02:00
bors
f0805a4421 Auto merge of #51066 - est31:master, r=sfackler
Point to the current box syntax tracking issue

The issue was used for both box syntax as well as placement new.
It got closed due to placement new being unapproved.
So a new one got created for box syntax, yet neither
the unstable book nor feature_gate.rs got updated.
We are doing this now.

r? @aidanhs
2018-05-27 00:54:12 +00:00
est31
20ab8841b1 Point to the current box syntax tracking issue
The issue was used for both box syntax as well as placement new.
It got closed due to placement new being unapproved.
So a new one got created for box syntax, yet neither
the unstable book nor feature_gate.rs got updated.
We are doing this now.
2018-05-26 19:27:21 +02:00