]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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

8 years agoAuto merge of #30177 - retep998:handling-threads, r=alexcrichton
bors [Sat, 5 Dec 2015 20:49:16 +0000 (20:49 +0000)]
Auto merge of #30177 - retep998:handling-threads, r=alexcrichton

Allows a `HANDLE` to be extracted from a `JoinHandle` on Windows.
Allows a `pthread_t` to be extracted from a `JoinHandle` everywhere else.

Because https://github.com/rust-lang/rust/pull/29461 was closed.

r? @alexcrichton

8 years agoDOCS: update reference about paths
Aleksey Kladov [Sat, 5 Dec 2015 18:55:34 +0000 (21:55 +0300)]
DOCS: update reference about paths

8 years agoAuto merge of #30215 - SimonSapin:ipv6-display-alloc, r=brson
bors [Sat, 5 Dec 2015 17:58:46 +0000 (17:58 +0000)]
Auto merge of #30215 - SimonSapin:ipv6-display-alloc, r=brson

8 years agofix const index feature-gate regression
Oliver Schneider [Fri, 4 Dec 2015 14:35:07 +0000 (15:35 +0100)]
fix const index feature-gate regression

8 years agoAuto merge of #30102 - jFransham:feature/better-lifetime-errors, r=Manishearth
bors [Sat, 5 Dec 2015 12:52:30 +0000 (12:52 +0000)]
Auto merge of #30102 - jFransham:feature/better-lifetime-errors, r=Manishearth

Fixes #30086

8 years agoReuse `record_extern_fqn`
mitaa [Sat, 5 Dec 2015 10:58:04 +0000 (11:58 +0100)]
Reuse `record_extern_fqn`

These locations erroneously used the local item-path instead of the
extern item-path.

8 years agoResolved warnings about unused result
Christopher Sumnicht [Sat, 5 Dec 2015 11:17:18 +0000 (03:17 -0800)]
Resolved warnings about unused result

8 years agoAuto merge of #30207 - jwworth:pull-request-1449250353, r=apasel422
bors [Sat, 5 Dec 2015 10:58:37 +0000 (10:58 +0000)]
Auto merge of #30207 - jwworth:pull-request-1449250353, r=apasel422

This fixes a double word typo, 'can'.

8 years agoRemove allocations in `impl Display for Ipv6Addr`
Simon Sapin [Fri, 4 Dec 2015 23:44:16 +0000 (00:44 +0100)]
Remove allocations in `impl Display for Ipv6Addr`

8 years agoAuto merge of #30185 - fhahn:improve-borrowck-public-accessibility, r=pnkfelix
bors [Sat, 5 Dec 2015 09:08:14 +0000 (09:08 +0000)]
Auto merge of #30185 - fhahn:improve-borrowck-public-accessibility, r=pnkfelix

This PR makes `AnalysisData` and`BorrowckCtxt` public. Those types are returned by the public function `build_borrowck_dataflow_data_for_fn` and are needed if a caller wants to pass on the return values.

It also removes `FnPartsWithCFG`, which required callers of  `build_borrowck_dataflow_data_for_fn` to have a reference to a `CFG` with the same lifetime as `FnParts`, which is more limiting than required.

8 years agoAuto merge of #30211 - pnkfelix:fix-getopts-for-issue-30204, r=alexcrichton
bors [Sat, 5 Dec 2015 05:30:47 +0000 (05:30 +0000)]
Auto merge of #30211 - pnkfelix:fix-getopts-for-issue-30204, r=alexcrichton

Fix internal `getopts` so `--a=b=c` acts like `--a b=c` rather than `--a b`.

Fix #30204

8 years agoAuto merge of #30210 - nagisa:tweak-man, r=alexcrichton
bors [Sat, 5 Dec 2015 03:39:45 +0000 (03:39 +0000)]
Auto merge of #30210 - nagisa:tweak-man, r=alexcrichton

r? @alexcrichton

8 years agoAdd JoinHandleExt to get the pthread_t on unix platforms
Peter Atashian [Fri, 4 Dec 2015 02:58:00 +0000 (21:58 -0500)]
Add JoinHandleExt to get the pthread_t on unix platforms

Signed-off-by: Peter Atashian <retep998@gmail.com>
8 years agoAsRawHandle and IntoRawHandle for JoinHandle
Peter Atashian [Thu, 29 Oct 2015 20:54:09 +0000 (16:54 -0400)]
AsRawHandle and IntoRawHandle for JoinHandle
This allows users to get the HANDLE of a spawned thread on Windows

Signed-off-by: Peter Atashian <retep998@gmail.com>
8 years agoAuto merge of #30205 - alexcrichton:fix-dist, r=brson
bors [Sat, 5 Dec 2015 00:42:37 +0000 (00:42 +0000)]
Auto merge of #30205 - alexcrichton:fix-dist, r=brson

Now that AUTHORS.txt no longer exists we shouldn't try to package it.

8 years agoAuto merge of #30130 - tbu-:pr_array_clone, r=alexcrichton
bors [Fri, 4 Dec 2015 22:52:02 +0000 (22:52 +0000)]
Auto merge of #30130 - tbu-:pr_array_clone, r=alexcrichton

[breaking-change]

8 years agoDo MTWT resolution during lowering to HIR
Vadim Petrochenkov [Tue, 1 Dec 2015 17:38:40 +0000 (20:38 +0300)]
Do MTWT resolution during lowering to HIR

8 years agoExpand run-make test with regression tests for #30204
Felix S. Klock II [Fri, 4 Dec 2015 21:02:48 +0000 (22:02 +0100)]
Expand run-make test with regression tests for #30204

Fix #30204.

8 years agoChange internal `getopts` so `--a=b=c` acts like `--a b=c` rather than `--a b`.
Felix S. Klock II [Fri, 4 Dec 2015 21:02:09 +0000 (22:02 +0100)]
Change internal `getopts` so `--a=b=c` acts like `--a b=c` rather than `--a b`.

This is an adaption of

 https://github.com/rust-lang-nursery/getopts/commit/8ec916b86afce0a2a9100b7327b12b5ffcb2cabb

including its unit test.

8 years agoAuto merge of #30173 - sgrif:sg-fix-time-bug, r=alexcrichton
bors [Fri, 4 Dec 2015 21:01:03 +0000 (21:01 +0000)]
Auto merge of #30173 - sgrif:sg-fix-time-bug, r=alexcrichton

Currently if you add a duration which should lead to 0 nanos and 1
additional second, we end up with no additional seconds, and 1000000000
nanos.

8 years agoTweak manpage’s emit section
Simonas Kazlauskas [Fri, 4 Dec 2015 19:11:04 +0000 (21:11 +0200)]
Tweak manpage’s emit section

8 years agoAuto merge of #30084 - oli-obk:const_fn, r=pnkfelix
bors [Fri, 4 Dec 2015 17:47:18 +0000 (17:47 +0000)]
Auto merge of #30084 - oli-obk:const_fn, r=pnkfelix

8 years agoFix typo
Jake Worth [Fri, 4 Dec 2015 17:32:36 +0000 (12:32 -0500)]
Fix typo

8 years agomk: Fix `make dist`
Alex Crichton [Fri, 4 Dec 2015 16:55:02 +0000 (08:55 -0800)]
mk: Fix `make dist`

Now that AUTHORS.txt no longer exists we shouldn't try to package it.

8 years agoFix the time overflow on mac as well
Sean Griffin [Fri, 4 Dec 2015 16:49:35 +0000 (09:49 -0700)]
Fix the time overflow on mac as well

8 years agoAdd E0452 error explanation
Guillaume Gomez [Fri, 4 Dec 2015 11:19:58 +0000 (12:19 +0100)]
Add E0452 error explanation

8 years agoAuto merge of #30192 - jwworth:pull-request-1449185301, r=alexcrichton
bors [Fri, 4 Dec 2015 11:46:44 +0000 (11:46 +0000)]
Auto merge of #30192 - jwworth:pull-request-1449185301, r=alexcrichton

This fixes a double word typo, 'of'.

8 years agoDon't use an explicit temporary for cloning an array
Tobias Bucher [Tue, 1 Dec 2015 23:33:50 +0000 (23:33 +0000)]
Don't use an explicit temporary for cloning an array

8 years agoImplement `Clone` for arrays without using slice patterns
Tobias Bucher [Tue, 1 Dec 2015 19:53:08 +0000 (19:53 +0000)]
Implement `Clone` for arrays without using slice patterns

8 years agoImplement `Clone` for `[T; 0]` to `[T; 32]` if `T: Clone`
Tobias Bucher [Tue, 1 Dec 2015 03:05:32 +0000 (03:05 +0000)]
Implement `Clone` for `[T; 0]` to `[T; 32]` if `T: Clone`

8 years agoAuto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelix
bors [Fri, 4 Dec 2015 08:46:29 +0000 (08:46 +0000)]
Auto merge of #29850 - Kimundi:attributes_that_make_a_statement, r=pnkfelix

See https://github.com/rust-lang/rfcs/pull/16 and https://github.com/rust-lang/rust/issues/15701

- Added syntax support for attributes on expressions and all syntax nodes in statement position.
- Extended `#[cfg]` folder to allow removal of statements, and
of expressions in optional positions like expression lists and trailing
block expressions.
- Extended lint checker to recognize lint levels on expressions and
locals.
- As per RFC, attributes are not yet accepted on `if` expressions.

Examples:
  ```rust
let x = y;
{
        ...
}
assert_eq!((1, #[cfg(unset)] 2, 3), (1, 3));

let FOO = 0;
```

Implementation wise, there are a few rough corners and open questions:
- The parser work ended up a bit ugly.
- The pretty printer change was based mostly on guessing.
- Similar to the `if` case, there are some places in the grammar where a new `Expr` node starts,
  but where it seemed weird to accept attributes and hence the parser doesn't. This includes:
  - const expressions in patterns
  - in the middle of an postfix operator chain (that is, after `.`, before indexing, before calls)
  - on range expressions, since `#[attr] x .. y` parses as  `(#[attr] x) .. y`, which is inconsistent with
    `#[attr] .. y` which would parse as `#[attr] (.. y)`
- Attributes are added as additional `Option<Box<Vec<Attribute>>>` fields in expressions and locals.
- Memory impact has not been measured yet.
- A cfg-away trailing expression in a block does not currently promote the previous `StmtExpr` in a block to a new trailing expr. That is to say, this won't work:
```rust
let x = {
    #[cfg(foo)]
    Foo { data: x }
    #[cfg(not(foo))]
    Foo { data: y }
};
```
- One-element tuples can have their inner expression removed to become Unit, but just Parenthesis can't. Eg, `(#[cfg(unset)] x,) == ()` but `(#[cfg(unset)] x) == error`. This seemed reasonable to me since tuples and unit are type constructors, but could probably be argued either way.
- Attributes on macro nodes are currently unconditionally dropped during macro expansion, which seemed fine since macro disappear at that point?
- Attributes on `ast::ExprParens` will be prepend-ed to the inner expression in the hir folder.
- The work on pretty printer tests for this did trigger, but not fix errors regarding macros:
  - expression `foo![]` prints as `foo!()`
  - expression `foo!{}` prints as `foo!()`
  - statement `foo![];` prints as `foo!();`
  - statement `foo!{};` prints as `foo!();`
  - statement `foo!{}` triggers a `None` unwrap ICE.

8 years agoAuto merge of #30189 - crumblingstatue:patch-1, r=alexcrichton
bors [Fri, 4 Dec 2015 06:05:08 +0000 (06:05 +0000)]
Auto merge of #30189 - crumblingstatue:patch-1, r=alexcrichton

Replace the old link pointing to an out-of-date gist with a
link to the lazy_static crate on crates.io.

We also don't need to state the author, as the crates.io page
shows the authors and owners.

8 years agoAuto merge of #30190 - tshepang:dir_builder-example, r=alexcrichton
bors [Fri, 4 Dec 2015 03:26:46 +0000 (03:26 +0000)]
Auto merge of #30190 - tshepang:dir_builder-example, r=alexcrichton

8 years agoIgnore rpass-fulldeps test in cross compile tests
Marvin Löbel [Fri, 4 Dec 2015 02:47:53 +0000 (03:47 +0100)]
Ignore rpass-fulldeps test in cross compile tests

8 years agoAuto merge of #30183 - retep998:min-align, r=alexcrichton
bors [Fri, 4 Dec 2015 01:42:10 +0000 (01:42 +0000)]
Auto merge of #30183 - retep998:min-align, r=alexcrichton

This fixes it so the Rust allocator on Windows 32-bit doesn't think the system allocator is aligned to 16 when it is really only aligned to 8.

8 years agoSplit rustdoc css to modify it more easily
Guillaume Gomez [Fri, 4 Dec 2015 00:54:59 +0000 (01:54 +0100)]
Split rustdoc css to modify it more easily

8 years agoAddress review comments
mitaa [Thu, 3 Dec 2015 23:48:59 +0000 (00:48 +0100)]
Address review comments

8 years agoFix typo
Jake Worth [Thu, 3 Dec 2015 23:29:00 +0000 (18:29 -0500)]
Fix typo