]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoFix remaining documentation to reflect fail!() -> panic!()
Barosl Lee [Tue, 11 Nov 2014 18:36:09 +0000 (03:36 +0900)]
Fix remaining documentation to reflect fail!() -> panic!()

Throughout the docs, "failure" was replaced with "panics" if it means a
task panic. Otherwise, it remained as is, or changed to "errors" to
clearly differentiate it from a task panic.

9 years agoauto merge of #18808 : ebfe/rust/lint-names, r=alexcrichton
bors [Tue, 11 Nov 2014 12:21:59 +0000 (12:21 +0000)]
auto merge of #18808 : ebfe/rust/lint-names, r=alexcrichton

9 years agoauto merge of #18797 : vadimcn/rust/prefer-bundled2, r=alexcrichton
bors [Tue, 11 Nov 2014 10:12:00 +0000 (10:12 +0000)]
auto merge of #18797 : vadimcn/rust/prefer-bundled2, r=alexcrichton

Based on Windows bundle feedback we got to date,
- We *do* want to prefer the bundled linker: The external one might be for the wrong architecture (e.g. 32 bit vs 64 bit).  On the other hand, binutils don't add many new features these days, so using an older bundled linker is not likely to be a problem.
- We *do* want to prefer bundled libraries: The external ones might not have the symbols we expect (e.g. what's needed for DWARF exceptions vs SjLj).  Since `-L rustlib/<triple>/lib` appears first on the linker command line, it's a good place to keep our platform libs that we want to be found first.

Closes #18325, closes #17726.

9 years agoauto merge of #18789 : cuviper/rust/vim-move, r=alexcrichton
bors [Tue, 11 Nov 2014 07:16:56 +0000 (07:16 +0000)]
auto merge of #18789 : cuviper/rust/vim-move, r=alexcrichton

It used to be in `rustKeyword`, until commit 5c75f210ba6e450fb1603b50ca0a4805f13173d7 removed it, and then #18782 restored it again.  However, this is now a closure modifier, and I think moving it to `rustStorage` is more appropriate to highlight it similarly to `mut`, `ref`, and the `&` sigil.

9 years agoauto merge of #18766 : liigo/rust/improve-inner-attr-msg, r=huonw
bors [Tue, 11 Nov 2014 04:26:57 +0000 (04:26 +0000)]
auto merge of #18766 : liigo/rust/improve-inner-attr-msg, r=huonw

for the code:
```
use std::io;

#![crate_type="rlib"] // ERROR: an inner attribute is not permitted in this context

fn say_hello() {
println!("hello");
}
```

this PR provides another note to help programmer fixing this error more easily:
```
hello.rs:6:3: 6:4 error: an inner attribute is not permitted in this context
hello.rs:6 #![crate_type="rlib"]
             ^
hello.rs:6:3: 6:4 note: put inner attribute in top of file or block
hello.rs:6 #![crate_type="rlib"]
             ^
```

9 years agoauto merge of #18753 : jbcrail/rust/fix-deprecated-enum-set, r=alexcrichton
bors [Tue, 11 Nov 2014 02:11:54 +0000 (02:11 +0000)]
auto merge of #18753 : jbcrail/rust/fix-deprecated-enum-set, r=alexcrichton

I renamed the deprecated methods, resulting from the collection reform.

9 years agosyntax: improve message for misused inner attributes
Liigo Zhuang [Sat, 8 Nov 2014 09:23:27 +0000 (17:23 +0800)]
syntax: improve message for misused inner attributes

9 years agoauto merge of #18857 : brson/rust/winescapefixes, r=alexcrichton
bors [Mon, 10 Nov 2014 23:01:57 +0000 (23:01 +0000)]
auto merge of #18857 : brson/rust/winescapefixes, r=alexcrichton

9 years agomk: Fix configuration of version commit information
Brian Anderson [Mon, 10 Nov 2014 17:54:25 +0000 (09:54 -0800)]
mk: Fix configuration of version commit information

Commit bec2ee77f78b4bb8a503101091272a634a273a1c started quoting paths
discovered as part of the `probe` function, which includes git.  The
`make` `wildcard` function appears to be incompatible with quoted
paths so this check in the makefile now fails. Employing `wildcard`
here appears to only re-verify that git actually exists, which the
configure script already did, so I've just removed it.

Additionally, with the quoted paths the `subst` function should no
longer be needed, so I've removed it as well.

Closes #18771

9 years agovim: move 'move' to rustStorage
Josh Stone [Mon, 10 Nov 2014 21:48:17 +0000 (13:48 -0800)]
vim: move 'move' to rustStorage

9 years agoAttempt to fix the problem with failing distcheck.
Vitali Haravy [Mon, 10 Nov 2014 21:05:34 +0000 (21:05 +0000)]
Attempt to fix the problem with failing distcheck.

9 years agoauto merge of #18287 : michaelsproul/rust/triemap-collection-views, r=bstrie
bors [Mon, 10 Nov 2014 20:21:53 +0000 (20:21 +0000)]
auto merge of #18287 : michaelsproul/rust/triemap-collection-views, r=bstrie

I've implemented the new collection views API for TrieMap. I more or less followed the approach set out by @Gankro in BTreeMap, by using a `SearchStack`. There's quite a bit of unsafe code, but I've wrapped it safely where I think is appropriate. I've added tests to ensure everything works, and performance seems quite good.

```
test trie::bench_map::bench_find                           ... bench:     67879 ns/iter (+/- 4192)
test trie::bench_map::bench_find_entry                     ... bench:    186814 ns/iter (+/- 18748)
test trie::bench_map::bench_insert_large                   ... bench:    716612 ns/iter (+/- 160121)
test trie::bench_map::bench_insert_large_entry             ... bench:    851219 ns/iter (+/- 20331)
test trie::bench_map::bench_remove                         ... bench:    838856 ns/iter (+/- 27998)
test trie::bench_map::bench_remove_entry                   ... bench:    981711 ns/iter (+/- 53046)
```

Using an entry is slow compared to a plain find, but is only ~15% slower for inserts and removes, which is where this API is most useful. I'm tempted to remove the standalone `remove` function in favour of an entry-based approach (to cut down on complexity).

I've added some more comments to the general part of the code-base, which will hopefully help the next person looking over this. I moved the three key structures to the top of the file so that the nesting structure is clearly visible, and renamed `Child<T>` to `TrieNode<T>` and `TrieNode<T>` to `InternalNode<T>` to improve clarity. If these changes are creeping, I'm happy to revert them.

Let me know if my use of `fail!` is ok, I was a little unsure of how specific to be. Some of the data-structures have various invariants that shouldn't be broken, so using `fail!` seemed appropriate.

## Still to do

* Modernise iterators (make them double-ended).
* Make the keys generic, or rename this data-structure (see: https://github.com/rust-lang/rust/issues/14902).
* Possibly move this code out of libcollections. [Searching Github for TrieMap turns up very few real results.][triemap-search]

Related issues: https://github.com/rust-lang/rust/issues/18009 and https://github.com/rust-lang/rust/issues/17320

[triemap-search]: https://github.com/search?utf8=%E2%9C%93&q=TrieMap+language%3ARust&type=Code&ref=searchresults

9 years agoImplement collection views API for TrieMap.
Michael Sproul [Thu, 23 Oct 2014 01:02:33 +0000 (18:02 -0700)]
Implement collection views API for TrieMap.

9 years agoFix 'renamed lint' warnings
Michael Gehring [Sun, 9 Nov 2014 12:59:23 +0000 (13:59 +0100)]
Fix 'renamed lint' warnings

9 years agoauto merge of #18802 : bkoropoff/rust/issue-18769, r=luqmana
bors [Mon, 10 Nov 2014 16:12:03 +0000 (16:12 +0000)]
auto merge of #18802 : bkoropoff/rust/issue-18769, r=luqmana

Drill down the loan path for `McDeclared` references as well since it might lead to an upvar.  Closes #18769

9 years agoauto merge of #18795 : haberman/rust/master, r=cmr
bors [Mon, 10 Nov 2014 14:07:00 +0000 (14:07 +0000)]
auto merge of #18795 : haberman/rust/master, r=cmr

Previously Int inherited from PartialOrd (via Primitive)
but not Ord.  But integers have a total order, so
inheriting from Ord is appropriate. Fixes #18776.

9 years agoauto merge of #18792 : sfackler/rust/struct-variants, r=alexcrichton
bors [Mon, 10 Nov 2014 11:06:54 +0000 (11:06 +0000)]
auto merge of #18792 : sfackler/rust/struct-variants, r=alexcrichton

We need a snapshot before the parser can be adjusted.

9 years agoauto merge of #18782 : netvl/rust/update-vim-syntax, r=alexcrichton
bors [Mon, 10 Nov 2014 07:01:49 +0000 (07:01 +0000)]
auto merge of #18782 : netvl/rust/update-vim-syntax, r=alexcrichton

`as` (already for a long time) and `move` (which was only added recently, AFAIK) are not marked as keywords in Vim syntax file, so they are not highlighted as keywords in Rust sources. This PR fixes this.

9 years agoauto merge of #18781 : klutzy/rust/cross, r=cmr
bors [Mon, 10 Nov 2014 04:41:49 +0000 (04:41 +0000)]
auto merge of #18781 : klutzy/rust/cross, r=cmr

cc #12859

9 years agoauto merge of #18780 : bkoropoff/rust/regionck-for-loop, r=eddyb
bors [Sun, 9 Nov 2014 22:31:44 +0000 (22:31 +0000)]
auto merge of #18780 : bkoropoff/rust/regionck-for-loop, r=eddyb

Use the mem-cat of the iterator element type rather than the iterator itself when processing the for loop pattern.

Closes #17068
Closes #18767

9 years agoauto merge of #18739 : vhbit/rust/issue-18574, r=alexcrichton
bors [Sun, 9 Nov 2014 20:01:44 +0000 (20:01 +0000)]
auto merge of #18739 : vhbit/rust/issue-18574, r=alexcrichton

Fixes #18574

9 years agoAdded `move` keyword and renamed `fail` to `panic`
Vladimir Matveev [Sat, 8 Nov 2014 19:38:10 +0000 (22:38 +0300)]
Added `move` keyword and renamed `fail` to `panic`

9 years agoauto merge of #18762 : mdinger/rust/str_coerce, r=steveklbanik
bors [Sun, 9 Nov 2014 17:06:45 +0000 (17:06 +0000)]
auto merge of #18762 : mdinger/rust/str_coerce, r=steveklbanik

I had slight confusion when using this as a reference and was told it was imprecise. Most of the rewording was suggested by @huonw.

cc @steveklabnik

9 years agoauto merge of #18756 : jbcrail/rust/add-enum-set-bitxor, r=alexcrichton
bors [Sun, 9 Nov 2014 15:11:43 +0000 (15:11 +0000)]
auto merge of #18756 : jbcrail/rust/add-enum-set-bitxor, r=alexcrichton

I implemented BitXor, and also added tests for BitAnd and BitXor.

cc #18424

9 years agoauto merge of #18755 : japaric/rust/ord, r=alexcrichton
bors [Sun, 9 Nov 2014 12:31:40 +0000 (12:31 +0000)]
auto merge of #18755 : japaric/rust/ord, r=alexcrichton

Closes #18738
cc #15689

r? @alexcrichton
cc @cmr

9 years agoFirst stage of struct variant field visibility changes
Steven Fackler [Sun, 9 Nov 2014 00:54:33 +0000 (16:54 -0800)]
First stage of struct variant field visibility changes

We need a snapshot before the parser can be adjusted.

9 years agoauto merge of #18748 : carols10cents/rust/prepend-to-append, r=alexcrichton
bors [Sun, 9 Nov 2014 07:46:41 +0000 (07:46 +0000)]
auto merge of #18748 : carols10cents/rust/prepend-to-append, r=alexcrichton

A most trivial documentation correction. The examples in the intro are all about adding to the end of the array, not the beginning, but this one line says "prepend".

This isn't a very serious problem, it just made me a bit confused when I got to it.

9 years agoauto merge of #18557 : aturon/rust/io-removal, r=alexcrichton
bors [Sun, 9 Nov 2014 05:51:44 +0000 (05:51 +0000)]
auto merge of #18557 : aturon/rust/io-removal, r=alexcrichton

This PR includes a sequence of commits that gradually dismantles the `librustrt` `rtio` system -- the main trait previously used to abstract over green and native io. It also largely dismantles `libnative`, moving much of its code into `libstd` and refactoring as it does so.

TL;DR:

* Before this PR: `rustc hello.rs && wc -c hello` produces 715,996
* After this PR:  `rustc hello.rs && wc -c hello` produces 368,100

That is, this PR reduces the footprint of hello world by ~50%.

This is a major step toward #17325 (i.e. toward implementing the [runtime removal RFC](https://github.com/rust-lang/rfcs/pull/230).) What remains is to pull out the scheduling, synchronization and task infrastructure, and to remove `libgreen`. These will be done soon in a follow-up PR.

Part of the work here is eliminating the `rtio` abstraction, which in many cases means bringing the implementation of io closer to the actual API presented in `std::io`.

Another aspect of this PR is the creation of two new, *private* modules within `std` that implement io:

* The `sys` module, which represents a platform-specific implementation of a number of low-level abstractions that are used directly within `std::io` and `std::os`. These "abstractions" are left largely the same as they were in `libnative` (except for the removal of `Arc` in file descriptors), but they are expected to evolve greatly over time. Organizationally, there are `sys/unix/` and `sys/windows/` directories which both implement the entire `sys` module hierarchy; this means that nearly all of the platform-specific code is isolated and you can get a handle on each platform in isolation.

* The `sys_common` module, which is rooted at `sys/common`, and provides a few pieces of private, low-level, but cross-platform functionality.

In the long term, the `sys` modules will provide hooks for exposing high-level platform-specific APIs as part of `libstd`. The first such API will be access to file descriptors from `std::io` abstractions, but a bit of design work remains before that step can be taken.

The `sys_common` module includes some traits (like `AsFileDesc`) which allow communication of private details between modules in disparate locations in the hierarchy; this helps overcome the relatively simple hierarchical privacy system in Rust.

To emphasize: the organization in `sys` is *very preliminary* and the main goal was to migrate away from `rtio` as quickly and simply as possible. The design will certainly evolve over time, and all of the details are currently private.

Along the way, this PR also entirely removes signal handling, since it was only supported on `librustuv` which was removed a while ago.

Because of the removal of APIs from `libnative` and `librustrt`, and the removal of signal handling, this is a:

[breaking-change]

Some of these APIs will return in public from from `std` over time.

r? @alexcrichton

9 years agoUpdate test to cover #18769
Brian Koropoff [Sun, 9 Nov 2014 05:51:02 +0000 (21:51 -0800)]
Update test to cover #18769

9 years agoFix upvars sometimes not being marked as used mutably
Brian Koropoff [Sun, 9 Nov 2014 05:49:29 +0000 (21:49 -0800)]
Fix upvars sometimes not being marked as used mutably

Drill down the loan path for McDeclared references as well since
it might lead to an upvar.  Closes #18769

9 years agoIgnore sepcomp-lib-lto on android due to linker weirdness
Aaron Turon [Sun, 9 Nov 2014 04:57:15 +0000 (20:57 -0800)]
Ignore sepcomp-lib-lto on android due to linker weirdness

9 years agoRemove somewhat bogus process-spawn-errno test (non-mac, non-windows only)
Aaron Turon [Sun, 9 Nov 2014 01:22:14 +0000 (17:22 -0800)]
Remove somewhat bogus process-spawn-errno test (non-mac, non-windows only)

9 years agoRuntime removal: fully remove rtio
Aaron Turon [Fri, 17 Oct 2014 20:39:27 +0000 (13:39 -0700)]
Runtime removal: fully remove rtio

This patch cleans up the remnants of the runtime IO interface.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRuntime removal: refactor tty
Aaron Turon [Fri, 17 Oct 2014 20:33:08 +0000 (13:33 -0700)]
Runtime removal: refactor tty

This patch continues runtime removal by moving the tty implementations
into `sys`.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRuntime removal: refactor timer
Aaron Turon [Fri, 17 Oct 2014 01:57:11 +0000 (18:57 -0700)]
Runtime removal: refactor timer

This patch continues runtime removal by moving out timer-related code
into `sys`.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRuntime removal: refactor process
Aaron Turon [Thu, 9 Oct 2014 23:27:28 +0000 (16:27 -0700)]
Runtime removal: refactor process

This patch continues the runtime removal by moving and refactoring the
process implementation into the new `sys` module.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRuntime removal: refactor helper threads
Aaron Turon [Wed, 15 Oct 2014 22:45:59 +0000 (15:45 -0700)]
Runtime removal: refactor helper threads

This patch continues the runtime removal by moving
libnative::io::helper_thread into sys::helper_signal and
sys_common::helper_thread

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRuntime removal: refactor pipes and networking
Aaron Turon [Fri, 10 Oct 2014 17:11:49 +0000 (10:11 -0700)]
Runtime removal: refactor pipes and networking

This patch continues the runtime removal by moving pipe and
networking-related code into `sys`.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRuntime removal: refactor fs
Aaron Turon [Wed, 1 Oct 2014 00:34:14 +0000 (17:34 -0700)]
Runtime removal: refactor fs

This moves the filesystem implementation from libnative into the new
`sys` modules, refactoring along the way and hooking into `std::io::fs`.

Because this eliminates APIs in `libnative` and `librustrt`, it is a:

[breaking-change]

This functionality is likely to be available publicly, in some form,
from `std` in the future.

9 years agoRemove signal handling.
Aaron Turon [Thu, 9 Oct 2014 23:40:05 +0000 (16:40 -0700)]
Remove signal handling.

Since signal handling was only implemented through librustuv, which is
now gone, there's no reason to even provide the API.

[breaking-change]

9 years agoRuntime removal: add private sys, sys_common modules
Aaron Turon [Wed, 1 Oct 2014 00:03:56 +0000 (17:03 -0700)]
Runtime removal: add private sys, sys_common modules

These modules will house the code that used to be part of the runtime system
in libnative. The `sys_common` module contains a few low-level but
cross-platform details. The `sys` module is set up using `#[cfg()]` to
include either a unix or windows implementation of a common API
surface. This API surface is *not* exported directly in `libstd`, but is
instead used to bulid `std::os` and `std::io`.

Ultimately, the low-level details in `sys` will be exposed in a
controlled way through a separate platform-specific surface, but that
setup is not part of this patch.

9 years agoauto merge of #18743 : nikomatsakis/rust/hrtb-refactor-2, r=pcwalton
bors [Sun, 9 Nov 2014 03:51:41 +0000 (03:51 +0000)]
auto merge of #18743 : nikomatsakis/rust/hrtb-refactor-2, r=pcwalton

Various miscellaneous changes pushing towards HRTB support:

1. Update parser and adjust ast to support `for<'a,'b>` syntax, both in closures and trait bounds. Warn on the old syntax (not error, for stage0).
2. Refactor TyTrait representation to include a TraitRef.
3. Purge `once_fns` feature gate and `once` keyword.

r? @pcwalton

This is a [breaking-change]:

- The `once_fns` feature is now officially deprecated. Rewrite using normal closures or unboxed closures.
- The new `for`-based syntax now issues warnings (but not yet errors):
  - `fn<'a>(T) -> U` becomes `for<'a> fn(T) -> U`
  - `<'a> |T| -> U` becomes `for<'a> |T| -> U`

9 years agoInclude some of the more popular Windows import libs into the bundle.
Vadim Chugunov [Sun, 9 Nov 2014 02:25:57 +0000 (18:25 -0800)]
Include some of the more popular Windows import libs into the bundle.

9 years agoMake Int inherit from Ord.
Josh Haberman [Sun, 9 Nov 2014 03:34:19 +0000 (22:34 -0500)]
Make Int inherit from Ord.

Previously Int inherited from PartialOrd (via Primitive)
but not Ord.  But integers have a total order, so
inheriting from Ord is appropriate. Fixes #18776.

9 years agoPrefer bundled linker.
Vadim Chugunov [Sun, 9 Nov 2014 02:26:28 +0000 (18:26 -0800)]
Prefer bundled linker.

9 years agoMove gcc back to rustlib\<triple>\bin
Vadim Chugunov [Sun, 9 Nov 2014 02:24:45 +0000 (18:24 -0800)]
Move gcc back to rustlib\<triple>\bin

9 years agoAs of 4.9.2, gcc started passing -fno-lto to collect2, or to ld if collect2 cannot...
Vadim Chugunov [Sun, 9 Nov 2014 02:32:15 +0000 (18:32 -0800)]
As of 4.9.2, gcc started passing -fno-lto to collect2, or to ld if collect2 cannot be found.  The latter is the case for our bundles, because we don't include collect2.  Unfortunately, ld does not understand this option and errors out.
On the bright side, -fno-use-linker-plugin still works to suppress gcc's LTO, so we can drop -fno-lto.

9 years agoauto merge of #18730 : bkoropoff/rust/issue-18652, r=eddyb
bors [Sat, 8 Nov 2014 23:56:39 +0000 (23:56 +0000)]
auto merge of #18730 : bkoropoff/rust/issue-18652, r=eddyb

`FnOnce` environments that fit within an `int` are passed to the closure by value.  For some reason there was an assert that this would only happen if there were 1 or 0 free variables, but it can also happen if there are multiple variables that happen to fit.

Closes #18652

9 years agoauto merge of #18475 : gamazeps/rust/toExtend, r=alexcrichton
bors [Sat, 8 Nov 2014 21:06:37 +0000 (21:06 +0000)]
auto merge of #18475 : gamazeps/rust/toExtend, r=alexcrichton

Ensured that Extend & FromIterator are implemented for the libcollection.

Removed the fact that FromIterator had to be implemented in order to implement Extend, as it did not make sense for LruCache (it needs to be given a size and there are no Default for LruCache).

Changed the name from Extend to Extendable.

Part of #18424

9 years agomk: Fix Windows cross-build prefix
klutzy [Sat, 8 Nov 2014 19:25:25 +0000 (04:25 +0900)]
mk: Fix Windows cross-build prefix

9 years agoAdd regression for #18767
Brian Koropoff [Sat, 8 Nov 2014 19:04:50 +0000 (11:04 -0800)]
Add regression for #18767

9 years agoAdd regression for #17068
Brian Koropoff [Sat, 8 Nov 2014 19:04:37 +0000 (11:04 -0800)]
Add regression for #17068

9 years agoFix handling of for loop patterns in regionck
Brian Koropoff [Sat, 8 Nov 2014 19:01:06 +0000 (11:01 -0800)]
Fix handling of for loop patterns in regionck

When establishing region links within a pattern, use the mem-cat
of the type the pattern matches against (that is, the result
of `iter.next()`) rather than that of the iterator type.

Closes #17068
Closes #18767

9 years agoauto merge of #18740 : jbcrail/rust/implement-enum-set-len, r=alexcrichton
bors [Sat, 8 Nov 2014 16:41:39 +0000 (16:41 +0000)]
auto merge of #18740 : jbcrail/rust/implement-enum-set-len, r=alexcrichton

This commit adds the missing EnumSet method mentioned by @Gankro.

cc #18424

9 years agoauto merge of #18735 : utkarshkukreti/rust/remove-unnecessary-to_string-from-vec...
bors [Sat, 8 Nov 2014 14:41:37 +0000 (14:41 +0000)]
auto merge of #18735 : utkarshkukreti/rust/remove-unnecessary-to_string-from-vec-docs, r=huonw

I don't think they're needed.

9 years agoImplements Extend for EnumSet and LruCache
gamazeps [Sat, 8 Nov 2014 00:40:20 +0000 (01:40 +0100)]
Implements Extend for EnumSet and LruCache

Part of #18424

9 years agoRenamed Extendable to Extend
gamazeps [Sat, 8 Nov 2014 00:39:39 +0000 (01:39 +0100)]
Renamed Extendable to Extend

In order to upgrade, simply rename the Extendable trait to Extend in
your code

Part of #18424

[breaking-change]

9 years agoauto merge of #18731 : chris-morgan/rust/derive-Clone-for-TypeId, r=alexcrichton
bors [Sat, 8 Nov 2014 12:46:37 +0000 (12:46 +0000)]
auto merge of #18731 : chris-morgan/rust/derive-Clone-for-TypeId, r=alexcrichton

9 years agoauto merge of #18634 : alexcrichton/rust/cfg-attr-crate-level, r=sfackler
bors [Sat, 8 Nov 2014 09:01:33 +0000 (09:01 +0000)]
auto merge of #18634 : alexcrichton/rust/cfg-attr-crate-level, r=sfackler

This commit implements processing these two attributes at the crate level as
well as at the item level. When #[cfg] is applied at the crate level, then the
entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute
is processed as usual in that the attribute is included or not depending on
whether the cfg matches.

This was spurred on by motivations of #18585 where #[cfg_attr] annotations will
be applied at the crate-level.

cc #18585

9 years agoauto merge of #18556 : seanmonstar/rust/tm-fmt, r=alexcrichton
bors [Sat, 8 Nov 2014 07:06:36 +0000 (07:06 +0000)]
auto merge of #18556 : seanmonstar/rust/tm-fmt, r=alexcrichton

The internals of strftime were converted to use a single formatter,
instead of creating and concatenating a bunch of small strings. This
showed ~3x improvement in the benches.

Also, since the formatted time may be going straight to a Writer, TmFmt
was introduced, and is returned from all formatting methods on Tm. This
allows the saving of another string allocation. Anyone wanting a String
can just call .to_string() on the returned value.

This runs validation prior to return the created `TmFmt`, catching errors before formatting happens. The specialized formats skip this validation, since we already know they are valid.

[breaking-change]

9 years agoReword &str coercion into viewing
mdinger [Sat, 8 Nov 2014 05:46:11 +0000 (00:46 -0500)]
Reword &str coercion into viewing

9 years agoauto merge of #18729 : bkoropoff/rust/issue-18711, r=cmr
bors [Sat, 8 Nov 2014 05:01:34 +0000 (05:01 +0000)]
auto merge of #18729 : bkoropoff/rust/issue-18711, r=cmr

Closes #18711

9 years agoauto merge of #18724 : gamazeps/rust/toc, r=alexcrichton
bors [Sat, 8 Nov 2014 02:26:37 +0000 (02:26 +0000)]
auto merge of #18724 : gamazeps/rust/toc, r=alexcrichton

Using @adrientetar advices

Closes #17505

9 years agolibtime: alter strftime to use a TmFmt
Sean McArthur [Wed, 3 Sep 2014 21:56:35 +0000 (14:56 -0700)]
libtime: alter strftime to use a TmFmt

The internals of strftime were converted to use a single formatter,
instead of creating and concatenating a bunch of small strings. This
showed ~3x improvement in the benches.

Also, since the formatted time may be going straight to a Writer, TmFmt
was introduced, and is returned from all formatting methods on Tm. This
allows the saving of another string allocation. Anyone wanting a String
can just call .to_string() on the returned value.

[breaking-change]

9 years agoUpdate Partial/Total Eq/Ord terminology
Jorge Aparicio [Sat, 8 Nov 2014 00:19:36 +0000 (19:19 -0500)]
Update Partial/Total Eq/Ord terminology

9 years agoAdd tests for BitAnd and BitXor.
Joseph Crail [Fri, 7 Nov 2014 23:46:29 +0000 (18:46 -0500)]
Add tests for BitAnd and BitXor.

9 years agoauto merge of #18723 : mprobinson/rust/fence-typos, r=thestinger
bors [Fri, 7 Nov 2014 23:31:38 +0000 (23:31 +0000)]
auto merge of #18723 : mprobinson/rust/fence-typos, r=thestinger

9 years agosyntax: Use UFCS in the expansion of `#[deriving(PartialOrd)]`
Jorge Aparicio [Fri, 7 Nov 2014 22:16:59 +0000 (17:16 -0500)]
syntax: Use UFCS in the expansion of `#[deriving(PartialOrd)]`

9 years agoAdd BitXor to EnumSet.
Joseph Crail [Fri, 7 Nov 2014 22:51:38 +0000 (17:51 -0500)]
Add BitXor to EnumSet.

9 years agoRename deprecated EnumSet methods in unit tests.
Joseph Crail [Fri, 7 Nov 2014 22:54:39 +0000 (17:54 -0500)]
Rename deprecated EnumSet methods in unit tests.

9 years agoImplement len() for EnumSet.
Joseph Crail [Fri, 7 Nov 2014 17:13:45 +0000 (12:13 -0500)]
Implement len() for EnumSet.

9 years agoFix tidy error
Niko Matsakis [Fri, 7 Nov 2014 20:58:19 +0000 (15:58 -0500)]
Fix tidy error

9 years agoPurge the old `once_fns`, which are not coming back
Niko Matsakis [Fri, 7 Nov 2014 20:48:55 +0000 (15:48 -0500)]
Purge the old `once_fns`, which are not coming back

9 years agoUpdate tests where we don't report errors twice anymore
Niko Matsakis [Fri, 7 Nov 2014 20:48:39 +0000 (15:48 -0500)]
Update tests where we don't report errors twice anymore

9 years agoUpdate parser with `for` syntax
Niko Matsakis [Fri, 7 Nov 2014 11:53:45 +0000 (06:53 -0500)]
Update parser with `for` syntax

9 years agoMake TyTrait embed a `TraitRef`, so that when we extend TraitRef, it naturally carrie...
Niko Matsakis [Fri, 7 Nov 2014 11:16:57 +0000 (06:16 -0500)]
Make TyTrait embed a `TraitRef`, so that when we extend TraitRef, it naturally carries over to object types.

I wanted to embed an `Rc<TraitRef>`, but I was foiled by the current
static rules, which prohibit non-Sync values from being stored in
static locations. This means that the constants for `ty_int` and so
forth cannot be initialized.

9 years agoauto merge of #18688 : bkoropoff/rust/unboxed-closure-subst-fixes, r=nikomatsakis
bors [Fri, 7 Nov 2014 20:41:29 +0000 (20:41 +0000)]
auto merge of #18688 : bkoropoff/rust/unboxed-closure-subst-fixes, r=nikomatsakis

This resolves some issues that remained after adding support for monomorphizing unboxed closures in trans.

There were a few places where a set of substitutions for an unboxed closure type were dropped on the floor and later recalculated from scratch based on the def ID, but this failed spectacularly when the closure originated from a different param environment.  The substitutions are now plumbed through end-to-end.  Closes #18661

There was also a conflict in the meaning of the self param space within the body of the unboxed closure.  Trans attempted to insert the unboxed closure type as the self type, but this could conflict with the self type from the param environment when an unboxed closure was used within a default method on a trait.  Since the body of an unboxed closure cannot refer to its own self type or value, there's no need for it to actually use the self space.  The downstream consumers of the substitutions in trans do not seem to need it either since they look up the type of the closure some other way, so I just stopped setting it.  Closes #18685.

r? @pcwalton @nikomatsakis

9 years agorustc: Process #[cfg]/#[cfg_attr] on crates
Alex Crichton [Tue, 4 Nov 2014 22:59:42 +0000 (14:59 -0800)]
rustc: Process #[cfg]/#[cfg_attr] on crates

This commit implements processing these two attributes at the crate level as
well as at the item level. When #[cfg] is applied at the crate level, then the
entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute
is processed as usual in that the attribute is included or not depending on
whether the cfg matches.

This was spurred on by motivations of #18585 where #[cfg_attr] annotations will
be applied at the crate-level.

cc #18585

9 years agoPrepend should be append in the 30 minute intro
Carol Nichols [Fri, 7 Nov 2014 19:59:42 +0000 (14:59 -0500)]
Prepend should be append in the 30 minute intro

The examples are about adding to the end of the array, not the
beginning.

9 years agoauto merge of #18673 : VHaravy/rust/issue-18632, r=alexcrichton
bors [Fri, 7 Nov 2014 18:46:25 +0000 (18:46 +0000)]
auto merge of #18673 : VHaravy/rust/issue-18632, r=alexcrichton

1. Introduce `putpathvar` function that prints variable shell-quoted by using `%q` format specifier. This function is used within `probe` to save the result into `config.tmp`.
2. Removes search-and-replace pattern that transforms `\` into `/` as it messes up shell-quoted strings.

9 years agoProperly static lib packaging
Valerii Hiora [Fri, 7 Nov 2014 17:12:43 +0000 (19:12 +0200)]
Properly static lib packaging

Fixes #18574

9 years agoauto merge of #17830 : pczarn/rust/interp_tt, r=pnkfelix
bors [Fri, 7 Nov 2014 15:26:26 +0000 (15:26 +0000)]
auto merge of #17830 : pczarn/rust/interp_tt, r=pnkfelix

Closes #14197

Removes the `matchers` nonterminal.

If you're using `$foo:matchers` in a macro, write `$foo:tt` instead.

[breaking-change]

9 years agoauto merge of #18721 : SimonSapin/rust/safer-enumset, r=alexcrichton
bors [Fri, 7 Nov 2014 13:31:25 +0000 (13:31 +0000)]
auto merge of #18721 : SimonSapin/rust/safer-enumset, r=alexcrichton

Assert at run time instead. Fixes #13756.

I’d rather have this be detected at compile-time, but I don’t know how to do that.

9 years agoDo not put double quotes around empty variables.
Vitali Haravy [Fri, 7 Nov 2014 13:17:11 +0000 (13:17 +0000)]
Do not put double quotes around empty variables.

9 years agoRemove unnecessary `.to_string()`s from `Vec.swap_remove`'s doc example.
Utkarsh Kukreti [Fri, 7 Nov 2014 12:04:32 +0000 (17:34 +0530)]
Remove unnecessary `.to_string()`s from `Vec.swap_remove`'s doc example.

9 years agoauto merge of #18714 : nikomatsakis/rust/issue-18621-deref-for-refs, r=aturon
bors [Fri, 7 Nov 2014 11:31:25 +0000 (11:31 +0000)]
auto merge of #18714 : nikomatsakis/rust/issue-18621-deref-for-refs, r=aturon

libs: add Deref, DerefMut impls for references, fixing a bug in compiler in the process that was blocking this.

r? @aturon

9 years agoauto merge of #18698 : japaric/rust/index, r=alexcrichton
bors [Fri, 7 Nov 2014 09:31:50 +0000 (09:31 +0000)]
auto merge of #18698 : japaric/rust/index, r=alexcrichton

Closes #16529

r? @aturon

9 years agoAdd `ast::SequenceRepetition`
Piotr Czarnecki [Sun, 2 Nov 2014 11:21:16 +0000 (12:21 +0100)]
Add `ast::SequenceRepetition`

9 years agoAdd and update tests
Piotr Czarnecki [Sun, 12 Oct 2014 11:42:41 +0000 (12:42 +0100)]
Add and update tests

9 years agoauto merge of #18672 : brandonson/rust/functional-update-walk, r=nikomatsakis
bors [Fri, 7 Nov 2014 07:16:33 +0000 (07:16 +0000)]
auto merge of #18672 : brandonson/rust/functional-update-walk, r=nikomatsakis

Fixes #18567. `Struct{x:foo, .. with_expr}` did not walk `with_expr`, which allowed
using moved variables in some cases.  The CFG for structs also built up with
`with_expr` happening before the fields, which is now reversed. (Fields are now
before the `with_expr` in the CFG)

9 years agoDerive Clone for TypeId.
Chris Morgan [Fri, 7 Nov 2014 06:12:44 +0000 (17:12 +1100)]
Derive Clone for TypeId.

9 years agoAdd regression test for #18652
Brian Koropoff [Fri, 7 Nov 2014 04:44:08 +0000 (20:44 -0800)]
Add regression test for #18652

9 years agoRemove incorrect assert in trans
Brian Koropoff [Fri, 7 Nov 2014 04:40:32 +0000 (20:40 -0800)]
Remove incorrect assert in trans

As an optimization, once unboxed closures receive their environment by
value if it fits within the size of an `int`.  An assert in this code
path assumed that this would only occur if the environment had no more
than a single free variable in it, but multiple smaller free variables
can easily be packed into the space of an `int`, particularly if any
of them are 0-sized.  The assert can simply be removed.

Closes #18652

9 years agoAdd regression test for #18711
Brian Koropoff [Fri, 7 Nov 2014 03:33:47 +0000 (19:33 -0800)]
Add regression test for #18711

9 years agoFix panic due to overly long borrow of RefCell
Brian Koropoff [Fri, 7 Nov 2014 03:31:56 +0000 (19:31 -0800)]
Fix panic due to overly long borrow of RefCell

Closes #18711

9 years agolibs: add Deref, DerefMut impls for references, fixing a bug in compiler in the proce...
Niko Matsakis [Thu, 6 Nov 2014 22:34:33 +0000 (17:34 -0500)]
libs: add Deref, DerefMut impls for references, fixing a bug in compiler in the process that was blocking this.

Fixes #18621.

9 years agoAdd regression test for #18685
Brian Koropoff [Thu, 6 Nov 2014 08:06:41 +0000 (00:06 -0800)]
Add regression test for #18685

9 years agoAdd regression test for #18661
Brian Koropoff [Thu, 6 Nov 2014 08:06:28 +0000 (00:06 -0800)]
Add regression test for #18661

9 years agoFix handling of unboxed closure type param substitutions
Brian Koropoff [Thu, 6 Nov 2014 07:50:10 +0000 (23:50 -0800)]
Fix handling of unboxed closure type param substitutions

- When selecting an implicit trait impl for an unboxed closure, plumb
  through and use the substitutions from impl selection instead of
  using those from the current param environment in trans, which may
  be incorrect.
- When generating a function declaration for an unboxed closure, plumb
  through the substitutions from the param environment of the closure
  as above.  Also normalize the type to avoid generating duplicate
  declarations due to regions being inconsistently replaced with
  ReStatic elsewhere.
- Do not place the closure type in the self param space when
  translating the unboxed closure callee, etc.  It is not actually
  used, and doing so conflicts with the self substitution from
  default trait methods.

Closes #18661
Closes #18685

9 years agoAdd example impl in CLike docs. Fix 13752.
Simon Sapin [Thu, 6 Nov 2014 23:34:09 +0000 (15:34 -0800)]
Add example impl in CLike docs. Fix 13752.