Commit Graph

612 Commits

Author SHA1 Message Date
Steve Klabnik 54baed6dc1 Redirect to the new reference 2017-02-21 14:03:13 -05:00
Steve Klabnik b4cd3d9206 Revert "Fix up links"
This reverts commit 7f1d1c6d9a.

The original commit was created because mdBook and rustdoc had
different generation algorithms for header links; now with
https://github.com/rust-lang/rust/pull/39966 , the algorithms
are the same. So let's undo this change.

... when I came across this problem, I said "eh, this isn't fun,
but it doesn't take that long." I probably should have just actually
taken the time to fix upstream, given that they were amenable. Oh
well!
2017-02-20 09:09:12 -05:00
est31 aebd94fd3c Stabilize field init shorthand
Closes #37340.
2017-02-15 07:11:13 +01:00
Steve Klabnik 7f1d1c6d9a Fix up links
mdbook and rustdoc generate links differently, so we need to change all
these links.
2017-02-13 13:41:24 -05:00
Jake Goulding 037ef0bbc8 Improve grammar on field init docs 2017-02-11 23:42:39 -05:00
Corey Farwell 7f7dc764f5 Rollup merge of #37928 - chriskrycho:document-rfc-1623, r=steveklabnik
Document RFC 1623: static lifetime elision.

This should be the last item required for stabilizing RFC 1623 (#35897).
2017-02-08 23:55:42 -05:00
Chris Krycho 4096dd684c Add more examples, get everything passing at last. 2017-02-08 14:30:31 -05:00
Corey Farwell d1f8c448ff Rollup merge of #39459 - phungleson:fix-short-hand-struct-doc, r=steveklabnik
Fix short hand struct doc

Don't want to discredit @hngiang effort on this issue.

I just want to lend a hand to fix this issue #38830, it is a very nice feature and is seemingly completed.

Fixes #39096

r? @steveklabnik
2017-02-07 22:54:26 -05:00
Alex Burka 620074df6a reference: clarify #[cfg] section 2017-02-07 15:35:54 -05:00
Son 4ddb56bf4d Simplify wording & fix test src/doc 2017-02-03 23:51:50 +11:00
Son c4cd4e19d9 Wrap 80 columns 2017-02-02 22:24:50 +11:00
Giang Nguyen 3388855443 Add explain struct field init shorthand 2017-02-02 22:19:24 +11:00
Chris Krycho 3f0ca55780 Change placement of `[Unstable]` marker in RFC 1623 docs. 2017-01-28 12:45:54 -05:00
Chris Krycho e8cb83a823 Add feature flag to reference docs for RFC 1623. 2017-01-28 09:42:32 -05:00
Eijebong cf4d90db52 Fix minor typo 2017-01-22 17:27:29 +01:00
Oliver Middleton 543eca2eab linkchecker: Fix checking links which are just fragments
Also fix a typo which linkchecker should have caught.
2017-01-20 08:36:09 +00:00
Steve Klabnik 3075c1f65e Document custom derive.
These are some bare-bones documentation for custom derive, needed
to stabilize "macros 1.1",
https://github.com/rust-lang/rust/issues/35900

The book chapter is based off of a blog post by @cbreeden,
https://cbreeden.github.io/Macros11/

Normally, we have a policy of not mentioning external crates in
documentation. However, given that syn/quote are basically neccesary
for properly using macros 1.1, I feel that not including them here
would make the documentation very bad. So the rules should be bent
in this instance.
2017-01-04 17:34:30 -05:00
Chris Krycho ba60af3bbd Document RFC 1623: static lifetime elision. 2017-01-03 19:03:35 -05:00
Corey Farwell 5cdf128410 Document foreign variadic functions in TRPL and the reference.
Fixes https://github.com/rust-lang/rust/issues/38485.
2016-12-27 00:05:53 -08:00
Liigo e095c710f7 Associated items and variants inherit visibility from their traits and enums respectively. 2016-12-13 20:22:34 +08:00
Liigo Zhuang 8323185941 minor fix about visibility in reference 2016-12-13 20:22:33 +08:00
Guillaume Gomez 0b0e7ecd40 Rollup merge of #38163 - durka:patch-33, r=bluss
reference: fix definition of :tt

The reference says that $x:tt matches "either side of the `=>` in macro_rules` which is technically true but completely uninformative. This changes that bullet point to what the book says (a single token or sequence of token trees inside brackets).
2016-12-07 10:42:52 -08:00
Alex Burka dbfcdd45c6 reference: fix definition of :tt
The reference says that $x:tt matches "either side of the `=>` in macro_rules` which is technically true but completely uninformative. This changes that bullet point to what the book says (a single token or sequence of token trees inside brackets).
2016-12-04 15:58:49 -05:00
bors 341f084d8d Auto merge of #38087 - jooert:remove_unmarked, r=petrochenkov
Remove the `unmarked_api` feature

Closes #37981.
2016-12-04 19:47:18 +00:00
jethrogb ecf6f1b96a Update items section in reference
Make clear that items must be definitions, and add missing extern block
2016-12-02 09:19:38 -08:00
Johannes Oertel 7cbd18a690 Remove the `unmarked_api` feature
Closes #37981.
2016-11-30 15:51:04 +01:00
Georg Brandl 4ccc0628af reference: fix duplicate bullet points in feature list 2016-11-19 13:57:48 +01:00
Eduard-Mihai Burtescu e733667210 Rollup merge of #37664 - est31:master, r=nrc
Document the question mark operator in reference and the book's syntax index

The question mark operator will be stabilized for the Rust 1.13 release (unfortunately). Even though I don't like the operator, it still should be documented in the syntax index in the book and in the reference.

Maybe there are people who also want to change the book's chapters on error handling, depending on their views of what idiomatic error handling is, now that the operator is stable, but I don't want to and I'd prefer to keep this PR focused on the reference and syntax index only.

Please also apply this PR to the beta branch of rust.
2016-11-10 03:46:28 +02:00
est31 1e9aad752b Document the question mark operator 2016-11-09 08:37:05 +01:00
Steve Klabnik 8fd202615f Rollup merge of #35102 - steveklabnik:ref_warning, r=aturon
Make it clear that the reference isn't normative

Any time someone edits the reference, it has to be taken very seriously,
since it's the closest thing we have to a specification. This commit
adds language which indicates that this is not a normative document,
which makes it easier to make tweaks without worrying about forever
harming the future of Rust by painting ourselves in a corner.

r? @aturon
2016-11-08 16:20:56 -05:00
bors 38a959a543 Auto merge of #36843 - petrochenkov:dotstab, r=nikomatsakis
Stabilize `..` in tuple (struct) patterns

I'd like to nominate `..` in tuple and tuple struct patterns for stabilization.
This feature is a relatively small extension to existing stable functionality and doesn't have known blockers.
The feature first appeared in Rust 1.10 6 months ago.
An example of use: https://github.com/rust-lang/rust/pull/36203

Closes https://github.com/rust-lang/rust/issues/33627
r? @nikomatsakis
2016-11-08 02:06:45 -08:00
bors 161f2623bd Auto merge of #37386 - johnthagen:Self-reference-example, r=GuillaumeGomez
Add example using Self to reference

When I first came across `Self` I had a hard time finding references to it in the docs (and it's also been asked about on [StackOverflow](http://stackoverflow.com/questions/32304595/whats-the-difference-between-self-and-self).

I hope this example provides someone who comes across it for the first time a little more help.  If there is a better way to show an example actually using `Self`, I'm happy to modify this.  It was just the simplest place to start I could see.
2016-11-06 02:28:58 -08:00
johnthagen 434c314405 Use From trait as an example usage of Self. 2016-11-05 18:21:17 -04:00
Vadim Petrochenkov 74bb594563 Stabilize `..` in tuple (struct) patterns 2016-11-03 01:38:15 +03:00
bors 75a87c54d0 Auto merge of #37378 - petrochenkov:nopat, r=eddyb
Prohibit patterns in trait methods without bodies

They are not properly type checked
```rust
trait Tr {
    fn f(&a: u8); // <- This compiles
}
```
, mostly rejected by the parser already and generally don't make much sense.
This PR is kind of a missing part of https://github.com/rust-lang/rust/pull/35015.

Given the [statistics from crater](https://github.com/rust-lang/rust/pull/37378#issuecomment-256154994), the effect of this PR is mostly equivalent to improving `unused_mut` lint.

cc https://github.com/rust-lang/rust/issues/35078#issuecomment-255707355 https://github.com/rust-lang/rust/pull/35015 https://github.com/rust-lang/rfcs/pull/1685 https://github.com/rust-lang/rust/issues/35203
r? @eddyb
2016-10-29 05:41:05 -07:00
Federico Mena Quintero 9f8d4ee74d reference: Mention --crate-type=cdylib in the Linkage section 2016-10-27 20:23:23 -05:00
Vadim Petrochenkov 811a2b91de Prohibit patterns in trait methods without bodies 2016-10-26 20:55:16 +03:00
Nick Cameron a94f5934cd Stabilise attributes on statements.
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag.

cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
2016-10-12 08:40:22 +13:00
Guillaume Gomez 3e6307644a Rollup merge of #37008 - tshepang:quotes, r=steveklabnik
reference: use ticks instead of quotes
2016-10-07 11:45:05 +02:00
Tshepang Lekhonkhobe 13f9dae8e9 reference: use ticks instead of quotes 2016-10-06 22:29:05 +02:00
angelsl 58190ccb63 reference: mention `move` keyword for lambdas 2016-10-05 00:59:13 +08:00
Wesley Wiser a5244dd66c Add `Send` and `Sync` traits to the reference
Fixes #36859
2016-09-30 09:56:58 -04:00
Andre Bogus df611a62bb added feature description to reference 2016-09-08 07:34:41 +02:00
Andrew Paseltiner e4784fc313
Remove mention of `unsafe_no_drop_flag` from Reference and Nomicon 2016-09-04 22:57:27 -04:00
Jonathan Turner dfe0f88de8 Rollup merge of #35754 - QuietMisdreavus:must-use-reference, r=Manishearth
Add `must_use` to the Reference

I'm a bit uncertain about the exact phrasing, but having it mentioned at all is probably better than before.
2016-09-02 15:28:50 -07:00
CensoredUsername eef4434bf8 Add the sysv64 calling convention to the list of known calling conventions and add the feature(abi_sysv64) to the list of known features 2016-08-30 16:03:06 +02:00
Tshepang Lekhonkhobe ab4c492d68 reference: add trailing commas 2016-08-23 22:25:40 +02:00
QuietMisdreavus 0384722357 Add `must_use` to the Reference 2016-08-17 14:32:32 -05:00
ubsan 7c1bb9ae0d Finish fixing the operator precedence tables
Add the unstable `:` colon and `<-` inplace operators.
2016-08-06 23:57:18 -07:00
ubsan 76babf9c8e Fix precedence table in reference 2016-08-04 13:28:24 -07:00