]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agobook: Add missing punctuation
Ori Avtalion [Fri, 11 Dec 2015 16:18:02 +0000 (18:18 +0200)]
book: Add missing punctuation

8 years agoAuto merge of #30265 - oli-obk:const_val_trans, r=pnkfelix
bors [Fri, 11 Dec 2015 08:12:41 +0000 (08:12 +0000)]
Auto merge of #30265 - oli-obk:const_val_trans, r=pnkfelix

r? @nagisa

I'm going to need the `ConstVal` -> `ValueRef` translation to start removing trans/consts piece by piece. If you need anything implemented in the translation, feel free to assign an issue to me.

8 years agoAuto merge of #30248 - petevine:master, r=brson
bors [Fri, 11 Dec 2015 06:29:06 +0000 (06:29 +0000)]
Auto merge of #30248 - petevine:master, r=brson

Running `/usr/bin/time -v make` to build rust (using local llvm) shows the maximum memory usage at 715 megabytes on 32-bit x86 (on arm linux it's even less @ 580M).

Reworded according to @brson's [input](https://github.com/rust-lang/rust/pull/30196#issuecomment-162088921).

8 years agoAuto merge of #30294 - jseyfried:fix_shadowed_use_visibility, r=nrc
bors [Fri, 11 Dec 2015 04:27:53 +0000 (04:27 +0000)]
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.

8 years agoAuto merge of #30307 - pnkfelix:fix-issue-26656, r=alexcrichton
bors [Fri, 11 Dec 2015 02:44:21 +0000 (02:44 +0000)]
Auto merge of #30307 - pnkfelix:fix-issue-26656, r=alexcrichton

Long awaited regression test for dropck on trait object method.

Fix #26656.

8 years agoRename (Ns)ImportResolution
Jeffrey Seyfried [Fri, 11 Dec 2015 01:38:13 +0000 (01:38 +0000)]
Rename (Ns)ImportResolution

8 years agoAuto merge of #30301 - michaelwoerister:mir-to-metadata2, r=nikomatsakis
bors [Fri, 11 Dec 2015 00:59:48 +0000 (00:59 +0000)]
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.

8 years agoAuto merge of #30148 - steveklabnik:doc_string, r=alexcrichton
bors [Thu, 10 Dec 2015 23:18:07 +0000 (23:18 +0000)]
Auto merge of #30148 - steveklabnik:doc_string, r=alexcrichton

Part of #29376

8 years agoImprove documentation on String's methods
Steve Klabnik [Tue, 1 Dec 2015 21:07:53 +0000 (16:07 -0500)]
Improve documentation on String's methods

Part of #29376

8 years agoMake MIR encodable and store it in crate metadata.
Michael Woerister [Tue, 8 Dec 2015 20:53:19 +0000 (15:53 -0500)]
Make MIR encodable and store it in crate metadata.

8 years agoAdd a MIR visitor that allows to mutate the visited data
Michael Woerister [Tue, 8 Dec 2015 19:09:16 +0000 (14:09 -0500)]
Add a MIR visitor that allows to mutate the visited data

8 years agoAdd visit_defid(), visit_span(), and visit_literal() to MIR visitor
Michael Woerister [Tue, 8 Dec 2015 19:07:25 +0000 (14:07 -0500)]
Add visit_defid(), visit_span(), and visit_literal() to MIR visitor

8 years agoMIR: Make Mir take ownership of InlineAsm values.
Michael Woerister [Thu, 10 Dec 2015 21:39:17 +0000 (16:39 -0500)]
MIR: Make Mir take ownership of InlineAsm values.

8 years agoAuto merge of #30303 - mitaa:htmldocck, r=brson
bors [Thu, 10 Dec 2015 21:36:08 +0000 (21:36 +0000)]
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

8 years agoMIR: Refactor mir::Terminator to use tuples instead of a fixed-size arrays.
Michael Woerister [Thu, 10 Dec 2015 20:46:40 +0000 (15:46 -0500)]
MIR: Refactor mir::Terminator to use tuples instead of a fixed-size arrays.

8 years agoAdd TupleSlice trait to rustc_data_structures.
Michael Woerister [Thu, 10 Dec 2015 19:35:53 +0000 (14:35 -0500)]
Add TupleSlice trait to rustc_data_structures.

8 years agoAuto merge of #30182 - alexcrichton:remove-deprecated, r=aturon
bors [Thu, 10 Dec 2015 19:54:15 +0000 (19:54 +0000)]
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.

8 years agostd: Remove deprecated functionality from 1.5
Alex Crichton [Thu, 3 Dec 2015 01:07:29 +0000 (17:07 -0800)]
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.

8 years agoLong await regression test for dropck on trait object method.
Felix S. Klock II [Thu, 10 Dec 2015 18:59:20 +0000 (19:59 +0100)]
Long await regression test for dropck on trait object method.

Fix #26656.

8 years agoAuto merge of #30267 - alexcrichton:tls-init-oh-my, r=nikomatsakis
bors [Thu, 10 Dec 2015 18:11:32 +0000 (18:11 +0000)]
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.

8 years agoImprove `htmldocck.py` error messages
mitaa [Thu, 10 Dec 2015 16:34:54 +0000 (17:34 +0100)]
Improve `htmldocck.py` error messages

8 years agoAuto merge of #30298 - Letheed:docpatch, r=sanxiyn
bors [Thu, 10 Dec 2015 16:28:53 +0000 (16:28 +0000)]
Auto merge of #30298 - Letheed:docpatch, r=sanxiyn

Missing Panics tag and missing period in the documentation of `fn expect(…)` for `Option` and `Result`.

8 years agoAuto merge of #30194 - brson:relnotes, r=brson
bors [Thu, 10 Dec 2015 14:43:54 +0000 (14:43 +0000)]
Auto merge of #30194 - brson:relnotes, r=brson

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md).

cc @aturon

8 years agofix missing Panics tag and missing period
Letheed [Thu, 10 Dec 2015 13:20:32 +0000 (14:20 +0100)]
fix missing Panics tag and missing period

8 years agoAuto merge of #30297 - oli-obk:doc/fix_intravisit, r=sanxiyn
bors [Thu, 10 Dec 2015 11:57:17 +0000 (11:57 +0000)]
Auto merge of #30297 - oli-obk:doc/fix_intravisit, r=sanxiyn

r? @steveklabnik

8 years agoadjust documentation to mention `intravisit` instead of `visit`
Oliver Schneider [Thu, 10 Dec 2015 09:52:32 +0000 (10:52 +0100)]
adjust documentation to mention `intravisit` instead of `visit`

8 years agoAuto merge of #30293 - steveklabnik:fixes, r=brson
bors [Thu, 10 Dec 2015 06:38:06 +0000 (06:38 +0000)]
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.

8 years agoAuto merge of #30292 - Xmasreturns:patch-3, r=steveklabnik
bors [Thu, 10 Dec 2015 04:54:03 +0000 (04:54 +0000)]
Auto merge of #30292 - Xmasreturns:patch-3, r=steveklabnik

Updated structs.md in the book

8 years agoAuto merge of #30291 - Xmasreturns:patch-2, r=steveklabnik
bors [Thu, 10 Dec 2015 03:09:27 +0000 (03:09 +0000)]
Auto merge of #30291 - Xmasreturns:patch-2, r=steveklabnik

Updated enums.md in the book

8 years agoFix a bug in which the visibility of a use declaration defining a name in one namespa...
Jeffrey Seyfried [Tue, 1 Dec 2015 23:06:34 +0000 (23:06 +0000)]
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).

8 years agoAuto merge of #30285 - glglwty:patch-1, r=alexcrichton
bors [Thu, 10 Dec 2015 01:24:54 +0000 (01:24 +0000)]
Auto merge of #30285 - glglwty:patch-1, r=alexcrichton

srong -> strong in liballoc/arc.rs

8 years agoAuto merge of #30284 - GuillaumeGomez:patch-3, r=Manishearth
bors [Wed, 9 Dec 2015 23:41:16 +0000 (23:41 +0000)]
Auto merge of #30284 - GuillaumeGomez:patch-3, r=Manishearth

r? @Manishearth

8 years agoFixes from review
Xmasreturns [Wed, 9 Dec 2015 21:25:53 +0000 (13:25 -0800)]
Fixes from review

Traits -> Field labels
Revert a change to convention

8 years agoAuto merge of #30288 - brson:bump, r=alexcrichton
bors [Wed, 9 Dec 2015 21:11:48 +0000 (21:11 +0000)]
Auto merge of #30288 - brson:bump, r=alexcrichton

8 years agoFix link in char docs
Steve Klabnik [Wed, 9 Dec 2015 20:58:49 +0000 (15:58 -0500)]
Fix link in char docs

8 years agoFix extra space in str docs
Steve Klabnik [Wed, 9 Dec 2015 20:52:04 +0000 (15:52 -0500)]
Fix extra space in str docs

8 years agoGrammar and slight ordering changes
Xmasreturns [Wed, 9 Dec 2015 19:37:57 +0000 (11:37 -0800)]
Grammar and slight ordering changes

8 years agoAuto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichton
bors [Wed, 9 Dec 2015 18:42:15 +0000 (18:42 +0000)]
Auto merge of #30270 - DiamondLovesYou:fix-30231, r=alexcrichton

Closes #30231

8 years agoGrammar changes for readability
Xmasreturns [Wed, 9 Dec 2015 18:07:02 +0000 (10:07 -0800)]
Grammar changes for readability

8 years agoAuto merge of #29937 - alexcrichton:panic-recover, r=alexcrichton
bors [Wed, 9 Dec 2015 16:57:46 +0000 (16:57 +0000)]
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

8 years agoBump to 1.7
Brian Anderson [Wed, 9 Dec 2015 16:23:35 +0000 (08:23 -0800)]
Bump to 1.7

8 years agoAdd E0269 error explanation
Guillaume Gomez [Wed, 9 Dec 2015 15:07:30 +0000 (16:07 +0100)]
Add E0269 error explanation

8 years agostd: Rename thread::catch_panic to panic::recover
Alex Crichton [Mon, 31 Aug 2015 15:51:53 +0000 (08:51 -0700)]
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

8 years agofixed a typo in comments
Tianyi Wang [Wed, 9 Dec 2015 15:18:24 +0000 (23:18 +0800)]
fixed a typo in comments

srong -> strong in liballoc/arc.rs

8 years agoAuto merge of #30140 - michaelwoerister:tls-encoding, r=nikomatsakis
bors [Wed, 9 Dec 2015 15:10:37 +0000 (15:10 +0000)]
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

8 years agoAdd scoped thread-local encoding and decoding contexts to cstore.
Michael Woerister [Tue, 1 Dec 2015 15:07:15 +0000 (16:07 +0100)]
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.

8 years agoAuto merge of #30266 - oli-obk:expr_type_checked, r=luqmana
bors [Wed, 9 Dec 2015 11:14:58 +0000 (11:14 +0000)]
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

8 years agoAuto merge of #30263 - pnkfelix:rsbegin-rsend-are-window-gnu-only, r=alexcrichton
bors [Wed, 9 Dec 2015 09:32:18 +0000 (09:32 +0000)]
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

8 years agoAuto merge of #30246 - untitaker:insaller, r=alexcrichton
bors [Wed, 9 Dec 2015 07:48:58 +0000 (07:48 +0000)]
Auto merge of #30246 - untitaker:insaller, r=alexcrichton

None

8 years agoAuto merge of #30278 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 9 Dec 2015 06:05:08 +0000 (06:05 +0000)]
Auto merge of #30278 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #30201, #30224, #30261, #30273, #30274
- Failed merges:

8 years agoRollup merge of #30274 - tshepang:mere-renames, r=steveklabnik
Steve Klabnik [Wed, 9 Dec 2015 05:01:18 +0000 (00:01 -0500)]
Rollup merge of #30274 - tshepang:mere-renames, r=steveklabnik

8 years agoRollup merge of #30273 - Xmasreturns:patch-1, r=steveklabnik
Steve Klabnik [Wed, 9 Dec 2015 05:01:17 +0000 (00:01 -0500)]
Rollup merge of #30273 - Xmasreturns:patch-1, r=steveklabnik

Changes to readability and some clarifications for beginners

8 years agoRollup merge of #30261 - oli-obk:add_regression_test, r=pnkfelix
Steve Klabnik [Wed, 9 Dec 2015 05:01:17 +0000 (00:01 -0500)]
Rollup merge of #30261 - oli-obk:add_regression_test, r=pnkfelix

see https://github.com/rust-lang/rust/pull/30202/files#r46819188

r? @pnkfelix

the only difference between the tests is that one has the const_indexing feature enabled.

8 years agoRollup merge of #30224 - matklad:super-docs, r=steveklabnik
Steve Klabnik [Wed, 9 Dec 2015 05:01:17 +0000 (00:01 -0500)]
Rollup merge of #30224 - matklad:super-docs, r=steveklabnik

Make clear that `super` may be included in the path several times.

r? @steveklabnik

8 years agoRollup merge of #30201 - GuillaumeGomez:patch-3, r=Manishearth
Steve Klabnik [Wed, 9 Dec 2015 05:01:17 +0000 (00:01 -0500)]
Rollup merge of #30201 - GuillaumeGomez:patch-3, r=Manishearth

r? @Manishearth

8 years agoAuto merge of #30245 - Aatch:dynamic-align-dst, r=pnkfelix
bors [Wed, 9 Dec 2015 04:22:05 +0000 (04:22 +0000)]
Auto merge of #30245 - Aatch:dynamic-align-dst, r=pnkfelix

Fixes #26403

This adjusts the pointer, if needed, to the correct alignment by using the alignment information in the vtable.

Handling zero might not be necessary, as it shouldn't actually occur. I've left it as it's own commit so it can be removed fairly easily if people don't think it's worth doing. The way it's handled though means that there shouldn't be much impact on performance.

8 years agoAuto merge of #30208 - pnkfelix:fix-issue-30063, r=alexcrichton
bors [Wed, 9 Dec 2015 02:38:57 +0000 (02:38 +0000)]
Auto merge of #30208 - pnkfelix:fix-issue-30063, r=alexcrichton

 When given `rustc -C codegen-units=4 --emit=obj`, reset units back to 1.

Fix #30063

Note: while this code is careful to handle the case of mutliple emit types (e.g. `--emit=asm,obj`) by reporting all the emit types that conflict with codegen units in its warnings, an invocation with multiple emit types *and* `-o PATH` will continue to ignore the requested target path (with a warning), as it already does today, since the code that checks for that is further downstream.  (Multiple emit types without `-o PATH` will "work", though it will downgrade codegen-units to 1 just like all the other cases.)

r? @alexcrichton

8 years agoAuto merge of #30145 - petrochenkov:hyg, r=nrc
bors [Wed, 9 Dec 2015 00:41:26 +0000 (00:41 +0000)]
Auto merge of #30145 - petrochenkov:hyg, r=nrc

Instead of `ast::Ident`, bindings, paths and labels in HIR now keep a new structure called `hir::Ident` containing mtwt-renamed `name` and the original not-renamed `unhygienic_name`. `name` is supposed to be used by default, `unhygienic_name` is rarely used.

This is not ideal, but better than the status quo for two reasons:
- MTWT tables can be cleared immediately after lowering to HIR
- This is less bug-prone, because it is impossible now to forget applying `mtwt::resolve` to a name. It is still possible to use `name` instead of `unhygienic_name` by mistake, but `unhygienic_name`s are used only in few very special circumstances, so it shouldn't be a problem.

Besides name resolution `unhygienic_name` is used in some lints and debuginfo. `unhygienic_name` can be very well approximated by "reverse renaming" `token::intern(name.as_str())` or even plain string `name.as_str()`, except that it would break gensyms like `iter` in desugared `for` loops. This approximation is likely good enough for lints and debuginfo, but not for name resolution, unfortunately (see https://github.com/rust-lang/rust/issues/27639), so `unhygienic_name` has to be kept.

cc https://github.com/rust-lang/rust/issues/29782

r? @nrc

8 years agodoc: these are just renames, so avoid duplication
Tshepang Lekhonkhobe [Tue, 8 Dec 2015 23:10:28 +0000 (01:10 +0200)]
doc: these are just renames, so avoid duplication

8 years agoUpdate traits.md
Xmasreturns [Tue, 8 Dec 2015 22:56:42 +0000 (14:56 -0800)]
Update traits.md

8 years agoUpdate traits.md
Xmasreturns [Tue, 8 Dec 2015 22:38:55 +0000 (14:38 -0800)]
Update traits.md

Changes to readability and some clarifications for beginners

8 years agoAuto merge of #30271 - steveklabnik:reorder_book, r=aturon
bors [Tue, 8 Dec 2015 22:01:44 +0000 (22:01 +0000)]
Auto merge of #30271 - steveklabnik:reorder_book, r=aturon

This ordering was significantly more confusing.

8 years agostd: Use mem::replace in TLS initialization
Alex Crichton [Tue, 8 Dec 2015 15:23:37 +0000 (07:23 -0800)]
std: Use mem::replace in TLS initialization

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.

8 years agoAuto merge of #30036 - mitaa:doc_id, r=alexcrichton
bors [Tue, 8 Dec 2015 20:15:53 +0000 (20:15 +0000)]
Auto merge of #30036 - mitaa:doc_id, r=alexcrichton

This expands the code which generates unique IDs for Markdown headers within a single block to each rendered page.

fixes #25001
fixes #29449

8 years agoRe-order the sections in TRPL
Steve Klabnik [Tue, 8 Dec 2015 20:14:56 +0000 (15:14 -0500)]
Re-order the sections in TRPL

This ordering was significantly more confusing.

8 years agoFix a typo in `fd.rs`. Fixes #30231.
Richard Diamond [Tue, 8 Dec 2015 18:38:37 +0000 (12:38 -0600)]
Fix a typo in `fd.rs`. Fixes #30231.

8 years agoAuto merge of #29995 - DanielJCampbell:Expanded-Span-Printing, r=nrc
bors [Tue, 8 Dec 2015 18:23:57 +0000 (18:23 +0000)]
Auto merge of #29995 - DanielJCampbell:Expanded-Span-Printing, r=nrc

r? @nrc

8 years agoshorten common if let patterns to function calls
Oliver Schneider [Fri, 27 Nov 2015 16:39:44 +0000 (17:39 +0100)]
shorten common if let patterns to function calls

8 years agomove ConstVal -> ValueRef translation to trans::consts
Oliver Schneider [Fri, 27 Nov 2015 16:18:28 +0000 (17:18 +0100)]
move ConstVal -> ValueRef translation to trans::consts

8 years agoRemove STARTUP_OBJS from Makefile deps for non win-gnu targets.
Felix S. Klock II [Tue, 8 Dec 2015 13:56:22 +0000 (14:56 +0100)]
Remove STARTUP_OBJS from Makefile deps for non win-gnu targets.

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

8 years agoadd tests for ensuring const indexing does not cause compile-time errors in runtime...
Oliver Schneider [Tue, 8 Dec 2015 10:10:50 +0000 (11:10 +0100)]
add tests for ensuring const indexing does not cause compile-time errors in runtime code

8 years agoregression test for issue #30063
Felix S. Klock II [Fri, 4 Dec 2015 18:38:00 +0000 (19:38 +0100)]
regression test for issue #30063

8 years agoWhen given `rustc -C codegen-units=4 -o output --emit=obj`, reset units back to 1.
Felix S. Klock II [Fri, 4 Dec 2015 18:35:16 +0000 (19:35 +0100)]
When given `rustc -C codegen-units=4 -o output --emit=obj`, reset units back to 1.

Fix #30063

Note: while this code is careful to handle the case of mutliple emit
types (e.g. `--emit=asm,obj`) by reporting all the emit types that
conflict with codegen units in its warnings, an invocation with
multiple emit types *and* `-o PATH` will continue to ignore the
requested target path (with a warning), as it already does today,
since the code that checks for that is further downstream.

8 years agoFix unsized structs with destructors
James Miller [Tue, 8 Dec 2015 02:40:25 +0000 (15:40 +1300)]
Fix unsized structs with destructors

The presence of the drop flag caused the offset calculation to be
incorrect, leading to the pointer being incorrect. This has been fixed
by calculating the offset based on the field index (and not assuming
that the field is always the last one).

However, I've also stopped the drop flag from being added to the end of
unsized structs to begin with. Since it's not actually accessed for
unsized structs, and isn't actually where we would say it is, this made
more sense.

8 years agoAdded pretty-printing for span expansion chains through span_to_expanded_string.
Daniel Campbell [Tue, 24 Nov 2015 22:05:27 +0000 (11:05 +1300)]
Added pretty-printing for span expansion chains through span_to_expanded_string.

8 years agoAuto merge of #30087 - petrochenkov:indi, r=nrc
bors [Mon, 7 Dec 2015 22:28:45 +0000 (22:28 +0000)]
Auto merge of #30087 - petrochenkov:indi, r=nrc

I've measured the time/memory consumption before and after - the difference is lost in statistical noise, so it's mostly a code simplification.
Sizes of `enum`s are not affected.

r? @nrc

I wonder if AST/HIR visitors could run faster if `P`s are systematically removed (except for cases where they control `enum` sizes). Theoretically they should.
Remaining unnecessary `P`s can't be easily removed because many folders accept `P<X>`s as arguments, but these folders can be converted to accept `X`s instead without loss of efficiency.
When I have a mood for some mindless refactoring again, I'll probably try to convert the folders, remove remaining `P`s and measure again.

8 years agoAuto merge of #30256 - GuillaumeGomez:patch-5, r=Manishearth
bors [Mon, 7 Dec 2015 19:31:33 +0000 (19:31 +0000)]
Auto merge of #30256 - GuillaumeGomez:patch-5, r=Manishearth

r? @Manishearth

8 years agoAdd comments for Ident::from_name and identifiers in path segments
Vadim Petrochenkov [Mon, 7 Dec 2015 17:19:36 +0000 (20:19 +0300)]
Add comments for Ident::from_name and identifiers in path segments

8 years agoAdd E0264 error explanation
Guillaume Gomez [Mon, 7 Dec 2015 14:55:51 +0000 (15:55 +0100)]
Add E0264 error explanation

8 years agoRemove some unnecessary indirection from HIR structures
Vadim Petrochenkov [Mon, 7 Dec 2015 14:17:41 +0000 (17:17 +0300)]
Remove some unnecessary indirection from HIR structures

8 years agoAuto merge of #30202 - oli-obk:fix/const_index_feature_gate, r=Aatch
bors [Mon, 7 Dec 2015 11:36:57 +0000 (11:36 +0000)]
Auto merge of #30202 - oli-obk:fix/const_index_feature_gate, r=Aatch

see https://github.com/rust-lang/rust/issues/29947#issuecomment-161781257

I also added some missing tests

8 years agoAlign pointers to DST fields properly
James Miller [Sun, 6 Dec 2015 13:38:29 +0000 (02:38 +1300)]
Align pointers to DST fields properly

DST fields, being of an unknown type, are not automatically aligned
properly, so a pointer to the field needs to be aligned using the
information in the vtable.

Fixes #26403 and a number of other DST-related bugs discovered while
implementing this.

8 years agoAuto merge of #30188 - tshepang:lookup_addr-example, r=alexcrichton
bors [Mon, 7 Dec 2015 07:11:19 +0000 (07:11 +0000)]
Auto merge of #30188 - tshepang:lookup_addr-example, r=alexcrichton

8 years agoAuto merge of #30247 - bluss:revert-array-clone, r=alexcrichton
bors [Mon, 7 Dec 2015 02:16:13 +0000 (02:16 +0000)]
Auto merge of #30247 - bluss:revert-array-clone, r=alexcrichton

Revert "PR #30130 Implement `Clone` for more arrays"

This reverts commit e22a64e8d8d4da46c74f878ce1c23ad1c88982e8.

This caused a regression such that types like `[[u8; 256]; 4]`
no longer implemented Clone. This previously worked due to Clone
for `[T; N]` (N in 0 to 32) being implemented for T: Copy.

Due to fixed size arrays not implementing Clone for sizes above 32,
the new implementation requiring T: Clone would not allow
`[[u8; 256]; 4]` to be Clone.

Fixes #30244

Due to changing back, this is technically a [breaking-change],
albeit for a behavior that existed for a very short time.

8 years agoAdd regression test for Clone for [[T; 256]; 4] where T: Copy and not Clone
Ulrik Sverdrup [Mon, 7 Dec 2015 00:50:35 +0000 (01:50 +0100)]
Add regression test for Clone for [[T; 256]; 4] where T: Copy and not Clone

8 years agoREADME.md - RAM requirement on 32-bit *nix
petevine [Mon, 7 Dec 2015 00:12:53 +0000 (01:12 +0100)]
README.md - RAM requirement on 32-bit *nix

Running `/usr/bin/time -v make` to build rust (using local llvm) shows the maximum memory usage at 715 megabytes on 32-bit x86 (on arm linux it's even less @ 580M).

Reworded according to @brson's input.

8 years agoRevert "PR #30130 Implement `Clone` for more arrays"
Ulrik Sverdrup [Sun, 6 Dec 2015 23:29:21 +0000 (00:29 +0100)]
Revert "PR #30130 Implement `Clone` for more arrays"

This reverts commit e22a64e8d8d4da46c74f878ce1c23ad1c88982e8.

This caused a regression such that types like `[[u8; 256]; 4]`
no longer implemented Clone. This previously worked due to Clone
for `[T; N]` (N in 0 to 32) being implemented for T: Copy.

Due to fixed size arrays not implementing Clone for sizes above 32,
the new implementation requiring T: Clone would not allow
`[[u8; 256]; 4]` to be Clone.

8 years agoFix typo in make var
Markus Unterwaditzer [Sun, 6 Dec 2015 23:20:35 +0000 (00:20 +0100)]
Fix typo in make var

8 years agodoc: add example for std::net::lookup_addr
Tshepang Lekhonkhobe [Thu, 3 Dec 2015 19:09:21 +0000 (21:09 +0200)]
doc: add example for std::net::lookup_addr

8 years agoAuto merge of #30241 - Manishearth:diag-30236, r=eddyb
bors [Sun, 6 Dec 2015 17:50:44 +0000 (17:50 +0000)]
Auto merge of #30241 - Manishearth:diag-30236, r=eddyb

r? @eddyb

8 years agoCorrect span for unused type parameter error in type alias (fixes #30236)
Manish Goregaokar [Sun, 6 Dec 2015 16:55:53 +0000 (22:25 +0530)]
Correct span for unused type parameter error in type alias (fixes #30236)

8 years agoAuto merge of #30234 - vyp:doc-typo, r=apasel422
bors [Sun, 6 Dec 2015 13:23:43 +0000 (13:23 +0000)]
Auto merge of #30234 - vyp:doc-typo, r=apasel422

8 years agodoc(book/error-handling): fix typo
xd1le [Sun, 6 Dec 2015 09:32:49 +0000 (20:32 +1100)]
doc(book/error-handling): fix typo

8 years agoAuto merge of #30221 - thyrgle:concurrency_doc, r=alexcrichton
bors [Sun, 6 Dec 2015 08:50:49 +0000 (08:50 +0000)]
Auto merge of #30221 - thyrgle:concurrency_doc, r=alexcrichton

The example code in the Channels subsection of the rust book give warnings about

    unused result which must be used, #[warn(unused_must_use)] on by default

Added a small pattern match to resolve those warnings.

8 years agoAuto merge of #30222 - mitaa:fqn#2, r=alexcrichton
bors [Sun, 6 Dec 2015 06:49:03 +0000 (06:49 +0000)]
Auto merge of #30222 - mitaa:fqn#2, r=alexcrichton

I missed this in #30149

fixes #30198

r? @alexcrichton

8 years agoAuto merge of #30187 - alexcrichton:stabilize-1.6, r=aturon
bors [Sun, 6 Dec 2015 04:12:54 +0000 (04:12 +0000)]
Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturon

This commit is the standard API stabilization commit for the 1.6 release cycle.
The list of issues and APIs below have all been through their cycle-long FCP and
the libs team decisions are listed below

Stabilized APIs

* `Read::read_exact`
* `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`)
* libcore -- this was a bit of a nuanced stabilization, the crate itself is now
  marked as `#[stable]` and the methods appearing via traits for primitives like
  `char` and `str` are now also marked as stable. Note that the extension traits
  themeselves are marked as unstable as they're imported via the prelude. The
  `try!` macro was also moved from the standard library into libcore to have the
  same interface. Otherwise the functions all have copied stability from the
  standard library now.
* `fs::DirBuilder`
* `fs::DirBuilder::new`
* `fs::DirBuilder::recursive`
* `fs::DirBuilder::create`
* `os::unix::fs::DirBuilderExt`
* `os::unix::fs::DirBuilderExt::mode`
* `vec::Drain`
* `vec::Vec::drain`
* `string::Drain`
* `string::String::drain`
* `vec_deque::Drain`
* `vec_deque::VecDeque::drain`
* `collections::hash_map::Drain`
* `collections::hash_map::HashMap::drain`
* `collections::hash_set::Drain`
* `collections::hash_set::HashSet::drain`
* `collections::binary_heap::Drain`
* `collections::binary_heap::BinaryHeap::drain`
* `Vec::extend_from_slice` (renamed from `push_all`)
* `Mutex::get_mut`
* `Mutex::into_inner`
* `RwLock::get_mut`
* `RwLock::into_inner`
* `Iterator::min_by_key` (renamed from `min_by`)
* `Iterator::max_by_key` (renamed from `max_by`)

Deprecated APIs

* `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`)
* `OsString::from_bytes`
* `OsStr::to_cstring`
* `OsStr::to_bytes`
* `fs::walk_dir` and `fs::WalkDir`
* `path::Components::peek`
* `slice::bytes::MutableByteVector`
* `slice::bytes::copy_memory`
* `Vec::push_all` (renamed to `extend_from_slice`)
* `Duration::span`
* `IpAddr`
* `SocketAddr::ip`
* `Read::tee`
* `io::Tee`
* `Write::broadcast`
* `io::Broadcast`
* `Iterator::min_by` (renamed to `min_by_key`)
* `Iterator::max_by` (renamed to `max_by_key`)
* `net::lookup_addr`

New APIs (still unstable)

* `<[T]>::sort_by_key` (added to mirror `min_by_key`)

Closes #27585
Closes #27704
Closes #27707
Closes #27710
Closes #27711
Closes #27727
Closes #27740
Closes #27744
Closes #27799
Closes #27801
cc #27801 (doesn't close as `Chars` is still unstable)
Closes #28968

8 years agoAuto merge of #30212 - GuillaumeGomez:css_split, r=brson
bors [Sun, 6 Dec 2015 01:40:20 +0000 (01:40 +0000)]
Auto merge of #30212 - GuillaumeGomez:css_split, r=brson

r? @brson

8 years agostd: Stabilize APIs for the 1.6 release
Alex Crichton [Thu, 3 Dec 2015 01:31:49 +0000 (17:31 -0800)]
std: Stabilize APIs for the 1.6 release

This commit is the standard API stabilization commit for the 1.6 release cycle.
The list of issues and APIs below have all been through their cycle-long FCP and
the libs team decisions are listed below

Stabilized APIs

* `Read::read_exact`
* `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`)
* libcore -- this was a bit of a nuanced stabilization, the crate itself is now
  marked as `#[stable]` and the methods appearing via traits for primitives like
  `char` and `str` are now also marked as stable. Note that the extension traits
  themeselves are marked as unstable as they're imported via the prelude. The
  `try!` macro was also moved from the standard library into libcore to have the
  same interface. Otherwise the functions all have copied stability from the
  standard library now.
* The `#![no_std]` attribute
* `fs::DirBuilder`
* `fs::DirBuilder::new`
* `fs::DirBuilder::recursive`
* `fs::DirBuilder::create`
* `os::unix::fs::DirBuilderExt`
* `os::unix::fs::DirBuilderExt::mode`
* `vec::Drain`
* `vec::Vec::drain`
* `string::Drain`
* `string::String::drain`
* `vec_deque::Drain`
* `vec_deque::VecDeque::drain`
* `collections::hash_map::Drain`
* `collections::hash_map::HashMap::drain`
* `collections::hash_set::Drain`
* `collections::hash_set::HashSet::drain`
* `collections::binary_heap::Drain`
* `collections::binary_heap::BinaryHeap::drain`
* `Vec::extend_from_slice` (renamed from `push_all`)
* `Mutex::get_mut`
* `Mutex::into_inner`
* `RwLock::get_mut`
* `RwLock::into_inner`
* `Iterator::min_by_key` (renamed from `min_by`)
* `Iterator::max_by_key` (renamed from `max_by`)

Deprecated APIs

* `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`)
* `OsString::from_bytes`
* `OsStr::to_cstring`
* `OsStr::to_bytes`
* `fs::walk_dir` and `fs::WalkDir`
* `path::Components::peek`
* `slice::bytes::MutableByteVector`
* `slice::bytes::copy_memory`
* `Vec::push_all` (renamed to `extend_from_slice`)
* `Duration::span`
* `IpAddr`
* `SocketAddr::ip`
* `Read::tee`
* `io::Tee`
* `Write::broadcast`
* `io::Broadcast`
* `Iterator::min_by` (renamed to `min_by_key`)
* `Iterator::max_by` (renamed to `max_by_key`)
* `net::lookup_addr`

New APIs (still unstable)

* `<[T]>::sort_by_key` (added to mirror `min_by_key`)

Closes #27585
Closes #27704
Closes #27707
Closes #27710
Closes #27711
Closes #27727
Closes #27740
Closes #27744
Closes #27799
Closes #27801
cc #27801 (doesn't close as `Chars` is still unstable)
Closes #28968

8 years agoUses unwrap instead of pattern matching
Christopher Sumnicht [Sat, 5 Dec 2015 23:01:05 +0000 (15:01 -0800)]
Uses unwrap instead of pattern matching

8 years agoAdd tests
mitaa [Sat, 5 Dec 2015 22:09:20 +0000 (23:09 +0100)]
Add tests