Commit Graph

52416 Commits

Author SHA1 Message Date
Manish Goregaokar
e1db767dbc Rollup merge of #33046 - jseyfried:fix_unresolved_pattern_diagnostics, r=eddyb
Fix diagnostics for unresolved patterns

This fixes #33043, a bug in the diagnostics for unresolved patterns.
r? @eddyb
2016-04-17 17:50:35 +05:30
Manish Goregaokar
df0eb16020 Rollup merge of #33045 - jseyfried:no_def_modifiers, r=eddyb
resolve: Refactor away `DefModifiers`

This refactors away `DefModifiers`, which is unneeded now that #32875 has landed.
r? @eddyb
2016-04-17 17:50:35 +05:30
Manish Goregaokar
02e40d910a Rollup merge of #33044 - petrochenkov:prefix, r=eddyb
syntax: Parse import prefixes as paths

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

r? @eddyb
(This partially intersects with https://github.com/rust-lang/rust/pull/33041)
2016-04-17 17:50:35 +05:30
Manish Goregaokar
4046f396ed Rollup merge of #33039 - bluss:trait-obj-error, r=arielb1
Adjust example for error E0225

Adjust example for error E0225

It's using Copy as a trait object compatible trait, which is not
appropriate, change to use a more typical Read + Send + Sync example.

Also use whitespace around `+`.

This seems appropriate apropos issue #32963
2016-04-17 17:50:35 +05:30
Manish Goregaokar
43c23e5eba Rollup merge of #33032 - kindlychung:patch-3, r=Manishearth
Update casting-between-types.md
2016-04-17 17:50:34 +05:30
Manish Goregaokar
5fc8065ef2 Rollup merge of #33023 - tbu-:pr_wrapping_traits, r=alexcrichton
Implement `Display` and `Hash` for `std::num::Wrapping`

Also, change the `Debug` implementation to only show the inner value.

Fixes #33006.
2016-04-17 17:50:34 +05:30
Manish Goregaokar
51c3c430cd Rollup merge of #33022 - Mr4x:master, r=bluss
Fix f32::sin_cos and f64::sin_cos examples
2016-04-17 17:50:34 +05:30
Manish Goregaokar
31bedab0c8 Rollup merge of #33003 - fbergr:link, r=steveklabnik
Fix link in contributing page

Link was broken (404).
2016-04-17 17:50:34 +05:30
Manish Goregaokar
de477edb6d Rollup merge of #32956 - GuillaumeGomez:ptr_examples, r=steveklabnik
Add examples for std::ptr module functions

Part of #29371.

r? @steveklabnik
2016-04-17 17:50:34 +05:30
Manish Goregaokar
e59af6c719 Rollup merge of #31441 - gereeter:btree-docs, r=bluss
Start documenting BTreeMap's node interface

cc @Gankro @apasel422
2016-04-17 17:50:33 +05:30
bors
d8d71747fe Auto merge of #32987 - xosmig:binary_heap_extension, r=apasel422
collections: add append for binary heap
2016-04-17 01:16:02 -07:00
bors
b5de94fba9 Auto merge of #32977 - alexcrichton:ignore-panics, r=brson
std: Change String::truncate to panic less

The `Vec::truncate` method does not panic if the length argument is greater than
the vector's current length, but `String::truncate` will indeed panic. This
semantic difference can be a bit jarring (e.g. #32717), and after some
discussion the libs team concluded that although this can technically be a
breaking change it is almost undoubtedly not so in practice.

This commit changes the semantics of `String::truncate` to be a noop if
`new_len` is greater than the length of the current string.

Closes #32717
2016-04-16 23:06:29 -07:00
bors
6892277cc0 Auto merge of #32952 - eddyb:mir-debuginfo-2, r=michaelwoerister
Get all (but one) of debuginfo tests to pass with MIR codegen.

I didn't get much feedback in #31005 so I went ahead and implemented something simple.
Closes #31005, as MIR debuginfo should work now for most usecases.

The `no-debug-attribute` test no longer assumes variables are in scope of `return`.
We might also want to revisit that in #32949, but the test is more reliable now either way.

In order to get one last function in the `associated-type` test pass, this PR also fixes #32790.
2016-04-16 20:40:33 -07:00
Jeffrey Seyfried
2c978dc80b resolve: Refactor away DefModifiers 2016-04-17 02:54:22 +00:00
Jeffrey Seyfried
1a374b8d11 Fix diagnostics for unresolved patterns 2016-04-17 02:42:39 +00:00
bors
054a4b4019 Auto merge of #32909 - sanxiyn:unused-trait-import-2, r=alexcrichton
Remove unused trait imports
2016-04-16 18:31:11 -07:00
Vadim Petrochenkov
e7bc939f1e syntax: Parse import prefixes as paths 2016-04-17 03:48:40 +03:00
bors
ae33aa74f4 Auto merge of #32875 - jseyfried:1422_implementation, r=nikomatsakis
Implement `pub(restricted)` privacy (RFC 1422)

This implements `pub(restricted)` privacy from RFC 1422 (cc #32409) behind a feature gate.

`pub(restricted)` paths currently cannot use re-exported modules both for simplicity of implementation and for future compatibility with RFC 1560 (cf #31783).

r? @nikomatsakis
2016-04-16 16:21:09 -07:00
Jeffrey Seyfried
e14504a113 Add tests for pub(restricted) 2016-04-16 22:52:14 +00:00
Jeffrey Seyfried
daec3fe4e6 Always report PRIVATE_IN_PUBLIC violations as hard errors when
the feature `pub_restricted` is enabled.
2016-04-16 21:27:20 +00:00
Ulrik Sverdrup
869536ed2c Adjust example for error E0225
It's using Copy as a trait object compatible trait, which is not
appropriate, change to use a more typical Read + Send + Sync example.

Also use whitespace around `+`.
2016-04-16 21:30:50 +02:00
Eduard Burtescu
e2ac9895d6 mir: place match pattern bindings in their respective arms. 2016-04-16 21:51:30 +03:00
Eduard Burtescu
f06bab7758 debuginfo: argument and upvar names for MIR. 2016-04-16 21:51:26 +03:00
bors
a7c3a294bf Auto merge of #33019 - kamalmarhubi:binary_search_by_key, r=alexcrichton
slice: Add tracking issue for slice_binary_search_by_key
2016-04-16 11:51:13 -07:00
Kaiyin Zhong
6c93c92ba7 Update casting-between-types.md 2016-04-16 18:04:27 +02:00
Eduard Burtescu
7fd2881ed4 test: don't depend on locals being in scope on the return path. 2016-04-16 14:08:32 +03:00
Tobias Bucher
79e68a61a9 Implement Display and Hash for std::num::Wrapping
Also, change the `Debug` implementation to only show the inner value.

Fixes #33006.
2016-04-16 09:53:40 +02:00
Maxim Samburskiy
c1db18b54e Fix f32::sin_cos and f64::sin_cos examples 2016-04-16 11:42:37 +05:00
bors
6fa61b810d Auto merge of #32785 - tbu-:pr_more_defaults, r=alexcrichton
Implement `Default` for more types in the standard library

Also add `Hash` to `std::cmp::Ordering` and most possible traits to
`fmt::Error`.
2016-04-15 20:26:19 -07:00
bors
fef6c64a80 Auto merge of #32779 - michaelwoerister:partitioning, r=nikomatsakis
Add initial version of codegen unit partitioning for incremental compilation.

The task of the partitioning module is to take the complete set of translation items of a crate and produce a set of codegen units from it, where a codegen unit is a named set of (translation-item, linkage) pairs. That is, this module decides which translation item appears in which codegen units with which linkage.

This version only handles the case of partitioning for incremental compilation, not the regular N-codegen units case. In the future the regular case should be handled too, maybe even doing a bit more analysis to intelligently figure out a good partitioning.

One thing that could be improved is the syntax of the codegen unit tests. Right now they still use the compile-fail error specification infrastructure, so everything has to be on one line. Would be nice to be able to format things in a more readable way.
2016-04-15 18:13:59 -07:00
Kamal Marhubi
1e7ec39fc3 slice: Add tracking issue for slice_binary_search_by_key 2016-04-15 19:27:03 -04:00
bors
576229fea0 Auto merge of #33005 - Manishearth:rollup, r=Manishearth
Rollup of 11 pull requests

- Successful merges: #32923, #32926, #32929, #32931, #32935, #32945, #32946, #32964, #32970, #32973, #32997
- Failed merges:
2016-04-15 14:51:16 -07:00
Andrey Tonkih
faeba73530 collections: add append and extend specialization for binary heap 2016-04-16 00:38:59 +03:00
Manish Goregaokar
e563359396
Rollup merge of #32997 - alexcrichton:fix-alloc-system-how-did-this-land, r=nagisa
alloc_system: Handle failure properly

The Unix implementation was incorrectly handling failure for reallocation of
over-aligned types by not checking for NULL.

Closes #32993
2016-04-16 01:18:14 +05:30
Manish Goregaokar
eba80558d7
Rollup merge of #32973 - kindlychung:patch-1, r=steveklabnik
remove "#" symbols to make the code compile
2016-04-16 01:18:12 +05:30
Manish Goregaokar
00d4ac32c5
Rollup merge of #32970 - taralx:patch-2, r=alexcrichton
Accommodate the case where dup lang items are entirely external.

Fixes #32961
2016-04-16 01:18:11 +05:30
Manish Goregaokar
9873771187
Rollup merge of #32964 - tshepang:comma, r=GuillaumeGomez
doc: add missing comma
2016-04-16 01:18:10 +05:30
Manish Goregaokar
5bdbf8ef46
Rollup merge of #32946 - eddyb:issue-32783, r=dotdash
trans: always register an item's symbol, even if duplicated.

Fixes #32783 which was introduced by not always registering item symbols in #32742.
2016-04-16 01:18:08 +05:30
Manish Goregaokar
90c8d81ee4
Rollup merge of #32945 - durka:rfc1494, r=pnkfelix
implement RFC amendment 1494

Adds `:block` to the follow set for `:ty` and `:path`. See rust-lang/rfcs#1494.
2016-04-16 01:18:07 +05:30
Manish Goregaokar
fbbe85c6ba
Rollup merge of #32935 - pierzchalski:restore_trait_impl_docs, r=alexcrichton
Restore trait impl docs

Currently, documentation on methods in trait implementations doesn't get rendered. This changes that;  trait implementations have all documentation associated with impl items displayed (documentation from the trait definition is ignored).

Fixes #24838
Fixes #26871
2016-04-16 01:18:05 +05:30
Manish Goregaokar
50932f5c6a
Rollup merge of #32931 - deepak:gh-issue-32928-update-cargo-in-getting-started-doc, r=GuillaumeGomez
Doc fix: Update Cargo.toml in book/getting-started

The Cargo.toml mentioned in book/getting-started
is missing the section called `[dependencies]`

fixes https://github.com/rust-lang/rust/issues/32928
2016-04-16 01:18:04 +05:30
Manish Goregaokar
7e36dc36d3
Rollup merge of #32929 - LeoTestard:featureck-comment, r=GuillaumeGomez
Update a comment to reflect changes in tidy checks.
2016-04-16 01:18:03 +05:30
Manish Goregaokar
70601b8da2
Rollup merge of #32926 - caipre:rustbuild-verify-download, r=alexcrichton
rustbuild: Verify sha256 of downloaded tarballs

Here's a quick first pass at this.

I don't use Python often enough to claim that this is totally Pythonic. I've left off some (almost certainly unnecessary) error handling regarding opening and processing files. The whole tarball is read into memory to calculate the hash, but the file isn't *so* large so that should be fine. I don't care for the output from `raise RuntimeError`, but that's how `run()` does it so I'm following precedent.

Tested by manually changing the value of `expected`, and by modifying the tarball then forcing `rustc_out_of_date()`. Both cases tripped the error.

Closes https://github.com/rust-lang/rust/issues/32902
2016-04-16 01:18:01 +05:30
Manish Goregaokar
6a0cfbcac2 Rollup merge of #32923 - jseyfried:fix_hygiene, r=nrc
Fix macro hygiene bug

This fixes #32922 (EDIT: and fixes #31856), macro hygiene bugs.
It is a [breaking-change]. For example, the following would break:
```rust
fn main() {
    let x = true;
    macro_rules! foo { () => {
        let x = 0;
        macro_rules! bar { () => {x} }
        let _: bool = bar!();
        //^ `bar!()` used to resolve the first `x` (a bool),
        //| but will now resolve to the second x (an i32).
    }}
    foo! {};
}
```

r? @nrc
2016-04-16 01:16:43 +05:30
bors
9debf51f4b Auto merge of #32338 - lukaspustina:doc-std-process, r=alexcrichton
Extends rustdoc on how to caputure output

- The documentation is quite about how to caputure a process' output when using
  ` std::process::Child::wait_with_output()`.
- This PR adds an example for this particular use case.
2016-04-15 12:41:25 -07:00
Florian Berger
daa48a294f Fix link in contributing page 2016-04-15 22:28:32 +03:00
bors
ccc7e95a96 Auto merge of #32972 - alexcrichton:cargotest, r=brson
cargotest: Put output in build directory

Right now cargotest uses `TempDir` to place output into the system temp
directory, but unfortunately this means that if the process is interrupted then
it'll leak the directory and that'll never get cleaned up. One of our bots
filled up its disk space and there were 20 cargotest directories lying around so
seems prudent to clean them up!

By putting the output in the build directory it should ensure that we don't leak
too many extra builds.
2016-04-15 10:32:10 -07:00
Alex Crichton
ae79ce3f03 std: Change String::truncate to panic less
The `Vec::truncate` method does not panic if the length argument is greater than
the vector's current length, but `String::truncate` will indeed panic. This
semantic difference can be a bit jarring (e.g. #32717), and after some
discussion the libs team concluded that although this can technically be a
breaking change it is almost undoubtedly not so in practice.

This commit changes the semantics of `String::truncate` to be a noop if
`new_len` is greater than the length of the current string.

Closes #32717
2016-04-15 10:13:43 -07:00
Alex Crichton
99c0547854 alloc_system: Handle failure properly
The Unix implementation was incorrectly handling failure for reallocation of
over-aligned types by not checking for NULL.

Closes #32993
2016-04-15 10:02:21 -07:00
Alex Crichton
73c2d2a741 cargotest: Put output in build directory
Right now cargotest uses `TempDir` to place output into the system temp
directory, but unfortunately this means that if the process is interrupted then
it'll leak the directory and that'll never get cleaned up. One of our bots
filled up its disk space and there were 20 cargotest directories lying around so
seems prudent to clean them up!

By putting the output in the build directory it should ensure that we don't leak
too many extra builds.
2016-04-15 09:23:12 -07:00