Commit graph

43429 commits

Author SHA1 Message Date
Eli Friedman
56ba8feed6 Update libsyntax tests. 2015-10-27 20:09:10 -07:00
Eli Friedman
e5024924ad Make fatal errors more consistent. 2015-10-27 20:09:10 -07:00
Eli Friedman
329e487e58 Start pushing panics outward in lexer. 2015-10-27 20:09:10 -07:00
Eli Friedman
de95857129 Don't panic for fatal errors in attribute parsing. 2015-10-27 20:09:10 -07:00
Eli Friedman
c141f47c24 Delete unnecessary ParserAttr trait. 2015-10-27 20:09:10 -07:00
Eli Friedman
1dd87dcfea Don't use panicking helpers in Parser. 2015-10-27 20:09:10 -07:00
bors
8974297b4a Auto merge of #29313 - arielb1:projection-overflow, r=eddyb
This turns the crashes into overflow errors.

r? @eddyb
2015-10-28 03:07:28 +00:00
bors
f7172490f8 Auto merge of #29311 - steveklabnik:doc_iterator_trait, r=alexcrichton
This cleans up descriptions, adds more examples, and increases
consistency between similar methods.
2015-10-28 01:17:12 +00:00
Vadim Petrochenkov
243a524d06 Fix for middle::reachable + better comments and tests
In `middle::reachable` mark default impl of a trait method as reachable if this trait method is used from inlinable code
2015-10-28 03:38:22 +03:00
Marcell Pardavi
ad8dcb64bf Mention in the docs, that assert! has a second version with a custom message
I recently discovered that this is not mentioned in the docs, only in
the examples, and it's not evident for people coming from C++

r? @steveklabnik
2015-10-28 00:56:27 +01:00
bors
e0e2627374 Auto merge of #29072 - nagisa:place-arrow, r=pnkfelix
This commit generalises parsing of associative operators from left-associative
only (with some ugly hacks to support right-associative assignment) to properly
left/right-associative operators.

Parsing is still is not general enough to handle non-associative,
non-highest-precedence prefix or non-highest-precedence
postfix operators (e.g. `..` range syntax) and should be made to be.

Lastly, this commit adds support for parsing right-associative `<-` (left arrow)
operator with precedence higher than assignment as the operator for placement-in
feature.

---

This PR still needs various non-parser changes (e.g. src/grammar and tests) and I’m still working on these; the meat of the PR can already be reviewed, though, I think.

Please review carefully. I made sure that quirks I have discovered so far are preserved (see e.g. https://github.com/rust-lang/rust/issues/29071) and am looking for more corner cases as I continue to work on tests et al, but there may be something I haven’t noticed or accounted for.

EDIT: I’m also not sure I managed to preserve all the semantics with the range operator inside non-trivial expressions since these are a mess at the moment. Crater runs would be nice.
2015-10-27 22:56:39 +00:00
Niko Matsakis
d0a84e0500 Add some debug printouts to librustc_privacy 2015-10-27 18:30:46 -04:00
Simonas Kazlauskas
99f9bb16ab Adjust src/grammar for the introduced <- op 2015-10-27 23:06:37 +02:00
bors
8a72584f97 Auto merge of #28833 - jryans:borrowck-linear-errors, r=pnkfelix
Change error reporting of conflicting loans to stop earlier after printing
an error for a given borrow, instead of proceeding to error on possibly every
issued loan.  This keeps us down to O(n) errors (for n problem lines), instead
of O(n^2) errors in some cases.

Fixes #27485.
2015-10-27 21:04:59 +00:00
Ariel Ben-Yehuda
7f772bb84e type_of: use sizing_type_of to check the size of arrays
when evaluating a recursive type, the type_of of the interior could be
still in progress, so we can't use that.

Fixes #19001
2015-10-27 23:02:23 +02:00
Simonas Kazlauskas
c1a238c4f5 Add tests for newly introduced syntax
Also add some (regression) tests for discovered parser oddities
2015-10-27 21:55:10 +02:00
Simonas Kazlauskas
662082cb7e Update unused_parens lint for placement-in arrow 2015-10-27 21:55:10 +02:00
Simonas Kazlauskas
972c1c6a5f Fix restrictions when parsing rhs of equalities 2015-10-27 21:55:10 +02:00
Simonas Kazlauskas
58c299f81d Fix prefix range expressions being not parsed 2015-10-27 21:55:04 +02:00
Simonas Kazlauskas
884b58913a Add a test for #29071
Fixes #29071
2015-10-27 21:55:04 +02:00
Simonas Kazlauskas
471f5a1f9a Generalise associative operator parsing
This commit generalises parsing of associative operators from left-associative
only (with some ugly hacks to support right-associative assignment) to properly
left/right-associative operators.

Parsing still is not general enough to handle non-associative,
non-highest-precedence prefix or non-highest-precedence postfix operators (e.g.
`..` range syntax), though. That should be fixed in the future.

Lastly, this commit adds support for parsing right-associative `<-` (left arrow)
operator with precedence higher than assignment as the operator for placement-in
feature.
2015-10-27 21:55:04 +02:00
bors
a1e2a5538a Auto merge of #26421 - nham:fix_21546, r=pnkfelix
Fixes #21546.
2015-10-27 19:15:29 +00:00
Vadim Petrochenkov
8cef018d52 Comments and formatting 2015-10-27 21:56:48 +03:00
Marcell Pardavi
b6f5e7238a Small fix in the book
Fixes #29401.

r? @steveklabnik
2015-10-27 19:02:47 +01:00
bors
540fd3aa71 Auto merge of #26848 - oli-obk:const_fn_const_eval, r=pnkfelix
this has the funky side-effect of also allowing constant evaluation of function calls to functions that are not `const fn` as long as `check_const` didn't mark that function `NOT_CONST`

It's still not possible to call a normal function from a `const fn`, but let statements' initialization value can get const evaluated (this caused the fallout in the overflowing tests)

we can now do this:

```rust
const fn add(x: usize, y: usize) -> usize { x + y }
const ARR: [i32; add(1, 2)] = [5, 6, 7];
```

also added a test for destructuring in const fn args
```rust
const fn i((a, b): (u32, u32)) -> u32 { a + b } //~ ERROR: E0022
```

This is a **[breaking change]**, since it turns some runtime panics into compile-time errors. This statement is true for ANY improvement to the const evaluator.
2015-10-27 17:11:13 +00:00
Jonas Schievink
6c094b9df9 Don't print the same impl twice on ext. overlap 2015-10-27 17:59:32 +01:00
Alex Crichton
98dcde183d mk: Re-add libgcc_s_seh-1.dll to windows dist
Although the compiler itself does not depend on this DLL the `libstdc++-6.dll`
that we're shipping does, so we still need to include it.
2015-10-27 09:40:11 -07:00
Seo Sanghyeon
fb7e325900 Use if let 2015-10-28 01:08:46 +09:00
Steve Klabnik
d91785ab09 Adds tons of documentation for Iterator
This adds lots of examples, clarifies text, and just generally improves
the documentation for Iterator.
2015-10-27 12:00:10 -04:00
bors
679b5a9faa Auto merge of #29327 - sanxiyn:argument, r=nrc
Fix #24114.
2015-10-27 14:25:57 +00:00
Ariel Ben-Yehuda
1220e016bd add a recursion limit for type representation
I could have added a check for explicit recursion, as irregular types
tend to cause selection errors, but I am not sufficiently sure that
cannot be bypassed.

Fixes #22919
Fixes #25639
Fixes #26548
2015-10-27 16:04:43 +02:00
Ariel Ben-Yehuda
867fd0a362 project: add a recursion limit to "tail-recursive" projections
Fixes #21946
Fixes #23992
Fixes #25945
2015-10-27 16:04:06 +02:00
Gleb Kozyrev
2a53edefd7 Implement Default for PhantomData 2015-10-27 15:42:38 +02:00
Jonas Schievink
2560646d91 Diagnostic: "if let arm with incompatible type" 2015-10-27 13:10:41 +01:00
bors
eab5ad529b Auto merge of #29326 - Charlotteis:patch-1, r=steveklabnik
The beginning of the work that needs to be done as part of #28835.

☀️
2015-10-27 10:15:00 +00:00
Oliver Schneider
2b000feba5 the const evaluator might run before check_const
So we cannot assume that the function call was marked NOT_CONST by check_const.
2015-10-27 09:39:07 +01:00
bors
0152a93bb4 Auto merge of #29317 - matklad:clarify-reference, r=steveklabnik
Rust reference is a bit confusing here, because it does not explicitly mention trait objects.

See an example of confusion here https://users.rust-lang.org/t/confusion-about-impls-without-for/3379/2 :)

r? @steveklabnik
2015-10-27 08:27:53 +00:00
bors
996ba1d306 Auto merge of #29309 - rjbs:doc-comment-sections, r=alexcrichton
As displayed before this commit, I found the book confusing in its
explanation of `#`-led comments in `rust` blocks.  Possibly the
biggest confusion was because the many-dashes construct does not
become an HR element in the Markdown translator used, so things were
not being properly set off.

This change should more clearly show the as-rendered content as
rendered, and the as-coded content as code.
2015-10-27 06:40:12 +00:00
bors
cb591e517a Auto merge of #29298 - tbu-:pr_doc_env_panic, r=alexcrichton 2015-10-27 04:45:39 +00:00
bors
5c823615e6 Auto merge of #29386 - jonas-schievink:codegen-worker-id, r=alexcrichton
This makes it easier to tell which thread does how much work. Output now looks like this:
```
time: 0.000; rss: 55MB	llvm function passes [0]
time: 0.000; rss: 55MB	llvm function passes [2]
time: 0.000; rss: 55MB	llvm function passes [1]
time: 0.000; rss: 55MB	llvm module passes [0]
time: 0.000; rss: 55MB	llvm module passes [1]
time: 0.000; rss: 55MB	llvm module passes [2]
time: 0.000; rss: 55MB	llvm function passes [3]
time: 0.000; rss: 55MB	llvm module passes [3]
time: 0.000; rss: 55MB	codegen passes [1]
time: 0.000; rss: 55MB	codegen passes [2]
time: 0.000; rss: 55MB	codegen passes [0]
time: 0.000; rss: 56MB	codegen passes [1]
time: 0.001; rss: 56MB	codegen passes [3]
```
2015-10-27 02:56:57 +00:00
bors
95fb8d1c87 Auto merge of #29325 - alexcrichton:revert-trait-accessibility, r=nrc
These commits revert https://github.com/rust-lang/rust/pull/28504 and add a regression test pointed out by @petrochenkov, it's not immediately clear with the regression that the accessibility check should be removed, so for now preserve the behavior on stable by default.

r? @nrc
2015-10-27 01:04:14 +00:00
bors
05eb81ae11 Auto merge of #29295 - little-dude:rustfmt_librustc_unicode, r=nrc
I didn't see anything particularly weird here. The last commit has the only changes I'm not 100% sure about. 

I ignored tables.rs since it's genrated, but I updated the python script that generates it.

?r @nrc
2015-10-26 23:14:50 +00:00
bors
04475b92f9 Auto merge of #29274 - thepowersgang:issues-29107-const-unsafe-fn-order, r=nikomatsakis
This PR switches the implemented ordering from `unsafe const fn` (as was in the original RFC) to `const unsafe fn` (which is what the lang team decided on)
2015-10-26 21:23:32 +00:00
Jonas Schievink
153c533b27 Print the codegen worker # when using time-passes 2015-10-26 21:03:03 +01:00
bors
2c42c98815 Auto merge of #29384 - nikomatsakis:mir-not-stable-beta, r=alexcrichton 2015-10-26 19:34:14 +00:00
Niko Matsakis
2d5b8b0f2d Disable MIR on beta/stable until we've resolved #29227 is resolved. 2015-10-26 15:05:35 -04:00
bors
278cc2f157 Auto merge of #29287 - Ryman:fn_nopat, r=alexcrichton
Previously, if you copied a signature from a trait definition such as:

```rust
fn foo<'a>(&'a Bar) -> bool {}
```

and moved it into an `impl`, there would be an error message:

"unexpected token `'a`"

Adding to the error message that a pattern is expected should help
users to find the actual problem with using a lifetime here.
2015-10-26 17:44:37 +00:00
Alex Crichton
31fa9167c0 test: Add regression test for "source trait is private" 2015-10-26 10:38:26 -07:00
Corentin Henry
1bb7205082 rustfmt librustc_unicode 2015-10-26 17:57:53 +01:00
Seo Sanghyeon
4e2189fe45 Remove NodeArg 2015-10-27 01:32:04 +09:00
Charlotte Spencer
7447457ef8 Remove use of 'just' in trpl/installing-rust.md
The beginning of the work that needs to be done as part of #28835.
2015-10-26 16:29:54 +00:00
Alex Crichton
cb0ce69026 Revert "Remove unnecessary trait accessibility check."
This reverts commit f4f95eb3a9.
2015-10-26 09:16:05 -07:00
Alex Crichton
0cfdb33720 Revert "Add UFCS privacy test."
This reverts commit b3e1aca40f.
2015-10-26 09:16:01 -07:00
bors
c5d650cf74 Auto merge of #29310 - mdinger:book_playpen, r=steveklabnik
Makes rustbook code playpen links follow the style set in https://github.com/rust-lang/rust/pull/28963. This is basically cut and paste from the other one. The link looks better and still works so I assume it's good.

![rustbook](https://cloud.githubusercontent.com/assets/4156987/10717631/7a74f8ae-7b34-11e5-8870-35b5fc2526a4.png)

Fixes https://github.com/rust-lang/rust/issues/29308

r? @steveklabnik
2015-10-26 15:50:45 +00:00
Seo Sanghyeon
d7944cee12 Distinguish argument from local variable 2015-10-27 00:46:11 +09:00
bors
0b9edc77c5 Auto merge of #29280 - Ryman:bad_docattr, r=Manishearth
As is, this attr would lead to the "///" prefix being in the output text.
2015-10-26 13:58:50 +00:00
bors
7de9c4eea8 Auto merge of #29247 - dcarral:missing_word_trpl, r=steveklabnik
I somehow missed a word behind the numbers while going through this section, don't know what the best approach would be though since "**available** addresses" sounds good to me, too".
2015-10-26 12:08:51 +00:00
bors
bf7eec04d8 Auto merge of #29312 - apasel422:issue-21410, r=alexcrichton
Closes #21410.
Closes #24972.
2015-10-26 10:16:52 +00:00
Aleksey Kladov
32e4ba8f50 reference: clarify impl
Another kind of nominal types in Rust are trait objects, so the following is valid

```rust
trait A {

}

impl A {

}
```
2015-10-26 12:31:17 +03:00
bors
c44316d4a1 Auto merge of #29303 - petrochenkov:unistrimp, r=eddyb
And use `VariantData` instead of `P<VariantData>` in `Item_` and `Variant_`

Improvements suggested by @eddyb in https://github.com/rust-lang/rust/pull/28816#discussion_r42483587 and https://github.com/rust-lang/rust/pull/28816#discussion_r42483648

plugin-[breaking-change]

r? @eddyb
2015-10-26 08:27:59 +00:00
bors
72ed590f8b Auto merge of #29301 - reddraggone9:patch-1, r=alexcrichton
Added a single character to fix a typo in a doc comment.
2015-10-26 06:37:12 +00:00
bors
039b2ca74f Auto merge of #29306 - alexcrichton:yet-another-windows-dist-fix, r=vadimcn
We don't need the support libgcc SEH library, but we do need the C++ standard
library for running the compiler itself.

cc #29208
Closes #29294
2015-10-26 04:48:00 +00:00
bors
908979d53d Auto merge of #29299 - tbu-:pr_btreemap_example_dup, r=alexcrichton 2015-10-26 02:56:27 +00:00
Andrew Paseltiner
fbc53e5a63 Add tests for #21410 and #24972
Closes #21410.
Closes #24972.
2015-10-25 20:32:10 -04:00
bors
c3db627cbf Auto merge of #29296 - zazdxscf:compiletest_noargs_show_help, r=alexcrichton
instead of this panic:
```
thread '<main>' panicked at 'index out of bounds: the len is 1 but the
index is 1', src/libcollections/vec.rs:1110
```

It still panics, just like `-h` does, so it should be okay in this
regard.
2015-10-26 00:19:51 +00:00
bors
f7bde94ea8 Auto merge of #29284 - apasel422:tests, r=alexcrichton
Closes #22781.
Closes #23891.
Closes #24956.
Closes #25145.
Closes #25693.
Closes #26095.
Closes #26459.
Closes #27320.
Closes #27895.
2015-10-25 20:31:48 +00:00
mdinger
a3478e0d16 Update the playpen link for code in the rust book to agree with rustdoc's new style 2015-10-25 16:18:55 -04:00
Ricardo Signes
50611331b4 reformat the docs for hidden code in rust sections
As displayed before this commit, I found the book confusing in its
explanation of `#`-led comments in `rust` blocks.  Possibly the
biggest confusion was because the many-dashes construct does not
become an HR element in the Markdown translator used, so things were
not being properly set off.

This change should more clearly show the as-rendered content as
rendered, and the as-coded content as code.
2015-10-25 16:05:58 -04:00
Tobias Bucher
fe2a47b88a Say that std::env::{set_var, unset_var} *may* panic
Previously the documentation suggested that the documentation about the
panics are guarantees.
2015-10-25 20:03:42 +00:00
bors
2a418216fe Auto merge of #29266 - apasel422:wf, r=alexcrichton
Using these traits in an object context previously resulted in an RFC 1214 warning.
2015-10-25 18:34:29 +00:00
Alex Crichton
d51b432fd7 mk: Package libstdc++-6.dll on x86_64 MinGW
We don't need the support libgcc SEH library, but we do need the C++ standard
library for running the compiler itself.

cc #29208
2015-10-25 10:32:11 -07:00
bors
e02ada6d38 Auto merge of #29254 - alexcrichton:stabilize-1.5, r=brson
This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:

Stabilized APIs:

* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
   is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
  but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`

Deprecated APIs

* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`

Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
2015-10-25 16:38:38 +00:00
Alex Crichton
ff49733274 std: Stabilize library APIs for 1.5
This commit stabilizes and deprecates library APIs whose FCP has closed in the
last cycle, specifically:

Stabilized APIs:

* `fs::canonicalize`
* `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists,
   is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait.
* `Formatter::fill`
* `Formatter::width`
* `Formatter::precision`
* `Formatter::sign_plus`
* `Formatter::sign_minus`
* `Formatter::alternate`
* `Formatter::sign_aware_zero_pad`
* `string::ParseError`
* `Utf8Error::valid_up_to`
* `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}`
* `<[T]>::split_{first,last}{,_mut}`
* `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated
  but will be once 1.5 is released.
* `str::{R,}MatchIndices`
* `str::{r,}match_indices`
* `char::from_u32_unchecked`
* `VecDeque::insert`
* `VecDeque::shrink_to_fit`
* `VecDeque::as_slices`
* `VecDeque::as_mut_slices`
* `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`)
* `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`)
* `Vec::resize`
* `str::slice_mut_unchecked`
* `FileTypeExt`
* `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}`
* `BinaryHeap::from` - `from_vec` deprecated in favor of this
* `BinaryHeap::into_vec` - plus a `Into` impl
* `BinaryHeap::into_sorted_vec`

Deprecated APIs

* `slice::ref_slice`
* `slice::mut_ref_slice`
* `iter::{range_inclusive, RangeInclusive}`
* `std::dynamic_lib`

Closes #27706
Closes #27725
cc #27726 (align not stabilized yet)
Closes #27734
Closes #27737
Closes #27742
Closes #27743
Closes #27772
Closes #27774
Closes #27777
Closes #27781
cc #27788 (a few remaining methods though)
Closes #27790
Closes #27793
Closes #27796
Closes #27810
cc #28147 (not all parts stabilized)
2015-10-25 09:36:32 -07:00
Vadim Petrochenkov
e8ddbba2ed syntax/rustc_front: Simplify VariantData::fields
And use VariantData instead of P<VariantData> in Item_ and Variant_
2015-10-25 18:33:51 +03:00
bors
079f3848c3 Auto merge of #29281 - skeleten:issue-28189, r=steveklabnik
Closes #28189
2015-10-25 14:41:06 +00:00
Lee Jenkins
0044a68249 Fix doc comment typo
Added a single character to fix a typo in a doc comment.
2015-10-25 09:17:27 -05:00
bors
5acda1d3b2 Auto merge of #29279 - Ryman:strtests, r=alexcrichton 2015-10-25 12:44:33 +00:00
Tobias Bucher
5794950c2d Document possible panics for std::env::{set_var, unset_var} 2015-10-25 12:04:29 +00:00
Tobias Bucher
4b45f39f92 Remove key duplication from BTreeMap example in collections 2015-10-25 12:03:21 +00:00
Andrew Paseltiner
671602c8c9 Add tests
Closes #22781.
Closes #23891.
Closes #24956.
Closes #25145.
Closes #25693.
Closes #26095.
Closes #26459.
Closes #27320.
Closes #27895.
2015-10-25 07:37:21 -04:00
Emanuel Czirai
351efd55e9 compiletest: show usage/help when passed no args
instead of this panic:
```
thread '<main>' panicked at 'index out of bounds: the len is 1 but the
index is 1', src/libcollections/vec.rs:1110
```

It still panics, just like `-h` does, so it should be okay in this
regard.
2015-10-25 11:53:47 +01:00
bors
f68cd9aef1 Auto merge of #29273 - Manishearth:regression, r=alexcrichton
None
2015-10-25 10:45:27 +00:00
bors
92dd81ab51 Auto merge of #29272 - sanxiyn:llvm-update, r=alexcrichton
cc @zazdxscf
2015-10-25 08:47:46 +00:00
bors
49b232edaf Auto merge of #29261 - apasel422:issue-22403, r=alexcrichton
Closes #22403.

r? @pnkfelix
2015-10-25 06:48:21 +00:00
John Hodge
f9b8c49cdb Switch to 'const unsafe fn' ordering (rust-lang/rust#29107) 2015-10-25 12:03:07 +08:00
Vadim Petrochenkov
43b4373a23 Tweak stability to not require annotations on impl items and unnamed fields 2015-10-25 05:30:26 +03:00
bors
1d792a64b6 Auto merge of #29256 - alexcrichton:less-flaky, r=brson
The new bots we have may conflict with one another on base ports, causing tests
to fail. For example the linux-musl-64-opt and linux-64-opt bots are using the
same base port right now, causing some spurious failures every now and then.
2015-10-25 02:12:00 +00:00
Vadim Petrochenkov
599df16551 rustc_privacy: Expand public node set, build exported node set more correctly 2015-10-25 04:42:31 +03:00
Kevin Butler
1a235274a1 libsyntax: Consolidate branch to benefit from exhaustive checking instead of unwrapping 2015-10-25 01:34:45 +01:00
Kevin Butler
998914f5da libsyntax: remove panics from Parser::parse_pat_nopanic 2015-10-25 01:33:22 +01:00
Kevin Butler
64da379c8c libsyntax: better error for lifetimes in patterns
Previously, if you copied a signature from a trait definition such as:

```
fn foo<'a>(&'a Bar) -> bool {}
```

and moved it into an `impl`, there would be an error message:

"unexpected token `'a`"

Adding to the error message that a pattern is expected should help
users to find the actual problem with using a lifetime here.
2015-10-25 01:28:00 +01:00
bors
d2f41bd5be Auto merge of #29151 - wthrowe:linker-output-ICE, r=alexcrichton
I suspect this won't work on Windows, but let's be optimistic and try it before disabling.
2015-10-24 21:24:49 +00:00
skeleten
37904063ec adding test for #28189 2015-10-24 21:23:32 +02:00
Kevin Butler
315f76202f Fix docattr to match surrounding text
As is, this attr would lead to the "///" prefix being in the output text
2015-10-24 20:00:58 +01:00
Kevin Butler
83b308e585 Add assertions to test_total_ord for str 2015-10-24 19:53:42 +01:00
Kevin Butler
49c78789ce Remove unnecessary String allocations from str tests 2015-10-24 19:53:33 +01:00
bors
8d86d1a4e1 Auto merge of #29215 - fhahn:issue-28157-bad-semicolon, r=alexcrichton
PR for #28157. At the moment, `rustc` emits a warning when a bare semicolon is encountered (could also be a fail, but I think this is a backwards incompatible change).

Also I am not sure where the best place for a test for that warning would be. Seems run-pass tests do not check warnings.
2015-10-24 18:37:09 +00:00
Manish Goregaokar
aec5576623 Add regression test for #26886
(fixes #26886)
2015-10-24 18:01:06 +05:30
bors
04e497c005 Auto merge of #29259 - arielb1:supertrait-self-2, r=eddyb
…being it

This is a [breaking-change]:lang, but the broken code does not make
much sense.

Fixes #26056

r? @eddyb
2015-10-24 12:21:12 +00:00
Seo Sanghyeon
b285f92025 rustllvm: Update to LLVM trunk 2015-10-24 18:42:23 +09:00
bors
43869e94ab Auto merge of #29260 - GuillaumeGomez:E0211_improvement, r=Manishearth
r? @Manishearth

cc #29248
2015-10-24 09:15:14 +00:00
bors
8d41c6fc0a Auto merge of #29252 - steveklabnik:safety, r=alexcrichton
Follow https://doc.rust-lang.org/book/documentation.html#special-sections
2015-10-24 06:26:50 +00:00
mdinger
11c7bdd160 Add colors for rustdoc primitives, type, and macros links 2015-10-23 21:59:48 -04:00
Andrew Paseltiner
863bb1f515 Make {Default, From, FromIterator, One, Zero} well-formed
Using these traits in an object context previously resulted in an RFC
1214 warning.
2015-10-23 21:56:23 -04:00
bors
d689182e5d Auto merge of #29245 - james-darkfox:master, r=alexcrichton 2015-10-24 01:19:26 +00:00
mdinger
b1e3baa5b4 Merge same colors together 2015-10-23 21:07:09 -04:00
Andrew Paseltiner
b83235f76f Add test for #22403
Closes #22403.
2015-10-23 20:15:33 -04:00
Guillaume Gomez
77053e20ba Improve E0211 error diagnostic 2015-10-24 00:49:12 +02:00
Florian Hahn
1e62bd2754 Allow bare semicolon in grammar doc, closes #28157 2015-10-24 00:45:18 +02:00
Florian Hahn
107b4aa329 Remove bare semicolons 2015-10-24 00:35:44 +02:00
bors
525ab4a413 Auto merge of #29065 - steveklabnik:doc_iter_traits, r=alexcrichton
This adds a bunch of documentation for most of the traits in std::iter
2015-10-23 21:35:59 +00:00
Ariel Ben-Yehuda
5d6d26c241 object_safety: check whether a supertrait contains Self even without being it
This is a [breaking-change]:lang, but the broken code does not make
much sense.

Fixes #26056
2015-10-24 00:22:29 +03:00
William Throwe
a1c8431f82 Add a regression test for #29122 (fixed in #29134) 2015-10-23 17:11:33 -04:00
Steve Klabnik
608cb84955 Document a bunch of std::iter traits
This adds a bunch of documentation for most of the traits in std::iter
2015-10-23 16:03:52 -04:00
bors
bbb5f8e12e Auto merge of #29241 - nikomatsakis:issue-28871, r=arielb1
Give preference to projections from where-clauses over those from trait definitions. This makes #28871 work again, though I think there's more to fix in this general area.

r? @arielb1 
cc @brson (fixes regression)
2015-10-23 19:46:57 +00:00
James McGlashan
36ce1c06a4 Implements Default for mutable slices. Fixes: #29244 2015-10-24 05:17:35 +11:00
Alex Crichton
2098ff4a33 std: Add more entries to stdtest base_port
The new bots we have may conflict with one another on base ports, causing tests
to fail. For example the linux-musl-64-opt and linux-64-opt bots are using the
same base port right now, causing some spurious failures every now and then.
2015-10-23 10:51:48 -07:00
bors
7ee4e9e7ec Auto merge of #29243 - skeleten:issue-29184, r=alexcrichton
Fixes #29184 

This adds an error message for the use of the reserved `typeof` keyword, instead of reporting an ICE.
Also adds a `compile-fail` test.

I chose to add a `span_err` instead of removing to parser code, as to preserve the reservation of `typeof`.
2015-10-23 16:53:40 +00:00
Vadim Chugunov
afc3046515 Drop advapi32 and shell32 from late_link_args. 2015-10-23 09:35:02 -07:00
Steve Klabnik
b17433292d Unsafety -> Safety in doc headings
Follow https://doc.rust-lang.org/book/documentation.html#special-sections
2015-10-23 11:42:14 -04:00
Niko Matsakis
b69e08ceca add main fn to test 2015-10-23 11:04:38 -04:00
skeleten
044a8fe6f6 Add error message for using typeof instead of an ICE.
This adds error E0516

fixing a type pointed out by @jonas-schievink
2015-10-23 16:34:47 +02:00
Daniel Carral
2e0e32f4eb Add missing word to TRPL's 'The Heap' section 2015-10-23 12:37:46 +02:00
bors
9a855668fc Auto merge of #29194 - chrisccerami:clarify-headers-in-traits-docs, r=Manishearth
It's possible that there is some meaning I'm not grasping from the headers "Traits bounds for generic functions" and "Traits bounds for generic structs", but they seem to me like they could be clearer and more grammatically correct.
2015-10-23 09:06:24 +00:00
bors
3f37f5a443 Auto merge of #29242 - matklad:fix-comment, r=alexcrichton
Qualified paths allow full path after the `>::`. For example

```rust
<T as Foo>::U::generic_method::<f64>()
```

The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2015-10-23 06:51:24 +00:00
Chris C Cerami
00c1419e32 Define bounds in glossary.md 2015-10-23 00:45:44 -04:00
bors
e518c057f5 Auto merge of #27894 - steveklabnik:gh26888, r=alexcrichton
{BTree,Hash}{Map,Set} will not update their key if it already exists, which
can matter with more complex keys. This behavior is now documented.

Fixes #26888
2015-10-23 03:13:10 +00:00
Steve Klabnik
e8e3c6f386 Document replacement behavior in some collections
{BTree,Hash}{Map,Set} will not update their key if it already exists, which
can matter with more complex keys. This behavior is now documented.

Fixes #26888
2015-10-22 20:30:42 -04:00
bors
414d68ec72 Auto merge of #29216 - steveklabnik:fix_libc, r=alexcrichton
This is needed to release a new version of libc

r? @alexcrichton
2015-10-23 00:24:14 +00:00
Aleksey Kladov
bf2f1e512a parser: fix erroneous comment
Qualified paths allow full path after the `>::`. For example

```rust
<T as Foo>::U::generic_method::<f64>()
```

The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2015-10-23 02:17:03 +03:00
Nick Hamann
f0af1eb110 Warn when creating a module and a struct that both have the same name.
Currently it is possible to do the following:

 - define a module named `Foo` and then a unit or tuple struct also named `Foo`
 - define any struct named `Foo` and then a module named `Foo`

This commit introduces a warning for both of these cases.
2015-10-22 17:12:16 -05:00
Niko Matsakis
b48b6eaf75 fix bug in hir,identified 2015-10-22 16:58:08 -04:00
Niko Matsakis
e5bc5c7aa0 improve Scope to print node-ids etc 2015-10-22 16:58:08 -04:00
Niko Matsakis
8fa5f09a8f distinguish projections from the env/obj-types vs those from
trait definitions, and give prefence to the former. This is consistent
with what we do for selection. It also works around a limitation
that was leading to #28871.
2015-10-22 16:58:08 -04:00
Steve Klabnik
b51d5e10b2 Rollup merge of #29230 - tsion:fix-nomicon-typo-2, r=steveklabnik
r? @steveklabnik
2015-10-22 12:43:50 -04:00
Steve Klabnik
7aa39a60dd Rollup merge of #29224 - wesleywiser:patch-2, r=alexcrichton
Fixes #29219
2015-10-22 12:43:50 -04:00
Steve Klabnik
7b608dfacd Rollup merge of #29213 - apasel422:unsafe-cell, r=Gankro
r? @alexcrichton
2015-10-22 12:43:49 -04:00
Steve Klabnik
58fed892c5 Rollup merge of #29207 - ykomatsu:trpl, r=steveklabnik 2015-10-22 12:43:49 -04:00
Steve Klabnik
94326e1916 Rollup merge of #29193 - kini:filename-conventions, r=alexcrichton
When reading this paragraph, the beginning Rust programmer is starting
to write a Hello World program.  We have just told her to name the file
`main.rs`, and immediately afterward, a `hello_world.rs` is mentioned.
I changed this to an unrelated filename (incidentally one that appears
in this repository) to make it clear that this is just an example.
Also, wording it as a declarative sentence rather than an imperative one
further separates it from the Hello World instructions in this section.

r? @steveklabnik 

(Let me know if I'm sending too many PRs -- I can batch up TRPL edits, say, per chapter, if that works better. Or I can just refrain from editing TRPL as I read through it, if these are not sufficiently useful.)
2015-10-22 12:43:49 -04:00
Steve Klabnik
7a16b95d4a Rollup merge of #29170 - kini:curl-sh-disclaimer, r=steveklabnik
The paragraph here seemed confusing, so I reworded it.  Also added
another possible reason why `curl | sh` might be objectionable to users.

r? @steveklabnik
2015-10-22 12:43:48 -04:00
bors
83cf3ce498 Auto merge of #29170 - kini:curl-sh-disclaimer, r=steveklabnik
The paragraph here seemed confusing, so I reworded it.  Also added
another possible reason why `curl | sh` might be objectionable to users.

r? @steveklabnik
2015-10-22 16:37:28 +00:00
Steve Klabnik
dd8ae4f64e Fix build of libc on stable
This is needed to release a new version of libc
2015-10-22 11:44:16 -04:00
bors
ca998fc2f1 Auto merge of #29018 - tsion:doc-typo, r=steveklabnik
r? @steveklabnik
2015-10-22 13:12:20 +00:00
Scott Olson
6003b479a0 Add missing "to" in Rustonomicon Atomics. 2015-10-22 03:33:47 -06:00
bors
e7b2052f34 Auto merge of #28355 - DiamondLovesYou:pnacl-librustc-trans, r=alexcrichton
r? @alexcrichton
2015-10-22 08:35:38 +00:00
bors
5eac68cca7 Auto merge of #29210 - arielb1:suggest-overflow, r=eddyb
This prevents a stack-overflow when the module graph was cyclic.

Fixes #29181 

r? @eddyb
2015-10-22 06:47:27 +00:00
Wesley Wiser
3673978539 Fix doc sample for Cursor
Fixes #29219
2015-10-21 22:33:24 -04:00
bors
7bb0ac59b1 Auto merge of #29045 - mseri:patch-4, r=nrc
r? @nrc

Nothing special going on, the only real notable change is the explicit ABI on line 6183. 
I re-onlined some extern on top of the file by hand.
2015-10-22 02:28:36 +00:00
bors
5692e16270 Auto merge of #28963 - mdinger:arrow, r=steveklabnik
This is to make the link more prominent so hopefully people will actually see it. The new icon is partially because I wasn't sure how easy it would be to apply the previous transformations only to the last character of the string. As it is, I wasn't sure at first but I think the look is growing on me.

A minor nitpick is that the space after `Runnable` is underlined and I tried to fix that but it wasn't working for me right now. I tried switching a link with subelements to a div with subelements but I missed something because it wasn't working correctly.

---
Unselected:

![arrow](https://cloud.githubusercontent.com/assets/4156987/10414475/b1730ab2-6fa4-11e5-9062-15bc0c7c8b96.png)

---

Selected:

![arrow_selected](https://cloud.githubusercontent.com/assets/4156987/10414483/4a78088e-6fa5-11e5-864e-c83f354769b1.png)

Fixes https://github.com/rust-lang/rust/issues/28958
2015-10-22 00:41:21 +00:00
Yoshito Komatsu
f609d17573 Correct a previous patch 2015-10-22 09:17:04 +09:00
Richard Diamond
e497d4a4e2 Add the PNaCl/JS targets to the backend. 2015-10-21 19:11:44 -05:00
Andrew Paseltiner
f657e134cb Remove obsolete note about UnsafeCell's fields 2015-10-21 14:17:39 -04:00
Ariel Ben-Yehuda
ad4cdf7077 don't revisit modules while finding traits in suggest
Fixes #29181
2015-10-21 20:18:21 +03:00
Vadim Chugunov
d710f8ba1f Moar comments. 2015-10-21 10:05:27 -07:00
bors
e7690e7764 Auto merge of #29206 - apasel422:issue-28936, r=alexcrichton
Closes #28936.
2015-10-21 16:37:31 +00:00
bors
ea2dabf6b2 Auto merge of #29138 - ykomatsu:trpl2, r=Manishearth 2015-10-21 14:45:48 +00:00
Yoshito Komatsu
55796c07b8 Fix some typos in TRPL 2015-10-21 22:17:23 +09:00
bors
58d782d777 Auto merge of #29179 - cjdrake:fixup, r=steveklabnik
This is a pretty trivial change. My eye caught some inconsistent whitespace while perusing compiler errors tonight. Specifically, I changed `//correct` to `// correct`, and got rid of some trailing whitespace that isn't seen in other code snippets.
2015-10-21 12:56:24 +00:00
Andrew Paseltiner
0f6b71846c Add test for #28936
Closes #28936.
2015-10-21 08:40:33 -04:00
bors
26c14a488b Auto merge of #29017 - ykomatsu:trpl, r=steveklabnik 2015-10-21 11:13:46 +00:00
bors
e99a77f9b6 Auto merge of #29108 - notriddle:master, r=alexcrichton 2015-10-21 09:28:37 +00:00
Marcello Seri
34a547f12d rustfmt liblibc 2015-10-21 09:32:52 +01:00
bors
4aec7c7d61 Auto merge of #29055 - alexcrichton:tiers, r=steveklabnik
This commit expands the "supported platforms" section of the book to include
documentation on the tiers that Rust currently has as well as organizing all
supported platforms into these various tiers. Infrastructure improvements over
the next few months are likely to change the location of may of these platforms
over, but for now this should faithfully represent what we've got today!
2015-10-21 07:45:48 +00:00
bors
3e139dc615 Auto merge of #29192 - phil-opp:unsafe-const-fns, r=alexcrichton
similar to #29085
2015-10-21 06:03:39 +00:00
bors
ff5cc89f8c Auto merge of #29190 - alexcrichton:from-str-socket-addr, r=brson
This was already implemented for SocketAddr, so the other types are lacking it
is just an oversight!

Closes #29183
2015-10-21 04:21:20 +00:00
bors
fddf2f7574 Auto merge of #29186 - pnkfelix:fsk-fix-issue-29166, r=alexcrichton
Add dropck unsafe escape hatch (UGEH) to vec::IntoIter.

Fix #29166
2015-10-21 02:39:59 +00:00
Chris C Cerami
509bec89fa Change headers in Traits section of the book 2015-10-20 21:21:44 -04:00
bors
4826f9625b Auto merge of #29171 - nrc:servo-dxr, r=@arielb1 2015-10-21 00:55:49 +00:00
Nick Cameron
401c80dab1 save-analysis: don't recompute crate name 2015-10-21 12:04:48 +13:00
bors
d8acb03cd5 Auto merge of #29159 - arcnmx:travis-trusty, r=alexcrichton
Moves back away from docker but still uses the GCE infrastructure with a system-installed LLVM. 

See http://docs.travis-ci.com/user/trusty-ci-environment/
2015-10-20 22:00:56 +00:00
Keshav Kini
79102e327c Remove reference to hello_world.rs in TRPL §2.2
When reading this paragraph, the beginning Rust programmer is starting
to write a Hello World program.  We have just told her to name the file
`main.rs`, and immediately afterward, a `hello_world.rs` is mentioned.
I changed this to an unrelated filename (incidentally one that appears
in this repository) to make it clear that this is just an example.
Also, wording it as a declarative sentence rather than an imperative one
further separates it from the Hello World instructions in this section.
2015-10-20 16:58:43 -05:00
bors
97ba52ec37 Auto merge of #29148 - petrochenkov:noshow, r=alexcrichton
Closes https://github.com/rust-lang/rust/issues/29145

[breaking-change], needs a crater run.
2015-10-20 19:02:27 +00:00
Alex Crichton
8aa6a117a4 std: Implement FromStr for SocketAddrV{4,6}
This was already implemented for SocketAddr, so the other types are lacking it
is just an oversight!

Closes #29183
2015-10-20 11:35:05 -07:00
Philipp Oppermann
3ed79944e8 Make Unique::new const function 2015-10-20 19:56:45 +02:00
Alex Crichton
93e419cab6 doc: Clarify supported platforms and tiers
This commit expands the "supported platforms" section of the book to include
documentation on the tiers that Rust currently has as well as organizing all
supported platforms into these various tiers. Infrastructure improvements over
the next few months are likely to change the location of may of these platforms
over, but for now this should faithfully represent what we've got today!
2015-10-20 10:13:32 -07:00
bors
5e9f305642 Auto merge of #29187 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #29158, #29162, #29175, #29176
- Failed merges:
2015-10-20 15:28:08 +00:00
Steve Klabnik
e058318b2c Rollup merge of #29176 - huonw:shared-tracking, r=Gankro 2015-10-20 09:43:48 -04:00
Steve Klabnik
2fb3b856c5 Rollup merge of #29175 - durka:patch-8, r=Gankro
Yay, markdown isn't standardized and rustbook's parser has subtle incompatibilities with Github's! So in the Github preview you don't see that this list fails to separate from the previous paragraph. I think this should fix it, but I didn't check.
2015-10-20 09:43:47 -04:00
Steve Klabnik
53c4b4d412 Rollup merge of #29162 - tsion:fix-nomicon-typo, r=alexcrichton
r? @steveklabnik
2015-10-20 09:43:47 -04:00
Steve Klabnik
b314f845e0 Rollup merge of #29158 - arcnmx:process-test, r=alexcrichton
This test was mysteriously messed with as part of #28500

r? @alexcrichton
2015-10-20 09:43:47 -04:00
bors
229385c4f8 Auto merge of #29156 - arcnmx:net-tests, r=alexcrichton
Just some minor cleanup.
2015-10-20 13:39:23 +00:00
Felix S. Klock II
2b712c78cf Add dropck unsafe escape hatch (UGEH) to vec::IntoIter.
Fix #29166
2015-10-20 14:54:38 +02:00
bors
e7eb7d58f9 Auto merge of #27723 - mystor:vecdeque_drain_range, r=bluss
This is a WIP PR for my implementation of drain over the VecDeque data structure supporting ranges. It brings the VecDeque drain implementation in line with Vec's.

Tests haven't been written for the new function yet.
2015-10-20 11:55:17 +00:00
bors
a9d5285344 Auto merge of #29155 - retep998:read-no-dir, r=alexcrichton
Fixes #29150 

r? @alexcrichton
2015-10-20 10:06:42 +00:00
bors
db54339f5a Auto merge of #29152 - petrochenkov:derstab, r=alexcrichton
The attributes are copied from the item for which the trait impl is derived

I think now we can close these two issues:
https://github.com/rust-lang/rust/issues/13054 - `allow`, `deny` etc. were already copied, now `stable` and `unstable` are copied as well.
https://github.com/rust-lang/rust/issues/18969 - I'm not sure this is needed, insta-stability were good enough so far, copied stability will be better. Nonetheless, it can be subsumed by some more general mechanism for supplying arbitrary not necessarily stability related attributes (for example `inline`) to derived impls and their methods (I haven't found an open issue for such mechanism).

r? @alexcrichton
2015-10-20 08:19:19 +00:00
Chris Drake
f820dc84ca Fixup some inconsistent whitespace 2015-10-20 00:11:33 -07:00
bors
2e86485f7b Auto merge of #29140 - sorear:dst-document-on-sized, r=alexcrichton
This is for discoverability.  If someone wants to know what `?Sized` means, then
Sized will be the only keyword they can use to search; so even though this is
technically a language matter, it makes sense to document it where it will be
looked for.
2015-10-20 06:36:50 +00:00
Vadim Chugunov
145b8438fe Use cfg_attr for switching link attrs in libunwind. 2015-10-19 18:57:09 -07:00
Vadim Chugunov
adce670e75 Fix up tests and docs. 2015-10-19 18:54:38 -07:00
Huon Wilson
94e9a073b0 Point core::ptr::Shared to tracking issue #27730. 2015-10-20 11:49:08 +11:00
Alex Burka
f1e06db8c2 fix markdown in nomicon/dropck 2015-10-19 20:14:38 -04:00
arcnmx
1181ca4b51 Use Travis trusty infrastructure 2015-10-19 18:31:02 -04:00
Keshav Kini
968d17a3eb Replace -- with — 2015-10-19 16:18:20 -05:00
Steve Klabnik
2f2d8df534 Rollup merge of #29169 - apasel422:spell, r=steveklabnik
r? @steveklabnik
2015-10-19 17:14:08 -04:00
Steve Klabnik
ea3bf79bac Rollup merge of #29168 - aarzee:master, r=steveklabnik
Remove leading newlines; replace lines containing only whitespace with empty lines; replace multiple trailing newlines with a single newline; remove trailing whitespace in lines.

This PR was created semiautomatically.
2015-10-19 17:14:08 -04:00
Steve Klabnik
d89c2ada16 Rollup merge of #29165 - iajrz:patch-1, r=steveklabnik
To augment the didactic effect, made placed the thread::sleep_ms call in the last example, so that there will be time for the other locks to happen; without this, I was unable to observe the deadlock in over 1,000 runs when there was no left-handed philosopher.
2015-10-19 17:14:08 -04:00
Steve Klabnik
f06e35c3ab Rollup merge of #29132 - sorear:document-ordering-relaxed, r=alexcrichton
I wasn't sure whether `Ordering::Relaxed` meant `Monotonic` or `Unordered`, so I checked the compiler sources and found 206af38e74/src/librustc_trans/trans/intrinsic.rs (L846) which appears conclusive.  Adding this answer to the documentation.
2015-10-19 17:14:07 -04:00
Steve Klabnik
e1d4983879 Rollup merge of #29125 - iKevinY:std-io-doc-fixes, r=alexcrichton
Just a few minor spelling/grammar fixes.
2015-10-19 17:14:07 -04:00
Steve Klabnik
0a47175fbb Rollup merge of #29027 - steveklabnik:iter_docs, r=manishearth
Due to the way iterators work, the std::iter module is chock full of
structs that you, humble Rust programmer, will never actually use.
However, they have URLs, and therefore get linked to, because they are
real structs that do exist.

So, rather than just have a tiny sentence about each one of them,
this patch adds links back to the functions and methods on Iterator
which actually create the structs, where helpful documentation already
exists.
2015-10-19 17:14:07 -04:00
Andrew Paseltiner
9431f3cc7b Correct spelling in docs 2015-10-19 13:48:42 -04:00