about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2015-06-14Implement RFC 1014Steven Fackler-33/+161
Closes #25977 The various `stdfoo_raw` methods in std::io now return `io::Result`s, since they may not exist on Windows. They will always return `Ok` on Unix-like platforms. [breaking-change]
2015-06-09Auto merge of #25836 - steveklabnik:gh25305, r=alexcrichtonbors-3/+3
Fixes #25794
2015-06-09Auto merge of #26150 - steveklabnik:rollup, r=steveklabnikbors-18/+47
- Successful merges: #26111, #26125, #26129, #26131, #26132, #26133, #26134, #26136, #26140, #26144 - Failed merges:
2015-06-09Rollup merge of #26144 - steveklabnik:static_doc_fix, r=alexcrichtonSteve Klabnik-1/+4
Fixes #25851 I am 99% sure this is true for all `static`s and not just `static mut`, yes?
2015-06-09Rollup merge of #26140 - steveklabnik:gh25803, r=alexcrichtonSteve Klabnik-2/+2
As this example got changed, we stopped showing how to return self as the first example, so this text is outdated. Fixes #25803
2015-06-09Rollup merge of #26136 - steveklabnik:gh25597, r=alexcrichtonSteve Klabnik-3/+7
Fixes #25597
2015-06-09Rollup merge of #26134 - steveklabnik:gh25586, r=alexcrichtonSteve Klabnik-2/+4
After talking with @graydon on #rust-internals, this is hopefully clarifying. Fixes #25586 @mkpankov, what do you think?
2015-06-09Rollup merge of #26133 - steveklabnik:gh25573, r=alexcrichtonSteve Klabnik-4/+0
This obscures more than it helps. Fixes #25573
2015-06-09Rollup merge of #26132 - astraw:fix-demangle-comment, r=alexcrichtonSteve Klabnik-1/+1
Hi, I think the second example fails rule 3 described immediately above. This PR fixes that.
2015-06-09Rollup merge of #26131 - astraw:fix-trait-comment, r=alexcrichtonSteve Klabnik-1/+1
Hi, I think the comments are wrong in the example and this PR offers my suggested fix.
2015-06-09Rollup merge of #26129 - steveklabnik:gh26012, r=brsonSteve Klabnik-0/+25
Fixes #26012
2015-06-09Rollup merge of #26125 - nsimplex:master, r=steveklabnikSteve Klabnik-3/+3
The text claimed 'any borrow must last for a _smaller_ scope than the owner', however the accurate way of describing the comparison is inclusive (i.e., 'less than or equal to' vs. 'less than').
2015-06-09Rollup merge of #26111 - tshepang:consistency, r=brsonSteve Klabnik-1/+0
2015-06-09Make note about static and dtorsSteve Klabnik-1/+4
Fixes #25851
2015-06-09Auto merge of #26039 - SimonSapin:case-mapping, r=alexcrichtonbors-673/+1975
* Add “complex” mappings to `char::to_lowercase` and `char::to_uppercase`, making them yield sometimes more than on `char`: #25800. `str::to_lowercase` and `str::to_uppercase` are affected as well. * Add `char::to_titlecase`, since it’s the same algorithm (just different data). However this does **not** add `str::to_titlecase`, as that would require UAX#29 Unicode Text Segmentation which we decided not to include in of `std`: https://github.com/rust-lang/rfcs/pull/1054 I made `char::to_titlecase` immediately `#[stable]`, since it’s so similar to `char::to_uppercase` that’s already stable. Let me know if it should be `#[unstable]` for a while. * Add a special case for upper-case Sigma in word-final position in `str::to_lowercase`: #26035. This is the only language-independent conditional mapping currently in `SpecialCasing.txt`. * Stabilize `str::to_lowercase` and `str::to_uppercase`. The `&self -> String` on `str` signature seems straightforward enough, and the only relevant issue I’ve found is #24536 about naming. But `char` already has stable methods with the same name, and deprecating them for a rename doesn’t seem worth it. r? @alexcrichton
2015-06-09Fix some copyediting in TRPL: method-syntaxSteve Klabnik-2/+2
As this example got changed, we stopped showing how to return self as the first example, so this text is outdated. Fixes #25803
2015-06-09Explain interaction with if and | in patternsSteve Klabnik-0/+25
Fixes #26012
2015-06-09Expand a bit on clone() in Dining PhilosophersSteve Klabnik-3/+7
Fixes #25597
2015-06-09Clarify confusing sentence in TRPL: FFISteve Klabnik-2/+4
After talking with @graydon on #rust-internals, this is hopefully clarifying. Fixes #25586
2015-06-09remove stuff about #defineSteve Klabnik-4/+0
This obscures more than it helps. Fixes #25573
2015-06-09fix comments in example about typesAndrew Straw-1/+1
2015-06-09fix example in comments about demanglingAndrew Straw-1/+1
2015-06-09Semantic accuracy in borrow scope rules.simplex-3/+3
The text claimed 'any borrow must last for a _smaller_ scope than the owner', however the accurate way of describing the comparison is inclusive (i.e., 'less than or equal to' vs. 'less than').
2015-06-09Move collectionstest::char into coretest::charSimon Sapin-43/+28
2015-06-09Fix coretest::char::test_to_uppercase for complex mappingSimon Sapin-18/+17
2015-06-09Auto merge of #26102 - retep998:openoptionsext, r=alexcrichtonbors-17/+17
r? @alexcrichton
2015-06-09Auto merge of #26068 - bluss:bench-sigfigs, r=huonwbors-8/+35
test: Display benchmark results with thousands separators Example display: ``` running 9 tests test a ... bench: 0 ns/iter (+/- 0) test b ... bench: 52 ns/iter (+/- 0) test c ... bench: 88 ns/iter (+/- 0) test d ... bench: 618 ns/iter (+/- 111) test e ... bench: 5,933 ns/iter (+/- 87) test f ... bench: 59,280 ns/iter (+/- 1,052) test g ... bench: 588,672 ns/iter (+/- 3,381) test h ... bench: 5,894,227 ns/iter (+/- 303,489) test i ... bench: 59,112,382 ns/iter (+/- 1,500,110) ``` Fixes #10953 Fixes #26109
2015-06-09Auto merge of #26098 - russellmcc:add-ar-tool-flexible-target-spec, ↵bors-0/+1
r=alexcrichton Looks like this was missed from af56e2efde5cd82564e32598889d25d798c02722. This will help with defining cross-compile workflows for rust.
2015-06-09Auto merge of #25627 - murarth:execution-engine-fix, r=nrcbors-30/+293
* Removes `RustJITMemoryManager` from public API. This was really sort of an implementation detail to begin with. * `__morestack` is linked to C++ wrapper code and this pointer is used when resolving the symbol for `ExecutionEngine` code. * `__morestack_addr` is also resolved for `ExecutionEngine` code. This function is sometimes referenced in LLVM-generated code, but was not able to be resolved on Mac OS systems. * Added Windows support to `ExecutionEngine` API. * Added a test for basic `ExecutionEngine` functionality.
2015-06-09Auto merge of #26117 - Manishearth:rollup, r=Manishearthbors-36/+85
- Successful merges: #25898, #25909, #25948, #25968, #26073, #26078, #26099, #26104, #26105, #26112, #26113 - Failed merges:
2015-06-09test: Display benchmark results with thousands separatorsUlrik Sverdrup-8/+35
Example display: ``` running 9 tests test a ... bench: 0 ns/iter (+/- 0) test b ... bench: 52 ns/iter (+/- 0) test c ... bench: 88 ns/iter (+/- 0) test d ... bench: 618 ns/iter (+/- 111) test e ... bench: 5,933 ns/iter (+/- 87) test f ... bench: 59,280 ns/iter (+/- 1,052) test g ... bench: 588,672 ns/iter (+/- 3,381) test h ... bench: 5,894,227 ns/iter (+/- 303,489) test i ... bench: 59,112,382 ns/iter (+/- 1,500,110) ``` Fixes #10953 Fixes #26109
2015-06-09Rollup merge of #26113 - tshepang:avoid-abbreviations, r=steveklabnikManish Goregaokar-6/+6
2015-06-09Rollup merge of #26112 - tshepang:readability, r=steveklabnikManish Goregaokar-3/+7
2015-06-09Rollup merge of #26105 - tshepang:sentence-not-clear, r=steveklabnikManish Goregaokar-2/+2
2015-06-09Rollup merge of #26104 - saml:patch-1, r=steveklabnikManish Goregaokar-1/+1
Cargo expects `lib` to be table, not an array of tables (only single lib per project).
2015-06-09Rollup merge of #26099 - TheNeikos:fix-old_array_syntax_in_comments, ↵Manish Goregaokar-6/+6
r=alexcrichton As per RFC#520 the syntax for arrays has changed, this changes the remaining comments to reflect the new syntax. I checked for existing occurences of this with the following command: `ag "\[., \.\..\]"` which by now should only return a single occurence.
2015-06-09Rollup merge of #26078 - diwic:patch-2, r=alexcrichtonManish Goregaokar-1/+1
It was determined that no leaks were unsafe, make the language reference clear about this.
2015-06-09Rollup merge of #26073 - chuckSMASH:trpl-5-4-comments, r=steveklabnikManish Goregaokar-0/+3
For a user following the path of reading Chapter 5: Syntax & Symantics prior to Chapter 4: Learn Rust, this will be the first time they have encountered executable tests inside documentation comments. The test will fail because the `add_one` function is not defined in the context of the doctest. This might not be the optimal place to introduce and explain the `/// #` notation but I think it is important that this snippet pass as a test when `rustdoc --test` is run against it.
2015-06-09Rollup merge of #25968 - benfleis:master, r=steveklabnikManish Goregaokar-1/+3
to address https://github.com/rust-lang/rust/issues/25488 .
2015-06-09Rollup merge of #25948 - tshepang:misc-doc-improvements, r=steveklabnikManish Goregaokar-15/+15
2015-06-09Rollup merge of #25909 - frankamp:patch-1, r=steveklabnikManish Goregaokar-1/+1
The doc indicates that you can replace 'before' with 'after' showing the use of try!. The two examples should be equivalent, but they are not. In the File::create we were inducing a panic before in case of error, not propagating. It is important for newbies (like myself) to understand that try! propagates failures, while unwrap can induce a panic. The other alternative is to make the 'before' File::create also manually handle Err like the other calls. Either way it would be consistent.
2015-06-09Rollup merge of #25898 - azerupi:patch-3, r=steveklabnikManish Goregaokar-0/+40
As mentioned in #25893 the copy trait is not very well explained for beginners. There is no clear mention that all primitive types implement the copy trait and there are not a lot of examples. With this change I try to make it more visible and understandable for new users. I myself have struggled with this, see [my question on stackoverflow](http://stackoverflow.com/questions/30540419/why-are-booleans-copyable-even-though-the-documentation-doesnt-indicate-that). And I want to make it more transparent for others. I filed issue #25893 but I thought that I could give it a shot myself to relieve some of the work from the devs :) If it is not well written or there are some changes to be made before it can be merged, let me know. Cheers, Mathieu
2015-06-09Auto merge of #26065 - Marwes:master, r=alexcrichtonbors-673/+674
PR for #26052 with the new order as written below. ``` //Querying fn len(&self) -> usize fn is_empty(&self) -> bool fn width(&self, is_cjk: bool) -> usize fn is_char_boundary(&self, index: usize) -> bool //Slicing and char retrieval fn as_bytes(&self) -> &[u8] fn as_ptr(&self) -> *const u8 unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &str fn slice_chars(&self, begin: usize, end: usize) -> &str fn char_range_at(&self, start: usize) -> CharRange fn char_range_at_reverse(&self, start: usize) -> CharRange fn char_at(&self, i: usize) -> char fn char_at_reverse(&self, i: usize) -> char fn slice_shift_char(&self) -> Option<(char, &str)> //Iterators fn chars(&self) -> Chars fn char_indices(&self) -> CharIndices fn bytes(&self) -> Bytes fn split_whitespace(&self) -> SplitWhitespace fn words(&self) -> Words fn lines(&self) -> Lines fn lines_any(&self) -> LinesAny fn nfd_chars(&self) -> Decompositions fn nfkd_chars(&self) -> Decompositions fn nfc_chars(&self) -> Recompositions fn nfkc_chars(&self) -> Recompositions fn graphemes(&self, is_extended: bool) -> Graphemes fn grapheme_indices(&self, is_extended: bool) -> GraphemeIndices fn utf16_units(&self) -> Utf16Units //Searching fn contains<'a, P>(&'a self, pat: P) -> bool where P: Pattern<'a> fn starts_with<'a, P>(&'a self, pat: P) -> bool where P: Pattern<'a> fn ends_with<'a, P>(&'a self, pat: P) -> bool where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn find<'a, P>(&'a self, pat: P) -> Option<usize> where P: Pattern<'a> fn rfind<'a, P>(&'a self, pat: P) -> Option<usize> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn split<'a, P>(&'a self, pat: P) -> Split<'a, P> where P: Pattern<'a> fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn split_terminator<'a, P>(&'a self, pat: P) -> SplitTerminator<'a, P> where P: Pattern<'a> fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn splitn<'a, P>(&'a self, count: usize, pat: P) -> SplitN<'a, P> where P: Pattern<'a> fn rsplitn<'a, P>(&'a self, count: usize, pat: P) -> RSplitN<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn matches<'a, P>(&'a self, pat: P) -> Matches<'a, P> where P: Pattern<'a> fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn match_indices<'a, P>(&'a self, pat: P) -> MatchIndices<'a, P> where P: Pattern<'a> fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P> where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> fn subslice_offset(&self, inner: &str) -> usize //Trim fn trim(&self) -> &str fn trim_left(&self) -> &str fn trim_right(&self) -> &str fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str where P: Pattern<'a>, P::Searcher: DoubleEndedSearcher<'a> fn trim_left_matches<'a, P>(&'a self, pat: P) -> &'a str where P: Pattern<'a> fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str where P: Pattern<'a>, P::Searcher: ReverseSearcher<'a> //Conversion fn parse<F>(&self) -> Result<F, F::Err> where F: FromStr fn replace(&self, from: &str, to: &str) -> String fn to_lowercase(&self) -> String fn to_uppercase(&self) -> String fn escape_default(&self) -> String fn escape_unicode(&self) -> String ```
2015-06-08Changes to LLVM `ExecutionEngine` wrapperMurarth-30/+293
* Removes `RustJITMemoryManager` from public API. This was really sort of an implementation detail to begin with. * `__morestack` is linked to C++ wrapper code and this pointer is used when resolving the symbol for `ExecutionEngine` code. * `__morestack_addr` is also resolved for `ExecutionEngine` code. This function is sometimes referenced in LLVM-generated code, but was not able to be resolved on Mac OS systems. * Added Windows support to `ExecutionEngine` API. * Added a test for basic `ExecutionEngine` functionality.
2015-06-08Auto merge of #26079 - eefriedman:emit-closure, r=nrcbors-2/+18
This isn't a very clean fix, but I'm not sure what a better fix would look like. Fixes #24779.
2015-06-09reference: that looks better without those abbreviationsTshepang Lekhonkhobe-6/+6
2015-06-09reference: improve readabilityTshepang Lekhonkhobe-3/+7
2015-06-09reference: get consistent by removing unneeded whitespaceTshepang Lekhonkhobe-1/+0
2015-06-08book: remove a sentence that is not clearTshepang Lekhonkhobe-2/+2
2015-06-08Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichtonbors-108/+107
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.) r? @alexcrichton CC @nagisa