Commit Graph

34017 Commits

Author SHA1 Message Date
Aaron Turon
431dcdc840 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.
2014-11-08 20:40:39 -08:00
Aaron Turon
b8f1193bb1 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.
2014-11-08 20:40:39 -08:00
Aaron Turon
0f98e75b69 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.
2014-11-08 20:40:39 -08:00
Aaron Turon
3d195482a4 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.
2014-11-08 20:40:38 -08:00
Aaron Turon
d34b1b0ca9 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.
2014-11-08 20:40:38 -08:00
Aaron Turon
0c1e1ff1e3 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.
2014-11-08 20:40:38 -08:00
Aaron Turon
16470cf01b 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]
2014-11-08 20:40:38 -08:00
Aaron Turon
3a527f2b33 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.
2014-11-08 20:40:38 -08:00
bors
a2f303ad09 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`
2014-11-09 03:51:41 +00:00
Vadim Chugunov
cb2328f839 Include some of the more popular Windows import libs into the bundle. 2014-11-08 19:47:37 -08:00
Josh Haberman
a7533b8a6b 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.
2014-11-08 22:34:19 -05:00
Vadim Chugunov
ad777778d4 Prefer bundled linker. 2014-11-08 18:33:42 -08:00
Vadim Chugunov
5cd4862c69 Move gcc back to rustlib\<triple>\bin 2014-11-08 18:33:41 -08:00
Vadim Chugunov
3d9a346aa3 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.
2014-11-08 18:33:40 -08:00
bors
93c85eb8bd 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
2014-11-08 23:56:39 +00:00
bors
f0ca717c64 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
2014-11-08 21:06:37 +00:00
klutzy
1df6be1926 mk: Fix Windows cross-build prefix 2014-11-09 04:26:18 +09:00
Brian Koropoff
a553c2d3bc Add regression for #18767 2014-11-08 11:07:28 -08:00
Brian Koropoff
472e0cf8f3 Add regression for #17068 2014-11-08 11:07:28 -08:00
Brian Koropoff
fbc2e92caa 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
2014-11-08 11:07:28 -08:00
bors
b80edf1d12 auto merge of #18740 : jbcrail/rust/implement-enum-set-len, r=alexcrichton
This commit adds the missing EnumSet method mentioned by @Gankro.

cc #18424
2014-11-08 16:41:39 +00:00
bors
fa2983a1b7 auto merge of #18735 : utkarshkukreti/rust/remove-unnecessary-to_string-from-vec-docs, r=huonw
I don't think they're needed.
2014-11-08 14:41:37 +00:00
gamazeps
a11f16739f Implements Extend for EnumSet and LruCache
Part of #18424
2014-11-08 15:02:09 +01:00
gamazeps
16c8cd931c Renamed Extendable to Extend
In order to upgrade, simply rename the Extendable trait to Extend in
your code

Part of #18424

[breaking-change]
2014-11-08 15:02:09 +01:00
bors
34af03681f auto merge of #18731 : chris-morgan/rust/derive-Clone-for-TypeId, r=alexcrichton 2014-11-08 12:46:37 +00:00
bors
ebc625ad3e 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
2014-11-08 09:01:33 +00:00
bors
afd657e207 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]
2014-11-08 07:06:36 +00:00
mdinger
c39e9f3437 Reword &str coercion into viewing 2014-11-08 00:46:11 -05:00
bors
7bc3588faf auto merge of #18729 : bkoropoff/rust/issue-18711, r=cmr
Closes #18711
2014-11-08 05:01:34 +00:00
bors
c437fcf3e5 auto merge of #18724 : gamazeps/rust/toc, r=alexcrichton
Using @adrientetar advices

Closes #17505
2014-11-08 02:26:37 +00:00
Sean McArthur
7ddf8cb0e0 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]
2014-11-07 17:49:40 -08:00
Jorge Aparicio
54068eea42 Update Partial/Total Eq/Ord terminology 2014-11-07 19:19:36 -05:00
Joseph Crail
12db4de554 Add tests for BitAnd and BitXor. 2014-11-07 18:46:29 -05:00
bors
e81670856a auto merge of #18723 : mprobinson/rust/fence-typos, r=thestinger 2014-11-07 23:31:38 +00:00
Jorge Aparicio
3c442b92ae syntax: Use UFCS in the expansion of #[deriving(PartialOrd)] 2014-11-07 18:26:44 -05:00
Joseph Crail
01b599eb34 Add BitXor to EnumSet. 2014-11-07 18:00:14 -05:00
Joseph Crail
e15a3903e0 Rename deprecated EnumSet methods in unit tests. 2014-11-07 17:55:39 -05:00
Joseph Crail
a79d4be39c Implement len() for EnumSet. 2014-11-07 16:08:43 -05:00
Niko Matsakis
cf4e53eee7 Fix tidy error 2014-11-07 15:58:19 -05:00
Niko Matsakis
091dc6e98a Purge the old once_fns, which are not coming back 2014-11-07 15:51:30 -05:00
Niko Matsakis
3112771001 Update tests where we don't report errors twice anymore 2014-11-07 15:51:30 -05:00
Niko Matsakis
244231720d Update parser with for syntax 2014-11-07 15:51:30 -05:00
Niko Matsakis
c18a1327e3 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.
2014-11-07 15:51:30 -05:00
bors
6ee56c9a5f 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
2014-11-07 20:41:29 +00:00
Alex Crichton
3dbd32854f 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
2014-11-07 12:04:28 -08:00
Carol Nichols
fc47dd9c0f Prepend should be append in the 30 minute intro
The examples are about adding to the end of the array, not the
beginning.
2014-11-07 14:59:42 -05:00
bors
0a3cbf8cf4 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.
2014-11-07 18:46:25 +00:00
Valerii Hiora
a722f70207 Properly static lib packaging
Fixes #18574
2014-11-07 19:14:22 +02:00
bors
0b48001c28 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]
2014-11-07 15:26:26 +00:00
bors
223ca76439 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.
2014-11-07 13:31:25 +00:00