]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAdd explanation for E0116 and update the error message.
Nick Hamann [Tue, 9 Jun 2015 08:05:24 +0000 (03:05 -0500)]
Add explanation for E0116 and update the error message.

Also updates the reference on this point.

9 years agoAuto merge of #26058 - Kimundi:issue15609, r=nikomatsakis
bors [Wed, 10 Jun 2015 03:15:16 +0000 (03:15 +0000)]
Auto merge of #26058 - Kimundi:issue15609, r=nikomatsakis

Closes #15609

9 years agoAuto merge of #26055 - arielb1:smart-fold, r=nikomatsakis
bors [Wed, 10 Jun 2015 01:44:59 +0000 (01:44 +0000)]
Auto merge of #26055 - arielb1:smart-fold, r=nikomatsakis

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

9 years agoAuto merge of #25836 - steveklabnik:gh25305, r=alexcrichton
bors [Tue, 9 Jun 2015 23:11:25 +0000 (23:11 +0000)]
Auto merge of #25836 - steveklabnik:gh25305, r=alexcrichton

Fixes #25794

9 years agoAuto merge of #26150 - steveklabnik:rollup, r=steveklabnik
bors [Tue, 9 Jun 2015 21:36:03 +0000 (21:36 +0000)]
Auto merge of #26150 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #26111, #26125, #26129, #26131, #26132, #26133, #26134, #26136, #26140, #26144
- Failed merges:

9 years agoRollup merge of #26144 - steveklabnik:static_doc_fix, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:45 +0000 (17:24 -0400)]
Rollup merge of #26144 - steveklabnik:static_doc_fix, r=alexcrichton

Fixes #25851

I am 99% sure this is true for all `static`s and not just `static mut`, yes?

9 years agoRollup merge of #26140 - steveklabnik:gh25803, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:45 +0000 (17:24 -0400)]
Rollup merge of #26140 - steveklabnik:gh25803, r=alexcrichton

As this example got changed, we stopped showing how to return self as
the first example, so this text is outdated.

Fixes #25803

9 years agoRollup merge of #26136 - steveklabnik:gh25597, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
Rollup merge of #26136 - steveklabnik:gh25597, r=alexcrichton

Fixes #25597

9 years agoRollup merge of #26134 - steveklabnik:gh25586, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
Rollup merge of #26134 - steveklabnik:gh25586, r=alexcrichton

After talking with @graydon on #rust-internals, this is hopefully clarifying.

Fixes #25586

@mkpankov, what do you think?

9 years agoRollup merge of #26133 - steveklabnik:gh25573, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
Rollup merge of #26133 - steveklabnik:gh25573, r=alexcrichton

This obscures more than it helps.

Fixes #25573

9 years agoRollup merge of #26132 - astraw:fix-demangle-comment, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:44 +0000 (17:24 -0400)]
Rollup merge of #26132 - astraw:fix-demangle-comment, r=alexcrichton

Hi, I think the second example fails rule 3 described immediately above. This PR fixes that.

9 years agoRollup merge of #26131 - astraw:fix-trait-comment, r=alexcrichton
Steve Klabnik [Tue, 9 Jun 2015 21:24:43 +0000 (17:24 -0400)]
Rollup merge of #26131 - astraw:fix-trait-comment, r=alexcrichton

Hi, I think the comments are wrong in the example and this PR offers my suggested fix.

9 years agoRollup merge of #26129 - steveklabnik:gh26012, r=brson
Steve Klabnik [Tue, 9 Jun 2015 21:24:43 +0000 (17:24 -0400)]
Rollup merge of #26129 - steveklabnik:gh26012, r=brson

Fixes #26012

9 years agoRollup merge of #26125 - nsimplex:master, r=steveklabnik
Steve Klabnik [Tue, 9 Jun 2015 21:24:43 +0000 (17:24 -0400)]
Rollup merge of #26125 - nsimplex:master, r=steveklabnik

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').

9 years agoRollup merge of #26111 - tshepang:consistency, r=brson
Steve Klabnik [Tue, 9 Jun 2015 21:24:42 +0000 (17:24 -0400)]
Rollup merge of #26111 - tshepang:consistency, r=brson

9 years agoMake note about static and dtors
Steve Klabnik [Tue, 9 Jun 2015 20:30:39 +0000 (16:30 -0400)]
Make note about static and dtors

Fixes #25851

9 years agoAuto merge of #26039 - SimonSapin:case-mapping, r=alexcrichton
bors [Tue, 9 Jun 2015 20:00:32 +0000 (20:00 +0000)]
Auto merge of #26039 - SimonSapin:case-mapping, r=alexcrichton

* 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

9 years agoFix some copyediting in TRPL: method-syntax
Steve Klabnik [Tue, 9 Jun 2015 19:49:54 +0000 (15:49 -0400)]
Fix some copyediting in TRPL: method-syntax

As this example got changed, we stopped showing how to return self as
the first example, so this text is outdated.

Fixes #25803

9 years agoRemove numbers all together from not_found.html
Steve Klabnik [Tue, 9 Jun 2015 19:47:48 +0000 (15:47 -0400)]
Remove numbers all together from not_found.html

9 years agoExplain interaction with if and | in patterns
Steve Klabnik [Tue, 9 Jun 2015 18:32:10 +0000 (14:32 -0400)]
Explain interaction with if and | in patterns

Fixes #26012

9 years agoExpand a bit on clone() in Dining Philosophers
Steve Klabnik [Tue, 9 Jun 2015 19:24:44 +0000 (15:24 -0400)]
Expand a bit on clone() in Dining Philosophers

Fixes #25597

9 years agoClarify confusing sentence in TRPL: FFI
Steve Klabnik [Tue, 9 Jun 2015 19:17:25 +0000 (15:17 -0400)]
Clarify confusing sentence in TRPL: FFI

After talking with @graydon on #rust-internals, this is hopefully clarifying.

Fixes #25586

9 years agoremove stuff about #define
Steve Klabnik [Tue, 9 Jun 2015 18:59:25 +0000 (14:59 -0400)]
remove stuff about #define

This obscures more than it helps.

Fixes #25573

9 years agofix comments in example about types
Andrew Straw [Tue, 9 Jun 2015 18:49:52 +0000 (20:49 +0200)]
fix comments in example about types

9 years agofix example in comments about demangling
Andrew Straw [Tue, 9 Jun 2015 18:47:51 +0000 (20:47 +0200)]
fix example in comments about demangling

9 years agoAuto merge of #25995 - alexcrichton:msvc-md, r=brson
bors [Tue, 9 Jun 2015 18:26:26 +0000 (18:26 +0000)]
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.

9 years agoSemantic accuracy in borrow scope rules.
simplex [Tue, 9 Jun 2015 16:08:16 +0000 (13:08 -0300)]
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').

9 years agoMade ref pattern bindings correctly pick Deref or DerefMut
Marvin Löbel [Sat, 6 Jun 2015 18:10:23 +0000 (20:10 +0200)]
Made ref pattern bindings correctly pick Deref or DerefMut

Added LvaluePreference::from_mutbl

Closes #15609

9 years agoMove collectionstest::char into coretest::char
Simon Sapin [Tue, 9 Jun 2015 09:38:11 +0000 (11:38 +0200)]
Move collectionstest::char into coretest::char

9 years agoFix coretest::char::test_to_uppercase for complex mapping
Simon Sapin [Tue, 9 Jun 2015 09:37:08 +0000 (11:37 +0200)]
Fix coretest::char::test_to_uppercase for complex mapping

9 years agoAuto merge of #26102 - retep998:openoptionsext, r=alexcrichton
bors [Tue, 9 Jun 2015 10:55:04 +0000 (10:55 +0000)]
Auto merge of #26102 - retep998:openoptionsext, r=alexcrichton

r? @alexcrichton

9 years agoAuto merge of #26068 - bluss:bench-sigfigs, r=huonw
bors [Tue, 9 Jun 2015 09:12:09 +0000 (09:12 +0000)]
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

9 years agoAuto merge of #26098 - russellmcc:add-ar-tool-flexible-target-spec, r=alexcrichton
bors [Tue, 9 Jun 2015 06:03:17 +0000 (06:03 +0000)]
Auto merge of #26098 - russellmcc:add-ar-tool-flexible-target-spec, r=alexcrichton

Looks like this was missed from af56e2efde5cd82564e32598889d25d798c02722.

This will help with defining cross-compile workflows for rust.

9 years agoAuto merge of #25627 - murarth:execution-engine-fix, r=nrc
bors [Tue, 9 Jun 2015 04:28:57 +0000 (04:28 +0000)]
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.

9 years agoAuto merge of #26117 - Manishearth:rollup, r=Manishearth
bors [Tue, 9 Jun 2015 01:34:24 +0000 (01:34 +0000)]
Auto merge of #26117 - Manishearth:rollup, r=Manishearth

- Successful merges: #25898, #25909, #25948, #25968, #26073, #26078, #26099, #26104, #26105, #26112, #26113
- Failed merges:

9 years agotest: Display benchmark results with thousands separators
Ulrik Sverdrup [Sun, 7 Jun 2015 17:23:56 +0000 (19:23 +0200)]
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

9 years agoRollup merge of #26113 - tshepang:avoid-abbreviations, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:29 +0000 (05:42 +0530)]
Rollup merge of #26113 - tshepang:avoid-abbreviations, r=steveklabnik

9 years agoRollup merge of #26112 - tshepang:readability, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:28 +0000 (05:42 +0530)]
Rollup merge of #26112 - tshepang:readability, r=steveklabnik

9 years agoRollup merge of #26105 - tshepang:sentence-not-clear, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:28 +0000 (05:42 +0530)]
Rollup merge of #26105 - tshepang:sentence-not-clear, r=steveklabnik

9 years agoRollup merge of #26104 - saml:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:28 +0000 (05:42 +0530)]
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).

9 years agoRollup merge of #26099 - TheNeikos:fix-old_array_syntax_in_comments, r=alexcrichton
Manish Goregaokar [Tue, 9 Jun 2015 00:12:28 +0000 (05:42 +0530)]
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.

9 years agoRollup merge of #26078 - diwic:patch-2, r=alexcrichton
Manish Goregaokar [Tue, 9 Jun 2015 00:12:27 +0000 (05:42 +0530)]
Rollup merge of #26078 - diwic:patch-2, r=alexcrichton

It was determined that no leaks were unsafe, make the language reference clear about this.

9 years agoRollup merge of #26073 - chuckSMASH:trpl-5-4-comments, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:27 +0000 (05:42 +0530)]
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.

9 years agoRollup merge of #25968 - benfleis:master, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:27 +0000 (05:42 +0530)]
Rollup merge of #25968 - benfleis:master, r=steveklabnik

to address https://github.com/rust-lang/rust/issues/25488 .

9 years agoRollup merge of #25948 - tshepang:misc-doc-improvements, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:27 +0000 (05:42 +0530)]
Rollup merge of #25948 - tshepang:misc-doc-improvements, r=steveklabnik

9 years agoRollup merge of #25909 - frankamp:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:26 +0000 (05:42 +0530)]
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.

9 years agoRollup merge of #25898 - azerupi:patch-3, r=steveklabnik
Manish Goregaokar [Tue, 9 Jun 2015 00:12:26 +0000 (05:42 +0530)]
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

9 years agoAuto merge of #26065 - Marwes:master, r=alexcrichton
bors [Tue, 9 Jun 2015 00:00:35 +0000 (00:00 +0000)]
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
```

9 years agoChanges to LLVM `ExecutionEngine` wrapper
Murarth [Tue, 19 May 2015 23:00:59 +0000 (16:00 -0700)]
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.

9 years agoAuto merge of #26079 - eefriedman:emit-closure, r=nrc
bors [Mon, 8 Jun 2015 22:26:16 +0000 (22:26 +0000)]
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.

9 years agoreference: that looks better without those abbreviations
Tshepang Lekhonkhobe [Mon, 8 Jun 2015 22:20:51 +0000 (00:20 +0200)]
reference: that looks better without those abbreviations

9 years agoreference: improve readability
Tshepang Lekhonkhobe [Mon, 8 Jun 2015 22:16:23 +0000 (00:16 +0200)]
reference: improve readability

9 years agoreference: get consistent by removing unneeded whitespace
Tshepang Lekhonkhobe [Mon, 8 Jun 2015 22:00:20 +0000 (00:00 +0200)]
reference: get consistent by removing unneeded whitespace

9 years agobook: remove a sentence that is not clear
Tshepang Lekhonkhobe [Mon, 8 Jun 2015 19:58:48 +0000 (21:58 +0200)]
book: remove a sentence that is not clear

9 years agoAuto merge of #26077 - SimonSapin:patch-6, r=alexcrichton
bors [Mon, 8 Jun 2015 20:52:33 +0000 (20:52 +0000)]
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

9 years agoReordered the methods on str to improve doc sorting
Markus Westerlind [Mon, 8 Jun 2015 20:18:13 +0000 (22:18 +0200)]
Reordered the methods on str to improve doc sorting

9 years agoFixing typo, [[lib]] to [lib]
saml [Mon, 8 Jun 2015 19:42:33 +0000 (15:42 -0400)]
Fixing typo, [[lib]] to [lib]

Cargo expects `lib` to be table, not an array of tables (only single lib per project).

9 years agoAuto merge of #26060 - funkill:fix_rustbook, r=alexcrichton
bors [Mon, 8 Jun 2015 19:18:31 +0000 (19:18 +0000)]
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

9 years agoOpenOptionsExt on Windows: i32 -> u32
Peter Atashian [Mon, 8 Jun 2015 18:04:22 +0000 (14:04 -0400)]
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>
9 years agoAddress a review comment and fix a bootstrapping issue
Simon Sapin [Mon, 8 Jun 2015 17:43:04 +0000 (19:43 +0200)]
Address a review comment and fix a bootstrapping issue

9 years agoAuto merge of #26044 - nagisa:canonicalize-metadata-loader, r=alexcrichton
bors [Mon, 8 Jun 2015 17:44:30 +0000 (17:44 +0000)]
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

9 years agoTranslate "ignored" closure expressions.
Eli Friedman [Sun, 7 Jun 2015 21:32:37 +0000 (14:32 -0700)]
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.

9 years agoAuto merge of #25989 - jooert:implement_rfc839, r=Gankro
bors [Mon, 8 Jun 2015 16:09:56 +0000 (16:09 +0000)]
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

9 years agoUpdated with requested changes
Mathieu David [Mon, 8 Jun 2015 16:01:40 +0000 (18:01 +0200)]
Updated with requested changes

9 years agoFixed old occurences of the removed array syntax
Marcel Müller [Mon, 8 Jun 2015 15:58:08 +0000 (17:58 +0200)]
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.

9 years agoReplace usage of String::from_str with String:from
Simon Sapin [Mon, 8 Jun 2015 14:55:35 +0000 (16:55 +0200)]
Replace usage of String::from_str with String:from

9 years agoAuto merge of #26091 - chellmuth:pub-struct-field-span, r=nrc
bors [Mon, 8 Jun 2015 14:35:27 +0000 (14:35 +0000)]
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

9 years agoAdd ability to change `ar` tool from target specification json
Russell McClellan [Mon, 8 Jun 2015 13:01:32 +0000 (09:01 -0400)]
Add ability to change `ar` tool from target specification json

9 years agoAuto merge of #26088 - tamird:llvm35-fixes, r=alexcrichton
bors [Mon, 8 Jun 2015 11:55:04 +0000 (11:55 +0000)]
Auto merge of #26088 - tamird:llvm35-fixes, r=alexcrichton

rebase of #25739, closes #25739. r? @alexcrichton

9 years agoImplement RFC 839
Johannes Oertel [Wed, 3 Jun 2015 10:38:42 +0000 (12:38 +0200)]
Implement RFC 839

Closes #25976.

9 years agoAuto merge of #26029 - GuillaumeGomez:const_check, r=Manishearth
bors [Mon, 8 Jun 2015 09:54:32 +0000 (09:54 +0000)]
Auto merge of #26029 - GuillaumeGomez:const_check, r=Manishearth

Part of #24407.

9 years agoSkip useless recursion in freshening and late-bound-region substitutio
Ariel Ben-Yehuda [Fri, 5 Jun 2015 23:06:14 +0000 (02:06 +0300)]
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

9 years agoAdd error explanation for E0014
Guillaume Gomez [Fri, 5 Jun 2015 10:40:18 +0000 (12:40 +0200)]
Add error explanation for E0014

9 years agoAuto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichton
bors [Mon, 8 Jun 2015 04:54:59 +0000 (04:54 +0000)]
Auto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichton

r? @eddyb

9 years agoAdd license
Chris Hellmuth [Mon, 8 Jun 2015 04:33:54 +0000 (22:33 -0600)]
Add license

9 years agoAuto merge of #26018 - nrc:codegen, r=@nikomatsakis
bors [Mon, 8 Jun 2015 03:22:02 +0000 (03:22 +0000)]
Auto merge of #26018 - nrc:codegen, r=@nikomatsakis

Closes #19826

r? @nikomatsakis

There is still some work to do until parallel codegen is perfect - we don't pass make check due to missing the symbol for registering a macro. But we do bootstrap with codegen_units=4 and pass make check without codegen_units, so I think it should land.

For the curious, make rustc-stage2 -j8:

```
codegen_units=1:

real  9m18.074s
user  11m59.858s
sys 0m13.281s

codegen_units=4:

real  6m3.672s
user  13m5.474s
sys 0m12.146s
```

Which is a 33% speedup :-)

9 years agorustc_trans: 'assume' intrinsic is only available on LLVM >= 3.6
David Voit [Sat, 23 May 2015 21:33:37 +0000 (23:33 +0200)]
rustc_trans: 'assume' intrinsic is only available on LLVM >= 3.6

Based on the patch from Luca Bruno.

Instead of creating an empty C function in the rt, this version creates an shim
noop function using llvm. This function is declared as internal, and the
unsupported assume intrinsic and the shim gets completly removed by the
optimizer.

9 years agorustc_trans: don't hardcode llvm version for conditional intrinsics
Luca Bruno [Sat, 24 Jan 2015 11:00:35 +0000 (12:00 +0100)]
rustc_trans: don't hardcode llvm version for conditional intrinsics

This commit introduce a third parameter for compatible_ifn!, as new
intrinsics are being added in recent LLVM releases and there is no
need to hardcode a specific case.

Signed-off-by: Luca Bruno <lucab@debian.org>
9 years agoRemove useless `const`
Tamir Duberstein [Sat, 30 May 2015 13:50:12 +0000 (09:50 -0400)]
Remove useless `const`

9 years agoAuto merge of #26087 - fitzgen:improve-suggestion-hueristics, r=Aatch
bors [Mon, 8 Jun 2015 01:48:59 +0000 (01:48 +0000)]
Auto merge of #26087 - fitzgen:improve-suggestion-hueristics, r=Aatch

This makes the maximum edit distance of typo suggestions a function of the typo'd name's length. FWIW, clang uses this same hueristic, and I've found their suggestions to be better than rustc's. Without something like this, you end up with suggestions that aren't related at all when there are short variable names.

See also https://github.com/rust-lang/rust/issues/20028#issuecomment-109767159

9 years agoMake the maximum edit distance of typo suggestions a function of the typo'd name...
Nick Fitzgerald [Mon, 8 Jun 2015 00:56:18 +0000 (17:56 -0700)]
Make the maximum edit distance of typo suggestions a function of the typo'd name's length.

9 years agoerror due to rebase
Nick Cameron [Mon, 8 Jun 2015 00:18:29 +0000 (12:18 +1200)]
error due to rebase

9 years agoreview changes - only show closure ids in verbose mode
Nick Cameron [Sun, 7 Jun 2015 23:40:56 +0000 (11:40 +1200)]
review changes - only show closure ids in verbose mode

9 years agoDon't visit items in removed branches
Nick Cameron [Thu, 4 Jun 2015 02:04:37 +0000 (14:04 +1200)]
Don't visit items in removed branches

Note that they will be visited anyway by base::trans_item, this just duplicates the items.

9 years agoTidying up, fix some minor linkage bugs, use ty flags to avoid caching closure types.
Nick Cameron [Tue, 2 Jun 2015 23:31:23 +0000 (11:31 +1200)]
Tidying up, fix some minor linkage bugs, use ty flags to avoid caching closure types.

9 years agoAdd a regression test for public struct field spans
Chris Hellmuth [Sun, 7 Jun 2015 23:29:09 +0000 (17:29 -0600)]
Add a regression test for public struct field spans

9 years agoStructField span should include `pub`
Chris Hellmuth [Sun, 7 Jun 2015 22:34:03 +0000 (16:34 -0600)]
StructField span should include `pub`

9 years agoMake all leaks safe in language reference
diwic [Sun, 7 Jun 2015 21:14:01 +0000 (23:14 +0200)]
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.

9 years agoAuto merge of #25912 - tshepang:better-str-examples, r=bluss
bors [Sun, 7 Jun 2015 20:59:20 +0000 (20:59 +0000)]
Auto merge of #25912 - tshepang:better-str-examples, r=bluss

9 years agoDeprecate String::from_str in favor of String::from
Simon Sapin [Sun, 7 Jun 2015 20:36:58 +0000 (22:36 +0200)]
Deprecate String::from_str in favor of String::from

With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical.

9 years agoAuto merge of #26070 - brson:nightlyfix, r=alexcrichton
bors [Sun, 7 Jun 2015 19:25:56 +0000 (19:25 +0000)]
Auto merge of #26070 - brson:nightlyfix, r=alexcrichton

Broken on nightly linux distcheck.

9 years agoUpdate doctest in comments.md
Chuck Bassett [Sun, 7 Jun 2015 19:06:58 +0000 (15:06 -0400)]
Update doctest in comments.md

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 if it is going to be shown.

9 years agodoc: improve some of str examples
Tshepang Lekhonkhobe [Sat, 30 May 2015 20:13:34 +0000 (22:13 +0200)]
doc: improve some of str examples

9 years agotest: Ignore gdb-pretty-struct-and-enums.rs
Brian Anderson [Sun, 7 Jun 2015 18:09:12 +0000 (11:09 -0700)]
test: Ignore gdb-pretty-struct-and-enums.rs

Broken on nightly linux distcheck.

9 years agochange some statics to constants
Oliver 'ker' Schneider [Sun, 7 Jun 2015 17:50:13 +0000 (19:50 +0200)]
change some statics to constants

9 years agoDon’t ICE if fs::canonicalise fails in meta-load
Simonas Kazlauskas [Fri, 5 Jun 2015 22:13:19 +0000 (01:13 +0300)]
Don’t ICE if fs::canonicalise fails in meta-load

This might fail when --extern library is a symlink to an invalid location. Instead just pretend it
doesn’t exist at all.

9 years agoAuto merge of #26066 - steveklabnik:docs_on_a_plane, r=alexcrichton
bors [Sun, 7 Jun 2015 17:04:40 +0000 (17:04 +0000)]
Auto merge of #26066 - steveklabnik:docs_on_a_plane, r=alexcrichton

When things get stabilized, they don't always have their docs updated to remove the gate.

9 years agoAuto merge of #26057 - audebert:master, r=alexcrichton
bors [Sun, 7 Jun 2015 00:07:07 +0000 (00:07 +0000)]
Auto merge of #26057 - audebert:master, r=alexcrichton

The constraint referenced here is:

```rust
fn foo<T>(t: T) where T: Trait<AssociatedType=u32> { /* */ }
```

9 years agoRemove many unneeded feature annotations in the docs
Steve Klabnik [Sat, 6 Jun 2015 22:58:35 +0000 (18:58 -0400)]
Remove many unneeded feature annotations in the docs

When things get stabilized, they don't always have their docs updated to remove the gate.

9 years agoAuto merge of #26047 - chuckSMASH:patch-1, r=alexcrichton
bors [Sat, 6 Jun 2015 21:33:43 +0000 (21:33 +0000)]
Auto merge of #26047 - chuckSMASH:patch-1, r=alexcrichton

The sensible default used here for the version number in the
auto-generated Cargo.toml is 0.1.0, not 0.0.1 (at least as of cargo
0.2.0-nightly efb482d).