Commit Graph

48729 Commits

Author SHA1 Message Date
bors
672a3d93e3 Auto merge of #30294 - jseyfried:fix_shadowed_use_visibility, r=nrc
This fixes a bug in which the visibility of a use declaration defining a name in one namespace (e.g. the value namespace) is overridden by a later use declaration defining the same name in the other namespace (e.g. the type namespace). For example,
```rust
fn f() {}
pub mod bar {}

mod foo {
    use f; // This import should not be visible outside `foo`,
    pub use bar as f; // but it visible outside of `foo` because of this import.
}

fn main() { foo::f(); }
```
As the example demonstrates, this is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by correcting visibility modifiers.
2015-12-11 04:27:53 +00:00
bors
ae5d09551e Auto merge of #30307 - pnkfelix:fix-issue-26656, r=alexcrichton
Long awaited regression test for dropck on trait object method.

Fix #26656.
2015-12-11 02:44:21 +00:00
Jeffrey Seyfried
ada87fae5f Rename (Ns)ImportResolution 2015-12-11 01:38:13 +00:00
bors
7ce713961c Auto merge of #30301 - michaelwoerister:mir-to-metadata2, r=nikomatsakis
This PR makes `Mir` `RustcEncodable` and `RustcDecodable` and stores it in crate metadata for inlinable items.

Some other things in here:
- `mir::visit::Visitor` is extended to also visit `Literals`, `Spans` and `DefIds`.
- It also adds `mir::visit::MutVisitor` which allows to mutate the visited `Mir` structure in place.
- Some numbers on how big MIR is in metadata (total metadata size in bytes):

|                | w/ MIR     | w/o MIR     | Rel. Size |
|----------------|-----------:|------------:|:---------:|
| libcore        | 17,695,473 |  14,263,377 |  124%     |
| liblibc        | 411,440   |  404,382    | 102%      |
| libcollections |  4,537,975 |   3,526,933 |   129%    |
| libserialize   |  2,574,769 |   2,060,798 |   125%    |
| libsyntax      | 15,262,894 |  12,075,574 |  126%     |
| librustc       | 16,984,537 |  13,692,168 |  124%     |

So, adding MIR to metadata makes it about 25% bigger. It could be worse, considering that it still uses the inefficient RBML encoding. Still, the question is whether we should put MIR emission behind a `-Z` flag.
2015-12-11 00:59:48 +00:00
Florian Hahn
15743919dc Add name of initializer to missing field message, closes #30299 2015-12-11 00:25:08 +01:00
bors
0d3684063b Auto merge of #30148 - steveklabnik:doc_string, r=alexcrichton
Part of #29376
2015-12-10 23:18:07 +00:00
Sean McArthur
025f97a1de std: improve io error descriptions 2015-12-10 14:25:11 -08:00
Steve Klabnik
072dd6fabd Improve documentation on String's methods
Part of #29376
2015-12-10 17:04:08 -05:00
Michael Woerister
5addc31adb Make MIR encodable and store it in crate metadata. 2015-12-10 16:59:31 -05:00
Michael Woerister
8eee116cb8 Add a MIR visitor that allows to mutate the visited data 2015-12-10 16:50:33 -05:00
Michael Woerister
bd1ce30ccb Add visit_defid(), visit_span(), and visit_literal() to MIR visitor 2015-12-10 16:42:32 -05:00
Michael Woerister
70398d5ad0 MIR: Make Mir take ownership of InlineAsm values. 2015-12-10 16:39:17 -05:00
bors
611e8b447c Auto merge of #30303 - mitaa:htmldocck, r=brson
This changes the error output and behaviour to:
* not emit python backtraces
* run all checks
* include a context line per error
* move the offending line-number to the start of the line

fixes #21455
2015-12-10 21:36:08 +00:00
Michael Woerister
33d29700b3 MIR: Refactor mir::Terminator to use tuples instead of a fixed-size arrays. 2015-12-10 15:46:40 -05:00
Michael Woerister
d62de4c066 Add TupleSlice trait to rustc_data_structures. 2015-12-10 14:56:18 -05:00
bors
47cd3a4ae7 Auto merge of #30182 - alexcrichton:remove-deprecated, r=aturon
This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.
2015-12-10 19:54:15 +00:00
Alex Crichton
453375b4d2 book: Update Tier 2 platforms
We've got lots of new automation set up in the past few months, so these
platforms are now all tier 2 as we're building artifacts and gating on them.
2015-12-10 11:50:20 -08:00
Scott Olson
96b3fc203c Correct 'bye' to 'byte' in str docs. 2015-12-10 13:49:04 -06:00
Alex Crichton
da50f7c288 std: Remove deprecated functionality from 1.5
This is a standard "clean out libstd" commit which removes all 1.5-and-before
deprecated functionality as it's now all been deprecated for at least one entire
cycle.
2015-12-10 11:47:55 -08:00
Felix S. Klock II
58c099770f Long await regression test for dropck on trait object method.
Fix #26656.
2015-12-10 19:59:20 +01:00
bors
ce132752c6 Auto merge of #30267 - alexcrichton:tls-init-oh-my, r=nikomatsakis
Due to #30228 it's not currently sound to do `*ptr = Some(value)`, so instead
use `mem::replace` which fixes the soundness hole for now.
2015-12-10 18:11:32 +00:00
mitaa
cf81e1aba8 Improve htmldocck.py error messages 2015-12-10 17:34:54 +01:00
bors
41a33852b8 Auto merge of #30298 - Letheed:docpatch, r=sanxiyn
Missing Panics tag and missing period in the documentation of `fn expect(…)` for `Option` and `Result`.
2015-12-10 16:28:53 +00:00
bors
ae1cf9815f Auto merge of #30194 - brson:relnotes, r=brson
[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md).

cc @aturon
2015-12-10 14:43:54 +00:00
Letheed
af4414bd30 fix missing Panics tag and missing period 2015-12-10 14:20:32 +01:00
bors
dc37e9f096 Auto merge of #30297 - oli-obk:doc/fix_intravisit, r=sanxiyn
r? @steveklabnik
2015-12-10 11:57:17 +00:00
Oliver Schneider
8e346f217a adjust documentation to mention intravisit instead of visit 2015-12-10 10:52:32 +01:00
bors
8eee0efd1f Auto merge of #30293 - steveklabnik:fixes, r=brson
I meant to double check the work in https://github.com/rust-lang/rust/issues/29429, but due to Mozlando, forgot. Here are two small fixes.

r? @brson I would like to get this backported to beta as well, sorry :( I don't generally want doc backports, but feel this is exceptional and worth it.
2015-12-10 06:38:06 +00:00
bors
ee597a8ee1 Auto merge of #30292 - Xmasreturns:patch-3, r=steveklabnik
Updated structs.md in the book
2015-12-10 04:54:03 +00:00
bors
f97e4d3342 Auto merge of #30291 - Xmasreturns:patch-2, r=steveklabnik
Updated enums.md in the book
2015-12-10 03:09:27 +00:00
Jeffrey Seyfried
27c4f9e7b1 Fix a bug in which the visibility of a use declaration defining a name in one namespace (e.g. the value namespace) is overridden by a later use declaration defining the same name in the other namespace (e.g. the type namespace). 2015-12-10 02:55:05 +00:00
bors
9267a3a222 Auto merge of #30285 - glglwty:patch-1, r=alexcrichton
srong -> strong in liballoc/arc.rs
2015-12-10 01:24:54 +00:00
bors
81ae8be71c Auto merge of #30284 - GuillaumeGomez:patch-3, r=Manishearth
r? @Manishearth
2015-12-09 23:41:16 +00:00
Xmasreturns
2adba31682 Fixes from review
Traits -> Field labels
Revert a change to convention
2015-12-09 13:25:53 -08:00
bors
0b49cb1dca Auto merge of #30288 - brson:bump, r=alexcrichton 2015-12-09 21:11:48 +00:00
Steve Klabnik
3061f9f573 Fix link in char docs 2015-12-09 15:58:49 -05:00
Steve Klabnik
77882c9cba Fix extra space in str docs 2015-12-09 15:52:04 -05:00
Xmasreturns
6bbe6759a5 Grammar and slight ordering changes 2015-12-09 11:37:57 -08:00
bors
08a5b112ed Auto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichton
Closes #30231
2015-12-09 18:42:15 +00:00
Xmasreturns
99fdf3414f Grammar changes for readability 2015-12-09 10:07:02 -08:00
bors
6bf8cc5789 Auto merge of #29937 - alexcrichton:panic-recover, r=alexcrichton
This commit is an implementation of [RFC 1236] and [RFC 1323] which
rename the `thread::catch_panic` function to `panic::recover` while also
replacing the `Send + 'static` bounds with a new `PanicSafe` bound.

[RFC 1236]: https://github.com/rust-lang/rfcs/pull/1236
[RFC 1323]: https://github.com/rust-lang/rfcs/pull/1323

cc #27719
2015-12-09 16:57:46 +00:00
Brian Anderson
c479e4e232 Bump to 1.7 2015-12-09 08:23:35 -08:00
Guillaume Gomez
1671af1394 Add E0269 error explanation 2015-12-09 16:25:17 +01:00
Alex Crichton
0a13f1abaf std: Rename thread::catch_panic to panic::recover
This commit is an implementation of [RFC 1236] and [RFC 1323] which
rename the `thread::catch_panic` function to `panic::recover` while also
replacing the `Send + 'static` bounds with a new `PanicSafe` bound.

[RFC 1236]: https://github.com/rust-lang/rfcs/pull/1236
[RFC 1323]: https://github.com/rust-lang/rfcs/pull/1323

cc #27719
2015-12-09 07:19:17 -08:00
Tianyi Wang
f13f488eb6 fixed a typo in comments
srong -> strong in liballoc/arc.rs
2015-12-09 23:18:24 +08:00
bors
eebf6743d8 Auto merge of #30140 - michaelwoerister:tls-encoding, r=nikomatsakis
With this commit, metadata encoding and decoding can make use of thread-local encoding and decoding contexts. These allow implementers of `serialize::Encodable` and `Decodable` to access information and
datastructures that would otherwise not be available to them. For example, we can automatically translate def-id and span information during decoding because the decoding context knows which crate the data is decoded from. Or it allows to make `ty::Ty` decodable because the context has access to the `ty::ctxt` that is needed for creating `ty::Ty` instances.

Some notes:
- `tls::with_encoding_context()` and `tls::with_decoding_context()` (as opposed to their unsafe versions) try to prevent the TLS data getting out-of-sync by making sure that the encoder/decoder passed in is actually the same as the one stored in the context. This should prevent accidentally reading from the wrong decoder.
- There are no real tests in this PR. I had a unit tests for some of the core aspects of the TLS implementation but it was kind of brittle, a lot of code for mocking `ty::ctxt`, `crate_metadata`, etc and did actually test not so much. The code will soon be tested by the first incremental compilation auto-tests that rely on MIR being properly serialized. However, if people think that some tests should be added before this can land, I'll try to provide some that make sense.

r? @nikomatsakis
2015-12-09 15:10:37 +00:00
Michael Woerister
f65823e39c Add scoped thread-local encoding and decoding contexts to cstore.
With this commit, metadata encoding and decoding can make use of
thread-local encoding and decoding contexts. These allow implementers
of serialize::Encodable and Decodable to access information and
datastructures that would otherwise not be available to them. For
example, we can automatically translate def-id and span information
during decoding because the decoding context knows which crate the
data is decoded from. Or it allows to make ty::Ty decodable because
the context has access to the ty::ctxt that is needed for creating
ty::Ty instances.
2015-12-09 09:47:32 -05:00
James Miller
93154dd29c Fix & ref ident patterns for DSTs
We shouldn't load DSTs when recursing into the sub-pattern of `& ref ident`.

Fixes #30277
2015-12-10 00:35:55 +13:00
bors
2e48b593ca Auto merge of #30266 - oli-obk:expr_type_checked, r=luqmana
r? @eefriedman

It was getting out of hand with my additions to the const evaluator
2015-12-09 11:14:58 +00:00
bors
9cadb2955f Auto merge of #30263 - pnkfelix:rsbegin-rsend-are-window-gnu-only, r=alexcrichton
The `rsbegin.o` and `rsend.o` build products should not be generated
on non WinGnu platforms.

This is another path to resolving #30063 for non win-gnu targets.
(And it won't require a snapshot, unlike PR #30208.)

r? @alexcrichton
2015-12-09 09:32:18 +00:00