Commit Graph

612 Commits

Author SHA1 Message Date
Steve Klabnik c16b0f7060 Rollup merge of #28617 - tshepang:optional, r=steveklabnik 2015-09-24 10:26:36 -06:00
Tshepang Lekhonkhobe 0b13ee0ced reference: rename "structure" to the more familiar "struct" 2015-09-24 08:42:39 +02:00
Tshepang Lekhonkhobe f34eafdcf9 reference: follow idiom in code snippet 2015-09-24 08:25:43 +02:00
Tshepang Lekhonkhobe 996bd9d0d6 reference: 3 of the 4 things mentioned here are optional 2015-09-24 08:22:58 +02:00
Tshepang Lekhonkhobe e0f35da9c1 reference: fix anchor link 2015-09-24 07:55:59 +02:00
Tshepang Lekhonkhobe 5f73037b8a reference: not sure this is the right place to discuss design 2015-09-24 07:50:44 +02:00
Tshepang Lekhonkhobe 16244b884d reference: make that less awkward to read 2015-09-24 07:43:37 +02:00
Tshepang Lekhonkhobe 64cc19d520 reference: "ffi" is normally in upper case 2015-09-24 07:27:16 +02:00
Sebastian Wicki af68cdfea1 rustc: Add target_vendor for target triples
This adds a new target property, `target_vendor` which can be used as a
matcher for conditional compilation. The vendor is part of the autoconf
target triple: <arch><sub>-<vendor>-<os>-<env>

The default value for `target_vendor` is "unknown".

Matching against the `target_vendor` with `#[cfg]` is currently feature
gated as `cfg_target_vendor`.
2015-09-24 01:44:55 +02:00
Vadim Petrochenkov 1eb42f1c78 Add feature gate 2015-09-18 15:28:01 +03:00
Vadim Petrochenkov 605a472948 Add some more tests 2015-09-18 15:26:09 +03:00
Steve Klabnik 7a5cd3c274 Rollup merge of #28473 - tshepang:lowercase, r=steveklabnik 2015-09-17 17:06:56 -04:00
Steve Klabnik cd5870f3a3 Rollup merge of #28471 - tshepang:markup, r=steveklabnik 2015-09-17 17:06:56 -04:00
Tshepang Lekhonkhobe a3305f87c1 reference: actual keywords feel more appropriate 2015-09-17 22:55:40 +02:00
Tshepang Lekhonkhobe 22fc5f480d reference: mark that up to make it more clear it is a keyword 2015-09-17 22:52:39 +02:00
Tshepang Lekhonkhobe 553a2f1ead doc: follow idiom in code snippet 2015-09-17 22:13:05 +02:00
bors eda85fede0 Auto merge of #28348 - petrochenkov:novirt, r=alexcrichton
Noticed these yesterday while reading libsyntax
2015-09-11 17:58:59 +00:00
Vadim Petrochenkov 9f1f4c16aa Remove some remains of virtual structs from the parser 2015-09-11 10:09:22 +03:00
bors 01024c9f61 Auto merge of #28328 - tshepang:unusual, r=brson 2015-09-11 06:28:17 +00:00
bors 9577e42682 Auto merge of #28329 - tshepang:comfort, r=steveklabnik 2015-09-10 13:44:48 +00:00
Tshepang Lekhonkhobe c5a76c692b reference: not comfortable seeing a paragraph starting with a lowercase letter 2015-09-10 06:03:32 +02:00
Tshepang Lekhonkhobe dc6c11816c reference: using periods here is unusual 2015-09-10 05:48:08 +02:00
Tshepang Lekhonkhobe 3860f974a7 reference: format code snippets in an idiomatic manner 2015-09-09 22:35:49 +02:00
christopherdumas 17fde3a34d Removed incorrect reference from #28196 2015-09-03 14:39:34 -07:00
Matt Brubeck 93616af42f Document the recursion_limit crate attribute 2015-08-25 10:02:58 -07:00
Corey Farwell 1629dce494 Use correct indefinite article in reference.md 2015-08-24 17:26:26 -04:00
Matt Brubeck 59b69d4ae7 Include cfg(test) in the reference 2015-08-21 09:54:58 -07:00
Steve Klabnik 288edec968 add cfg(target_env) to the reference
Fixes #27587
2015-08-18 14:24:25 -04:00
Alex Crichton 18607149fb syntax: Add a new unstable #[linked_from] attribute
To correctly reexport statically included libraries from a DLL on Windows, the
compiler will soon need to have knowledge about what symbols are statically
included and which are not. To solve this problem a new unstable
`#[linked_from]` attribute is being added and recognized on `extern` blocks to
indicate which native library the symbols are coming from.

The compiler then keeps track of what the set of FFI symbols are that are
included statically. This information will be used in a future commit to
configure how we invoke the linker on Windows.
2015-08-10 18:20:00 -07:00
Steve Klabnik de98a0b8fe Add an example to Trait section of reference
Fixes #26115
2015-08-05 15:31:19 -04:00
Matt Friedman eaf27799bb add `meta` designator to macro reference 2015-08-04 20:04:11 -05:00
Tshepang Lekhonkhobe 8d331ba8c3 reference: follow idiom in this tiny snippet 2015-08-03 16:07:36 +02:00
bors 184267cac6 Auto merge of #27274 - tshepang:not-needed-word, r=steveklabnik
Also, join the 2 sentences to improve flow
2015-07-27 02:45:35 +00:00
Jared Roesch 55621b6199 Add feature gate 2015-07-25 20:05:42 -07:00
Tshepang Lekhonkhobe 89c302eb6c reference: "those" feels misplaced there
Also, join the 2 sentences to improve flow
2015-07-25 06:56:26 +02:00
Tshepang Lekhonkhobe 36582daebc reference: it is sometimes called "the compiler" in this document 2015-07-25 06:44:32 +02:00
Aidan Hobson Sayers e5c1884c26 Note possiblities of empty extern blocks (based on #12575) 2015-07-21 19:07:21 +01:00
Steve Klabnik d354d41fd5 Merge branch 'more-ref-fixes' of https://github.com/tshepang/rust into rollup_central 2015-07-16 17:55:07 -04:00
Steve Klabnik 72722e3c2b Merge branch 'coercions' of https://github.com/tshepang/rust into rollup_central 2015-07-16 17:54:57 -04:00
Steven Allen 833e88db52 Don't mention packed attribute in reference.md 2015-07-14 14:04:21 -04:00
Tshepang Lekhonkhobe 4ee7047034 reference: miscellaneous fixes 2015-07-08 00:44:50 +02:00
Steve Klabnik 04a85c538a Rollup merge of #26835 - tshepang:copy-or-not, r=steveklabnik 2015-07-06 18:06:31 -04:00
Steve Klabnik c4ee2e5c01 Rollup merge of #26834 - tshepang:space, r=brson 2015-07-06 18:06:31 -04:00
Tshepang Lekhonkhobe dd78ffe828 reference: make 'Move and copied types' section more simple 2015-07-06 22:10:35 +02:00
Tshepang Lekhonkhobe c2f4f11443 reference: do not display the extra space 2015-07-06 22:01:20 +02:00
Steve Klabnik d1fcb2f502 Rollup merge of #26808 - tshepang:closures, r=steveklabnik 2015-07-05 15:12:21 -04:00
Tshepang Lekhonkhobe 10e762eaad reference: 'inherits' is more clear than 'implies' 2015-07-06 01:01:37 +02:00
Steve Klabnik 4c7c7b7477 Rollup merge of #26800 - tshepang:comma, r=Gankro 2015-07-05 15:12:20 -04:00
Steve Klabnik 8b51b8f181 Rollup merge of #26789 - tshepang:improve-array-examples, r=alexcrichton 2015-07-05 15:12:20 -04:00
Tshepang Lekhonkhobe e08bb7f54c reference: remove stray comma 2015-07-05 17:58:46 +02:00
Tshepang Lekhonkhobe 0d3954f4c5 reference: improve coercions section 2015-07-05 17:49:06 +02:00
Steve Klabnik 89d7dd1b33 Rollup merge of #26795 - tshepang:typo, r=steveklabnik 2015-07-05 07:35:16 -04:00
Tshepang Lekhonkhobe a1dd2fb956 reference: fix typo 2015-07-05 16:36:43 +02:00
Steve Klabnik 9d23df481d Rollup merge of #26792 - tshepang:follow-idiom, r=steveklabnik 2015-07-05 07:35:15 -04:00
Tshepang Lekhonkhobe da90ddb5fd reference: improve lambda example 2015-07-05 14:49:08 +02:00
Steve Klabnik 3b3cdb124a Rollup merge of #26791 - tshepang:misc-ref-fixes, r=steveklabnik
One is for grammar, and the other is for clarity
2015-07-05 07:35:15 -04:00
Tshepang Lekhonkhobe 73c1f242e3 reference: tiny fixes
One is for grammar, and the other is for clarity
2015-07-05 14:45:55 +02:00
Steve Klabnik a5f9162909 Rollup merge of #26788 - tshepang:not-exclamation-marks, r=steveklabnik
The sentences are also so short that they don't need periods at the end
2015-07-05 07:35:15 -04:00
Steve Klabnik ec37d456aa Rollup merge of #26787 - tshepang:tuple-usage, r=steveklabnik 2015-07-05 07:35:15 -04:00
Steve Klabnik 08395a9a06 Rollup merge of #26785 - tshepang:inference, r=steveklabnik
…at and integer types
2015-07-05 07:35:14 -04:00
Tshepang Lekhonkhobe f82276d947 reference: improve examples of the different array types 2015-07-05 13:33:06 +02:00
Tshepang Lekhonkhobe f76187c426 reference: that looks like exclamations marks for some fonts
The sentences are also so short that they don't need periods at the end
2015-07-05 13:16:33 +02:00
Tshepang Lekhonkhobe 72c027535a reference: make tuple usage examples more meaningful 2015-07-05 13:04:04 +02:00
Tshepang Lekhonkhobe 4fc28c90f8 reference: improve readability of type inference explanations for float and integer types 2015-07-05 12:31:44 +02:00
Alex Newman 0b7c4f57f6 Add netbsd amd64 support 2015-07-01 19:09:14 -07:00
Alexis Beingessner c98e46c7ca accessing private fields is not safe, and io isn't scary 2015-06-26 11:44:02 -07:00
Manish Goregaokar 3afc385ae1 Rollup merge of #26349 - petrochenkov:bitwise, r=steveklabnik
I'm surprised that bitwise operators `&`, `|` and `^` are implemented for `bool` arguments, because inspection of boolean's bits is not something that should be encouraged and because `&&` -> `&` is a common typo, but if they are implemented, then their behavior should be documented.
2015-06-18 13:38:10 +05:30
Manish Goregaokar 39e4d03e35 Rollup merge of #26342 - steveklabnik:quix_reference_fix, r=alexcrichton
https://github.com/rust-lang/rust/pull/26323/files#r32503568
2015-06-18 13:38:09 +05:30
Vadim Petrochenkov a8f666f1f4 Document behavior of bitwise operators with boolean arguments 2015-06-17 00:44:40 +03:00
bors 10356458a7 Auto merge of #24738 - joliv:patch-2, r=steveklabnik
The "unit value" is a value of the "unit type," not the "unit value type." Regardless of correctness, this straight syntax is easier to grok.

Part of #16676

Sorry if something's off here, it's my first pull request to rust!
2015-06-16 17:08:36 +00:00
Steve Klabnik 5a63326442 One more consistency fix in the reference
https://github.com/rust-lang/rust/pull/26323/files#r32503568
2015-06-16 11:29:20 -04:00
joliv b87056fa31 Add unit type info and update associated link
Fixes #25244
2015-06-15 23:04:55 -04:00
Steve Klabnik 22b6a5dc2a Significantly simplify generic example
Fixes #26320
2015-06-15 16:38:05 -04:00
Matt Brubeck 334ce91443 [reference] Fix typo in extern fn section 2015-06-12 08:08:48 -07:00
Nick Hamann c8b088eb38 Add explanation for E0116 and update the error message.
Also updates the reference on this point.
2015-06-10 02:18:14 -05:00
Steve Klabnik 32c6deec07 Rollup merge of #26111 - tshepang:consistency, r=brson 2015-06-09 17:24:42 -04:00
Manish Goregaokar fd2c76cd94 Rollup merge of #26113 - tshepang:avoid-abbreviations, r=steveklabnik 2015-06-09 05:42:29 +05:30
Manish Goregaokar 38a606ac67 Rollup merge of #26112 - tshepang:readability, r=steveklabnik 2015-06-09 05:42:28 +05:30
Tshepang Lekhonkhobe 76102b0aa7 reference: that looks better without those abbreviations 2015-06-09 00:20:51 +02:00
Tshepang Lekhonkhobe 7abb40c79a reference: improve readability 2015-06-09 00:16:23 +02:00
Tshepang Lekhonkhobe 0d033dd7c2 reference: get consistent by removing unneeded whitespace 2015-06-09 00:00:20 +02:00
diwic 33118eb17a Make all leaks safe in language reference
Since it was determined that no leaks were unsafe, some of the documentation is still not clear about this. Here's one example.
2015-06-07 23:14:01 +02:00
Manish Goregaokar fd3b6ca508 Fix doctest (fixup –#25900) 2015-06-04 11:26:31 +05:30
Manish Goregaokar 8c2806caae Rollup merge of #25900 - lorenzb:more_about_types, r=nikomatsakis
My main sources of information are [RFC401](https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md), the rust IRC channel, and a bunch of experiments to figure out what `rustc` currently supports.
Note that the RFC calls for some coercion behaviour that is not implemented yet (see #18469).
The documentation in this PR mostly covers current behaviour of rust and doesn't document the future behaviour. I haven't written about receiver expression coercion.

I would be happy to rewrite/adapt the PR according to feedback.

r? @steveklabnik
2015-06-04 10:07:02 +05:30
Steve Klabnik 5235065d74 Remove #[static_assert]
This was always a weird feature, and isn't being used in the compiler.
Static assertions should be done better than this.

This implements RFC #1096.

Fixes #13951
Fixes #23008
Fixes #6676

This is behind a feature gate, but that's still a

[breaking-change]
2015-06-03 09:38:13 -04:00
Lorenz babb2684d8 Extend rust reference with a section about type coercions 2015-05-30 14:26:50 +02:00
Lorenz a2b61e16b1 Extend rust reference with a section about subtyping 2015-05-30 14:25:58 +02:00
Liigo Zhuang d061a0f8d5 floating-point types are machine types, not machine-dependent types 2015-05-28 18:11:32 +08:00
Matt Brubeck 54b1608b2d Document the debug_assertions cfg option 2015-05-21 16:34:26 -07:00
Michael Rosenberg d3ac395dcc Update reference.md
Added `Deref` to the "Special Traits" section
2015-05-15 22:07:20 -04:00
Nick Hamann 809be9b7f4 Fix link to RFC 255 in Reference. 2015-05-13 19:07:19 -05:00
Steve Klabnik 87c903a95c Fix test failure in the reference 2015-05-13 17:53:57 -04:00
Nick Hamann b2f486feaf Improve wording for the "Trait objects" section of the reference. 2015-05-12 23:35:27 -05:00
Nick Hamann 857a12a01e Expand the "Traits" section of the reference. 2015-05-12 23:33:10 -05:00
Niko Matsakis 393a37ecbd Correct various small points, expand some sections, while avoiding
too much detail.
2015-05-12 12:02:39 -04:00
Steve Klabnik adf5b84394 Rollup merge of #25283 - steveklabnik:gh24999, r=alexcrichton
and remove references to the unit type, which no longer exists

Fixes #24999
2015-05-11 23:24:19 -04:00
Steve Klabnik f8df5ea8a7 Rollup merge of #25282 - badboy:reference-macro-1, r=alexcrichton
As mentioned in https://github.com/rust-lang/rust/issues/16676#issuecomment-100676326 this makes it a little bit more correct.

I'm a bit unsure whether or not it should be explained that the transcriber can be wrapped in parentheses or curly braces if necessary.
2015-05-11 23:24:18 -04:00
Steve Klabnik dd7d0f5e9c Fix links in the referece
and remove references to the unit type, which no longer exists

Fixes #24999
2015-05-11 12:49:17 -04:00
Manish Goregaokar dec422541b Rollup merge of #25291 - johannhof:let-expressions-example, r=steveklabnik
Maybe it's me, but I really needed an example to understand if let and refutable statements.
Playpen: http://is.gd/mjX3Gf

Let me know if the variable names are too, uh, culinary.
2015-05-11 19:58:57 +05:30
Manish Goregaokar f2c2736cd8 Rollup merge of #25290 - bluss:docfixes, r=steveklabnik
Several Minor API / Reference Documentation Fixes

- Fix a few small errors in the reference.
- Fix paper cuts in the API docs.

Fixes #24882
Fixes #25233
Fixes #25250
2015-05-11 19:58:57 +05:30
Ulrik Sverdrup 12d50b2da0 docs: Fixes in Reference Chapter 6.1 2015-05-11 03:41:54 +02:00
Johann 6a19046423 Four spaces indent, rephrasing 2015-05-11 02:40:02 +02:00
Johann Hofmann 770f0e95a1 Add if let expressions example 2015-05-11 02:03:37 +02:00
Johann Hofmann 295b62dfb9 Docs: Compile-time bounds check in index expression
The reference was claiming all vectors all bounds-checked at run-time, when constant vectors are usually checked at compile-time.

For the changed example see http://is.gd/28ak9E
2015-05-11 01:22:57 +02:00
Jan-Erik Rediger f11c4ba30c Remove extra parentheses 2015-05-10 23:22:00 +02:00
Nick Hamann 7984074e25 Convert #[lang=".."] to #[lang = ".."] for docs too. 2015-05-09 16:08:02 -05:00
Manish Goregaokar ac478ecb50 Rollup merge of #25216 - barosl:no-more-task, r=Manishearth
I've found that there are still huge amounts of occurrences of `task`s in the documentation. This PR tries to eliminate all of them in favor of `thread`.
2015-05-09 18:40:19 +05:30
Carol Nichols bf06163ea7 Remove references to deprecated `extern crate "foo" as bar` syntax
This syntax was removed in b24a3b8 but references remained in the
grammar, the reference, rustdoc generation, and some auxiliary test
files that don't seem to have been used since 812637e.
2015-05-08 20:48:54 -04:00
Barosl Lee ff332b6467 Squeeze the last bits of `task`s in documentation in favor of `thread`
An automated script was run against the `.rs` and `.md` files,
subsituting every occurrence of `task` with `thread`. In the `.rs`
files, only the texts in the comment blocks were affected.
2015-05-09 02:24:18 +09:00
Steve Klabnik 76bbb3237c Rollup merge of #25052 - jooert:misc_attr_reference, r=steveklabnik
Unsafe destructors were removed, added remarks about needed feature gates.

cc #16676 
r? @steveklabnik
2015-05-07 12:21:02 +02:00
Jake Goulding 7826711dcb Clean up the grammar around the inline attribute 2015-05-03 17:52:11 -04:00
Johannes Oertel 685a6f7086 Update "Miscellaneous attributes" section of reference manual 2015-05-02 12:44:57 +02:00
Manish Goregaokar d3b7c5258f Rollup merge of #24992 - steveklabnik:gh24730, r=alexcrichton
Fixes #24730

r? @alexcrichton
2015-05-01 20:20:20 +05:30
Manish Goregaokar 70020aa066 Rollup merge of #24981 - carols10cents:remove-more-priv, r=alexcrichton
Hi! While researching stuff for the reference and the grammar, I came across a few mentions of using the `priv` keyword that was removed in 0.11.0 (#13547, #8122, rust-lang/rfcs#26, [RFC 0026](https://github.com/rust-lang/rfcs/blob/master/text/0026-remove-priv.md)).

One occurrence is a mention in the reference, a few are in comments, and a few are marking test functions. I left the test that makes sure you can't name an ident `priv` since it's still a reserved keyword. I did a little grepping around for `priv `, priv in backticks, `Private` etc and I think the remaining instances are fine, but if anyone knows anywhere in particular I should check for any other lingering mentions of `priv`, please let me know and I would be happy to! 🍂 🌊
2015-05-01 20:20:18 +05:30
Steve Klabnik 8c38dfd537 Describe (a,) vs (a) in docs
Fixes #24730
2015-04-30 15:10:58 -04:00
bors 2568a4d8c5 Auto merge of #24924 - carols10cents:grammar-improvements, r=pnkfelix
I'm interested in helping out with #16676 but more in the grammar than the reference-- here's my first chunk, more to come!! 🎉 

I did pull a bit *out* of the reference, though, that was more relevant to the grammar but wasn't moved over as part of #24729.

I'm looking at, e.g. https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs, as the source of truth, please let me know if I should be checking against something else instead/in addition.

r? @steveklabnik
2015-04-30 17:07:14 +00:00
Carol Nichols 899d4180ef Remove lingering mention of 'priv' in the reference 2015-04-29 22:43:26 -04:00
Alex Crichton a24e036126 rollup merge of #24871: mbrubeck/doc-edit
r? @steveklabnik
2015-04-29 15:45:40 -07:00
Alex Crichton 18a0269d9d rollup merge of #24870: tshepang/reference-fix-brackets
Also, remove the other brackets, because they make the whole sentence look awkward.
2015-04-29 15:45:39 -07:00
Carol Nichols 0ddee94cfe Move explanation that references lexical grammar to the grammar
Reword so that the references to things above/below are up to date and a
bit more specific.
2015-04-28 22:02:53 -04:00
bors 857ef6e272 Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis
Closes #17841.

The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough.

There is still some significant functionality missing from this commit:

 - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~
 - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet.
 - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865.
 - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~

Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-27 16:45:21 +00:00
Matt Brubeck d8797b090f [reference] Fix a typo in 3.4 Whitespace 2015-04-27 09:31:49 -07:00
Tshepang Lekhonkhobe f6c673e9f0 reference: add missing bracket
Also, remove the other brackets, because they make the whole sentence
look awkward.
2015-04-27 16:53:25 +02:00
Steve Klabnik 1b18da4a46 Rollup merge of #24867 - tshepang:patch-3, r=steveklabnik 2015-04-27 10:26:20 -04:00
Tshepang Lekhonkhobe 14a6a9f5e2 reference: block-comment -> block comment 2015-04-27 15:42:46 +02:00
Diggory Hardy cf650a2174 Update reference.md: floating-point section
Clarify type inference of floating-point literals
2015-04-27 12:24:47 +01:00
Diggory Hardy 709f3c5130 Update reference.md: string literals section
Remove the name "multi-line string literal" since the rule appears to affect each line-break individually rather than the whole string literal. Re-word, and remove the stray reference to raw strings.
2015-04-27 11:39:42 +01:00
Robin Kruppe 0ea193def9 Reference audit: comments and whitespace sections 2015-04-26 02:02:13 +02:00
Robin Kruppe 85ee89ae70 Redo PR #24811 properly
Transplant the grammar-related changes to grammar.md,
and remove all grammar talk from reference.md
2015-04-25 22:56:00 +02:00
Manish Goregaokar 007c81b83d Rollup merge of #24811 - rkruppe:reference-audit, r=steveklabnik
Mention `non_ascii_idents` feature gate and remove unused productions.

r? @steveklabnik
2015-04-25 21:18:47 +05:30
Manish Goregaokar 23782ad9a8 Rollup merge of #24809 - conradkleinespel:master, r=Manishearth
The reference has broken links. This should fix it.
2015-04-25 21:18:47 +05:30
Robin Kruppe 702f17566c Audit reference manual: 3.2 Special unicode productions
Mention non_ascii_idents feature gate and remove unused productions
2015-04-25 14:38:23 +02:00
Conrad Kleinespel b66f858e8f fix compiler plugins path in doc/reference.md 2015-04-25 13:43:26 +02:00
Skyler b6dd0197f3 Reference manual 3.5.2.3.1
The description of the syntax for single byte literals is missing the preceding `b` distinction.
2015-04-24 23:26:56 -07:00
Michael Rosenberg 23b1d172a8 More small syntax changes in reference.md 2015-04-24 22:56:32 -04:00
Steve Klabnik c7279b4214 Rollup merge of #24775 - mbrubeck:reference, r=steveklabnik
Update 7.2.20 (`for` expressions):

* `for` loops now use `IntoIterator` instead of just `Iterator`
* Simplify the example by removing unnecessary `Vec::iter` call.

...and a fix for a minor formatting error.

r? @steveklabnik
2015-04-24 22:54:27 -04:00
Steve Klabnik 120065e7f2 Rollup merge of #24766 - nwin:patch-1, r=steveklabnik
Changed in #22838.

audited (raw) byte string literals @ #16676
2015-04-24 22:54:26 -04:00
mdinger 7089c5e79c Remove keywords from reference because they're already in grammar 2015-04-24 16:50:23 -04:00
mdinger 8cf255268c Remove ebnf from reference 2015-04-24 16:50:22 -04:00
Matt Brubeck 331821e3a0 [reference] Update 7.2.20: For expressions.
* `for` loops now use `IntoIterator` instead of just `Iterator`
* Simplify the example by removing unnecessary `Vec::iter` call.
2015-04-24 09:24:53 -07:00
Matt Brubeck 7972fbb735 [reference] Fix missing formatting. 2015-04-24 09:24:53 -07:00
bors 714bd493c7 Auto merge of #24744 - bluss:reference-1, r=steveklabnik
Audit & Edit Chapter 8.1 Types in reference manual

- Remove mention of unit type
- Update closure types and reference types sections
- Fix minor typos
2015-04-24 15:48:35 +00:00
Ulrik Sverdrup b22ea2db9c reference: Audit & Edit chapter 8.1 Types.
- Remove mention of unit type
- Update closure types and reference types sections
- Fix minor typos
2015-04-24 16:55:57 +02:00
Manish Goregaokar 1447ee4c20 Rollup merge of #24727 - rkruppe:reference-audit, r=steveklabnik
It was in pretty good shape, but since that is my pet peeve, I clarified the compiler/interpreter distinction and why it is irrelevant for this section. Otherwise only a couple of minor clarifications, and weasel words where reality is more complicated than the text accounted for (e.g., there is more than one kind of library).

r? @steveklabnik
2015-04-24 19:21:14 +05:30
Manish Goregaokar 0c1df5dadf Rollup merge of #24721 - vosen:patch-1, r=steveklabnik
`us` and `is` were replaced with `usize` and `isize` some time ago. Other than that, 3.5.2.1.5 is correct.
2015-04-24 19:21:14 +05:30
nwin 38c3b62e83 Byte string literals are now fixed-size arrays
Changed in #22838.

audited (raw) byte string literals @ #16676
2015-04-24 11:12:53 +02:00
Manish Goregaokar 131b5aca5a fixup #24754 2015-04-24 10:38:07 +05:30
Manish Goregaokar a33b5d3460 Rollup merge of #24754 - iliekturtles:patch-1, r=steveklabnik 2015-04-24 09:50:16 +05:30
Manish Goregaokar 53d6b38c21 Rollup merge of #24753 - tynopex:patch-1, r=steveklabnik
Add section for range expressions.
2015-04-24 09:49:59 +05:30
Manish Goregaokar f91216bdc2 Rollup merge of #24752 - doomrobo:patch-1, r=steveklabnik
Updated sample code to updated syntax (now compiles). Also tweaked the text to reflect the change.
2015-04-24 09:49:44 +05:30
Manish Goregaokar 76dd69183f Rollup merge of #24750 - withoutboats:patch-1, r=steveklabnik
1) Moved 'while' section below 'loop', 'break', and 'continue'; 2) Added information to 'while' and 'for' loops that they interact with 'break' and 'continue' and may have a lifetime label. 3) Clarified labeling syntax on the infinite loops.
2015-04-24 09:49:27 +05:30
Manish Goregaokar 292a25f755 Rollup merge of #24742 - mbrubeck:keywords, r=steveklabnik
* Add two missing keywords, `Self` and `proc`
* Fix some mis-alphabetized keywords

r? @steveklabnik
2015-04-24 09:48:50 +05:30
Manish Goregaokar 9863f2c4f3 Rollup merge of #24740 - mbrubeck:reference, r=steveklabnik
r? @steveklabnik
2015-04-24 09:48:33 +05:30
Manish Goregaokar cda00831e3 Rollup merge of #24734 - vadimcn:patch-1, r=alexcrichton
'win32' -> 'windows', added 'ios'
2015-04-24 09:47:58 +05:30
Sean Patrick Santos b1db4ec3d0 Feature-gate associated constants. 2015-04-23 21:02:29 -06:00
Mike Boutin 4c2274e1ab Fix spelling errors. 2015-04-23 20:49:27 -04:00
tynopex 4db0efb45c Update reference.md
Add section for range expressions.
2015-04-23 20:38:11 -04:00
Michael Rosenberg 352838ed34 Update "Generic Functions" section
Updated sample code to updated syntax (now compiles). Also tweaked the text to reflect the change.
2015-04-23 20:33:46 -04:00
Lee Aronson 3ae6a5e48d Fixed typo 2015-04-23 16:50:05 -07:00
Lee Aronson da5f80cc6d Improve information about loops
1) Moved 'while' section below 'loop', 'break', and 'continue'; 2) Added information to 'while' and 'for' loops that they interact with 'break' and 'continue' and may have a lifetime label. 3) Clarified labeling syntax on the infinite loops.
2015-04-23 16:46:33 -07:00
Matt Brubeck 4cab21c003 Also mention `/*!` doc comments. 2015-04-23 14:26:07 -07:00
Matt Brubeck 17390a1a79 Update and organize the Keywords table
* Add two missing keywords, `Self` and `proc`
* Fix some mis-alphabetized keywords
2015-04-23 14:15:42 -07:00
Matt Brubeck 1b878379e9 Clarify that //! comments are also doc comments. 2015-04-23 14:03:25 -07:00
Vadim Chugunov 58b3b8bcfa Update supported values of target_os
'win32' -> 'windows', added 'ios'
2015-04-23 12:32:25 -07:00
nwin 99fd7f2131 typo 2 2015-04-23 21:26:34 +02:00
nwin a8f5989afb typo 2015-04-23 21:25:09 +02:00
nwin efb457b8cf object type -> trait object
Consistency. The book also refers to it as trait objects.
2015-04-23 21:23:35 +02:00
Robin Kruppe e9f298082e Reference audit: section 5 (Crates and source files) 2015-04-23 19:06:09 +02:00
Andrzej Janik 5efdbecdf9 Stop mentioning obsolete integer suffixes
`us` and `is` were replaced with `usize` and `isize` some time ago.
2015-04-23 16:39:18 +02:00
Steve Klabnik 0f20c9d8b7 Remove feature gated examples from the reference.
The slice patterns example was nice, so let's put it with the other
slice pattern feature gate documentation.

Fixes #24573
2015-04-20 13:33:57 -04:00
Graydon Hoare a99a8b0a92 Remove obsolete discusison of runtime, promote `Linkage` to chapter. 2015-04-17 20:02:55 -07:00
Graydon Hoare 744085ed1d Improve memory-model section very slightly. 2015-04-17 20:01:03 -07:00
Graydon Hoare f5b2963103 Improve special-traits section very slightly. 2015-04-17 20:00:47 -07:00
Graydon Hoare 7f2f09f1b4 Eliminate the obsolete term 'slot'. 2015-04-17 19:52:29 -07:00
Graydon Hoare 21e2e6eec8 Clean up section on Type aliases. 2015-04-17 19:29:20 -07:00
Graydon Hoare 806d024783 Trim florid language. 2015-04-17 19:24:28 -07:00
Steve Klabnik 00a8d65ef3 document missing attributes in the reference
Fixes #24406
2015-04-16 22:23:37 -04:00
Luke Gallagher 6d36714633 Fix some documentation typos 2015-04-16 22:23:36 -04:00
Tamir Duberstein 29ac04402d Positive case of `len()` -> `is_empty()`
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14 20:26:03 -07:00
Niko Matsakis c35c46821a Fallout in public-facing and semi-public-facing libs 2015-04-01 11:23:45 -04:00
Alex Crichton d4a2c94180 std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.
2015-03-31 15:49:57 -07:00
Manish Goregaokar 470996a749 Rollup merge of #23813 - steveklabnik:gh19733, r=cmr
Fixes #19733
2015-03-31 09:04:36 +05:30
Steve Klabnik 6c0314a38a Make note of noalias in unsafe reference section
Fixes #19733
2015-03-30 12:36:10 -04:00
Alex Crichton d3a4f362cb rollup merge of #23786: alexcrichton/less-quotes
Conflicts:
	src/test/auxiliary/static-function-pointer-aux.rs
	src/test/auxiliary/trait_default_method_xc_aux.rs
	src/test/run-pass/issue-4545.rs
2015-03-27 16:10:25 -07:00
Alex Crichton 990202cd0e rollup merge of #23794: brson/slicegate
Conflicts:
	src/test/run-pass/issue-13027.rs
2015-03-27 16:09:52 -07:00
Brian Anderson 1639e51f6e Feature gate *all* slice patterns. #23121
Until some backwards-compatibility hazards are fixed in #23121,
these need to be unstable.

[breaking-change]
2015-03-27 12:50:49 -07:00
Alex Crichton 3f1d57fcde rollup merge of #23285: steveklabnik/gh11794
Fixes #11794

I mostly removed superflous examples which use the standard library.

I have one more quesiton here though: threads. They're mostly a library thing, at this point, right?
2015-03-27 12:43:59 -07:00
Richo Healey 13e4270bf9 Unquote all crate names without underscores 2015-03-27 10:58:12 -07:00
Alex Crichton 43bfaa4a33 Mass rename uint/int to usize/isize
Now that support has been removed, all lingering use cases are renamed.
2015-03-26 12:10:22 -07:00
Alex Crichton 020efc78f1 rollup merge of #23662: steveklabnik/gh23421
I assume since both shifts say the same thing, I should fix both of them, but then I realized I don't strictly know about left shift.

Fixes #23421

r? @pnkfelix
2015-03-24 14:50:48 -07:00
Steve Klabnik f2e0810cb8 correct reference wrt shifts
Fixes #23421
2015-03-24 12:58:50 -04:00
Brian Anderson e9019101a8 Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
FuGangqiang 7ec80fa31c add lifetime for `while` and `for` expression 2015-03-23 04:54:27 +05:30
FuGangqiang 5836efdfe7 fix the attributes sytax 2015-03-23 04:54:27 +05:30
Johannes Oertel da96d22d3a Rename should_fail to should_panic in docs 2015-03-19 08:24:38 +05:30
Steve Klabnik ac67729baf Remove stdlib stuff from the Reference
Fixes #11794
2015-03-16 17:55:13 -04:00
Nick Cameron 432011d143 Fallout in testing. 2015-03-16 11:03:54 +13:00
mdinger fb0ee646e9 Add monospace font back to literals table 2015-03-12 00:37:47 -04:00
Manish Goregaokar fa8c6d94d0 Rollup merge of #23185 - steveklabnik:gh20051, r=alexcrichton
Fixes #20051
2015-03-10 14:59:39 +05:30
Steve Klabnik 7a86bfc5df Shrink table in the reference
Fixes #20051
2015-03-09 16:51:21 -04:00