summary refs log tree commit diff
path: root/src/doc/reference.md
AgeCommit message (Collapse)AuthorLines
2016-12-14Document the question mark operatorest31-2/+6
2016-11-08Auto merge of #36843 - petrochenkov:dotstab, r=nikomatsakisbors-2/+0
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-06Auto merge of #37386 - johnthagen:Self-reference-example, r=GuillaumeGomezbors-0/+15
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-05Use From trait as an example usage of Self.johnthagen-0/+15
2016-11-03Stabilize `..` in tuple (struct) patternsVadim Petrochenkov-2/+0
2016-10-29Auto merge of #37378 - petrochenkov:nopat, r=eddybbors-3/+3
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-27reference: Mention --crate-type=cdylib in the Linkage sectionFederico Mena Quintero-0/+6
2016-10-26Prohibit patterns in trait methods without bodiesVadim Petrochenkov-3/+3
2016-10-12Stabilise attributes on statements.Nick Cameron-2/+1
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-07Rollup merge of #37008 - tshepang:quotes, r=steveklabnikGuillaume Gomez-3/+3
reference: use ticks instead of quotes
2016-10-06reference: use ticks instead of quotesTshepang Lekhonkhobe-3/+3
2016-10-05reference: mention `move` keyword for lambdasangelsl-2/+7
2016-09-30Add `Send` and `Sync` traits to the referenceWesley Wiser-0/+10
Fixes #36859
2016-09-08added feature description to referenceAndre Bogus-0/+3
2016-09-04Remove mention of `unsafe_no_drop_flag` from Reference and NomiconAndrew Paseltiner-10/+0
2016-09-02Rollup merge of #35754 - QuietMisdreavus:must-use-reference, r=ManishearthJonathan Turner-0/+3
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-08-30Add the sysv64 calling convention to the list of known calling conventions ↵CensoredUsername-0/+4
and add the feature(abi_sysv64) to the list of known features
2016-08-23reference: add trailing commasTshepang Lekhonkhobe-2/+2
2016-08-17Add `must_use` to the ReferenceQuietMisdreavus-0/+3
2016-08-06Finish fixing the operator precedence tablesubsan-1/+2
Add the unstable `:` colon and `<-` inplace operators.
2016-08-04Fix precedence table in referenceubsan-1/+2
2016-07-26Rollup merge of #34461 - ubsan:master, r=steveklabnikSteve Klabnik-2/+31
Fix ABI string docs in reference.md
2016-07-16Rollup merge of #33362 - andradei:master, r=ManishearthGuillaume Gomez-3/+17
Add mention to RFC 940 in the Rust Reference. This PR adds a mention to hyphens in Cargo package names being replaced by underscores when used as a crate, as per [RFC 940](https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md) It also formats the RFCs consistently as RFC XXX instead of RFCXXX.
2016-07-12Rollup merge of #34742 - abhijeetbhagat:master, r=steveklabnikGuillaume Gomez-1/+3
Update on struct expressions Update doc for struct expressions (#32769)
2016-07-10Update on struct expressions (check #32769)abhi-1/+3
2016-06-25Add vectorcall and fastcall explanationubsan-2/+4
2016-06-24First commit, fix ABI string docs in reference.mdubsan-2/+29
2016-06-15include list of charactersAlex Burka-1/+13
2016-06-15update reference for #29734Alex Burka-6/+2
2016-06-14reference: link to proper ffi attributesLiigo Zhuang-1/+1
2016-06-05Update reference to indicate stabilization of `deprecated` attribute.Chris Krycho-2/+1
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-0/+2
2016-05-09Add #[cfg(target_has_atomic)] to get atomic support for the current targetAmanieu d'Antras-0/+5
2016-05-05doc: Update reference with better description of target_envBrian Anderson-18/+26
The definition of this value recently changed slightly. It no longer corresponds directly to the target triple. Also shuffled things around to make the order of cfg descriptions more logical and added text related them to the target triple. cc #33403
2016-05-03Improve language.Isaac Andrade-3/+3
2016-05-02Add mention to RFC 940 in the Rust Reference.Isaac Andrade-3/+17
- It also keeps mentions to RFCs consistent with the format "RFC XXX"
2016-03-26Rollup merge of #32383 - aidanhs:aphs-heap-move-guarantee, r=alexcrichtonManish Goregaokar-0/+3
Document heap allocation location guarantee ``` 14:25 < aidanhs> is there any guarantee that boxes will not move the value on the heap when they are moved? 14:26 <@steveklabnik> aidanhs: ... i'm not sure if it's a guarantee, but it follows, generally 14:26 <@steveklabnik> aidanhs: moves mean memcpy, so you're memcpying the structure of the box itself, which is copying the pointer 14:26 <@steveklabnik> so the pointer won't be updated 14:26 <@steveklabnik> moves cannot do complex things like move the memory around on the heap 14:26 <@kmc> aidanhs: I would say it's guaranteed 14:27 < aidanhs> steveklabnik: yeah, that's what I was thinking, it'd be pretty strange for rust to do something, but I couldn't find any docs one way or the other 14:27 <@steveklabnik> kmc: aidanhs yeah, it's like a borderline thing that we don't explicitly guanratee but i think IS guaranteed by our other guarantees 14:27 <@steveklabnik> mostly that move == memcpy 14:28 < aidanhs> kmc: steveklabnik great thanks! would a PR to the rust reference along these lines be ok? 14:28 < jmesmon> aidanhs: I believe owning_ref has some discussion of that (stable references) 14:29 <@steveklabnik> aidanhs: i would probably take that, yeah 14:29 < aidanhs> jmesmon: thanks, I'll take a look at that ``` https://botbot.me/mozilla/rust/2016-02-22/?msg=60657619&page=18 r? @steveklabnik
2016-03-21Add support for naked functionsTicki-0/+2
2016-03-20Document heap allocation location guaranteeAidan Hobson Sayers-0/+3
2016-03-10Rollup merge of #32149 - steveklabnik:gh31628, r=blussSteve Klabnik-0/+4
Add other primitive types to the reference Fixes #31628
2016-03-09Add other primitive types to the referenceSteve Klabnik-0/+4
Fixes #31628
2016-03-08Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakisSteve Klabnik-0/+10
reference.md: clarify the limitation of type alias on an enum Tentatively define the current behavior as the specification. Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936
2016-03-08Rollup merge of #31772 - nodakai:patch-1, r=steveklabnikSteve Klabnik-3/+9
Clarify the semantics of enum discriminants cf. https://doc.rust-lang.org/error-index.html#E0082 > The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration. It would be great if anyone could check my English.
2016-03-08reference.md: clarify the limitation of type alias on an enumNODA, Kai-0/+10
Cf. rust-lang/rust#26264 Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-07reference.md: clarify negation.NODA, Kai-1/+7
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-07Clarify the semantics of enum discriminantsKai Noda-3/+9
cf. https://doc.rust-lang.org/error-index.html#E0082
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-0/+23
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-3/+0
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-29Add the 'T' present in the rust bookAidan Hobson Sayers-1/+1
2016-02-27document inclusive range syntaxAlex Burka-0/+23