Commit Graph

43466 Commits

Author SHA1 Message Date
Steve Klabnik
96c7a6b8fe Document str::split behavior with contiguous separators
This can be confusing when whitespace is the separator

Fixes #25986
2015-06-09 14:42:55 -04:00
bors
8a3f5af8c9 Auto merge of #25995 - alexcrichton:msvc-md, r=brson
On MSVC there are two ways that the CRT can be linked, either statically or
dynamically. Each object file produced by the compiler is compiled against
msvcrt (a dll) or libcmt (a static library). When the linker is dealing with
more than one object file, it requires that all object files link to the same
CRT, or else the linker will spit out some errors.

For now, compile code with `-MD` as it seems to appear more often in C libraries
so we'll stick with the same trend.
2015-06-09 18:26:26 +00:00
simplex
0a70c94d68 Semantic accuracy in borrow scope rules.
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-09 13:08:16 -03:00
Ulrik Sverdrup
4fdb4cfa89 Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized> 2015-06-09 16:15:38 +02:00
Marvin Löbel
d6b7ca041a Made ref pattern bindings correctly pick Deref or DerefMut
Added LvaluePreference::from_mutbl

Closes #15609
2015-06-09 16:02:00 +02:00
Simon Sapin
6369dcbad8 Move collectionstest::char into coretest::char 2015-06-09 13:08:29 +02:00
Simon Sapin
c6a8d5e733 Fix coretest::char::test_to_uppercase for complex mapping 2015-06-09 13:08:22 +02:00
bors
7b0f2af27f Auto merge of #26102 - retep998:openoptionsext, r=alexcrichton
r? @alexcrichton
2015-06-09 10:55:04 +00:00
bors
a9f50bdc16 Auto merge of #26068 - bluss:bench-sigfigs, r=huonw
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-09 09:12:09 +00:00
bors
6daf1dcb80 Auto merge of #26098 - russellmcc:add-ar-tool-flexible-target-spec, r=alexcrichton
Looks like this was missed from af56e2efde.

This will help with defining cross-compile workflows for rust.
2015-06-09 06:03:17 +00:00
bors
71a8d313c8 Auto merge of #25627 - murarth:execution-engine-fix, r=nrc
* 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-09 04:28:57 +00:00
bors
a35ea4d358 Auto merge of #26117 - Manishearth:rollup, r=Manishearth
- Successful merges: #25898, #25909, #25948, #25968, #26073, #26078, #26099, #26104, #26105, #26112, #26113
- Failed merges:
2015-06-09 01:34:24 +00:00
Ulrik Sverdrup
2b50c157d6 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-09 02:50:42 +02: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
Manish Goregaokar
0d6f11b09b Rollup merge of #26105 - tshepang:sentence-not-clear, r=steveklabnik 2015-06-09 05:42:28 +05:30
Manish Goregaokar
65eb6c072b Rollup merge of #26104 - saml:patch-1, r=steveklabnik
Cargo expects `lib` to be table, not an array of tables (only single lib per project).
2015-06-09 05:42:28 +05:30
Manish Goregaokar
4b5ac524f3 Rollup merge of #26099 - TheNeikos:fix-old_array_syntax_in_comments, 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-09 05:42:28 +05:30
Manish Goregaokar
c95da07eb0 Rollup merge of #26078 - diwic:patch-2, r=alexcrichton
It was determined that no leaks were unsafe, make the language reference clear about this.
2015-06-09 05:42:27 +05:30
Manish Goregaokar
554f595b86 Rollup merge of #26073 - chuckSMASH:trpl-5-4-comments, r=steveklabnik
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-09 05:42:27 +05:30
Manish Goregaokar
a387078c62 Rollup merge of #25968 - benfleis:master, r=steveklabnik
to address https://github.com/rust-lang/rust/issues/25488 .
2015-06-09 05:42:27 +05:30
Manish Goregaokar
40c598f3fb Rollup merge of #25948 - tshepang:misc-doc-improvements, r=steveklabnik 2015-06-09 05:42:27 +05:30
Manish Goregaokar
0e4a361619 Rollup merge of #25909 - frankamp:patch-1, r=steveklabnik
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-09 05:42:26 +05:30
Manish Goregaokar
91b72011cc Rollup merge of #25898 - azerupi:patch-3, r=steveklabnik
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-09 05:42:26 +05:30
bors
d6c8028ce0 Auto merge of #26065 - Marwes:master, r=alexcrichton
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-09 00:00:35 +00:00
Murarth
021e48326d Changes to LLVM ExecutionEngine wrapper
* 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-08 16:54:50 -07:00
bors
521f82eb12 Auto merge of #26079 - eefriedman:emit-closure, r=nrc
This isn't a very clean fix, but I'm not sure what a better fix would look
like.

Fixes #24779.
2015-06-08 22:26:16 +00:00
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
Tshepang Lekhonkhobe
e305674945 book: remove a sentence that is not clear 2015-06-08 23:35:40 +02:00
bors
02c33b690b Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichton
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
2015-06-08 20:52:33 +00:00
Markus Westerlind
e772818294 Reordered the methods on str to improve doc sorting 2015-06-08 22:18:13 +02:00
saml
a6dd871821 Fixing typo, [[lib]] to [lib]
Cargo expects `lib` to be table, not an array of tables (only single lib per project).
2015-06-08 15:42:33 -04:00
bors
dc72834e2b Auto merge of #26060 - funkill:fix_rustbook, r=alexcrichton
Case: 
Russian translate of trpl use this structure:
```bash
rust_book_ru $ tree
.
├── README.md
├── src
│   ├── academic-research.md
...
└── SUMMARY.md
```
Links in table of content generated relative to the root dir, for example if i'm on the page `http://kgv.github.io/rust_book_ru/src/academic-research.html` link to README.html will be `http://kgv.github.io/rust_book_ru/src/README.html`, not `http://kgv.github.io/rust_book_ru/README.html`.
Now we use old version of rustbook.
Sorry for my english
2015-06-08 19:18:31 +00:00
Peter Atashian
b0d535b2ba OpenOptionsExt on Windows: i32 -> u32
Since all those flags are u32 anyway, avoid unnecessary conversions
[breaking change]

Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-06-08 14:04:22 -04:00
Simon Sapin
c57a4124ff Address a review comment and fix a bootstrapping issue 2015-06-08 19:50:28 +02:00
bors
4e14ef0516 Auto merge of #26044 - nagisa:canonicalize-metadata-loader, r=alexcrichton
This might fail when --extern library is a symlink to an invalid location. Instead just pretend it
doesn’t exist at all.

Fixes #26006
2015-06-08 17:44:30 +00:00
Eli Friedman
2442f830cb Translate "ignored" closure expressions.
This isn't a very clean fix, but I'm not sure what a better fix would look
like.

Fixes #24779.
2015-06-08 10:29:34 -07:00
bors
4a397dd33d Auto merge of #25989 - jooert:implement_rfc839, r=Gankro
I had to use `impl<'a, V: Copy> Extend<(usize, &'a V)> for VecMap<V>` instead of `impl<'a, V: Copy> Extend<(&'a usize, &'a V)> for VecMap<V>` as that's what is needed for doing

```rust
let mut a = VecMap::new();
let b = VecMap::new();
b.insert(1, "foo");

a.extend(&b)
```

I can squash the commits after review.

r? @Gankro
2015-06-08 16:09:56 +00:00
Mathieu David
5efdcf268a Updated with requested changes 2015-06-08 18:01:40 +02:00
Marcel Müller
ebc3de22d8 Fixed old occurences of the removed array syntax
As per RFC#520 the syntax for arrays has changed,
this changes the remaining comments to reflect
the new syntax.
2015-06-08 17:58:08 +02:00
Simon Sapin
c160192f5f Replace usage of String::from_str with String:from 2015-06-08 16:55:35 +02:00
bors
61c43b4733 Auto merge of #26091 - chellmuth:pub-struct-field-span, r=nrc
Issue: #26083 

Re-submitting https://github.com/rust-lang/rust/pull/26084

r? @nrc
2015-06-08 14:35:27 +00:00
Russell McClellan
dd5d018b68 Add ability to change ar tool from target specification json 2015-06-08 09:01:32 -04:00
bors
115121de3d Auto merge of #26088 - tamird:llvm35-fixes, r=alexcrichton
rebase of #25739, closes #25739. r? @alexcrichton
2015-06-08 11:55:04 +00:00
Johannes Oertel
b36ed7d2ed Implement RFC 839
Closes #25976.
2015-06-08 12:05:33 +02:00
bors
1ade076f62 Auto merge of #26029 - GuillaumeGomez:const_check, r=Manishearth
Part of #24407.
2015-06-08 09:54:32 +00:00
Ariel Ben-Yehuda
39b9bea4ba Skip useless recursion in freshening and late-bound-region substitutio
Before:
581.72user 4.75system 7:42.74elapsed 126%CPU (0avgtext+0avgdata 1176224maxresident)k
llvm took 359.183

After:
550.63user 5.09system 7:20.28elapsed 126%CPU (0avgtext+0avgdata 1165516maxresident)k
llvm took 354.801
2015-06-08 12:29:22 +03:00
Guillaume Gomez
ae550bd987 Add error explanation for E0014 2015-06-08 08:18:03 +02:00