Commit Graph

29035 Commits

Author SHA1 Message Date
Alex Crichton
e0d43b023e core: Implement necessary traits for ~[T]/~str
Coherence requires that libcore's traits be implemented in libcore for ~[T] and
~str (due to them being language defined types). These implementations cannot
live in libcore forever, but for now, until Heap/Box/Uniq is a lang item, these
implementations must reside inside of libcore. While not perfect
implementations, these shouldn't reside in libcore for too long.

With some form of lang item these implementations can be in a proper crate
because the lang item will not be present in libcore.
2014-05-07 08:16:14 -07:00
Alex Crichton
c67ebf1ef3 std: Remove a glob to get std to compile 2014-05-07 08:16:14 -07:00
Alex Crichton
9bae6ec828 core: Inherit possible string functionality
This moves as much allocation as possible from teh std::str module into
core::str. This includes essentially all non-allocating functionality, mostly
iterators and slicing and such.

This primarily splits the Str trait into only having the as_slice() method,
adding a new StrAllocating trait to std::str which contains the relevant new
allocation methods. This is a breaking change if any of the methods of "trait
Str" were overriden. The old functionality can be restored by implementing both
the Str and StrAllocating traits.

[breaking-change]
2014-05-07 08:16:14 -07:00
Alex Crichton
544d909401 core: Inherit necessary unicode functionality
The unicode module remains private, but the normalization iterators require an
allocation, so some functionality needs to remain in libstd
2014-05-07 08:15:58 -07:00
Alex Crichton
91ede1f09a core: Inherit non-allocating slice functionality
This commit adds a new trait, MutableVectorAllocating, which represents
functions on vectors which can allocate.

This is another extension trait to slices which should be removed once a lang
item exists for the ~ allocation.
2014-05-07 08:15:58 -07:00
Alex Crichton
be0a11729e core: Inherit the specific numeric modules
This implements all traits inside of core::num for all the primitive types,
removing all the functionality from libstd. The std modules reexport all of the
necessary items from the core modules.
2014-05-07 08:15:58 -07:00
Alex Crichton
0c30293886 core: Inherit what's possible from the num module
This strips out all string-related functionality from the num module. The
inherited functionality is all that will be implemented in libcore (for now).
Primarily, libcore will not implement the Float trait or any string-related
functionality.

It may be possible to migrate string parsing functionality into libcore in the
future, but for now it will remain in libstd.

All functionality in core::num is reexported in std::num.
2014-05-07 08:15:58 -07:00
Alex Crichton
c5229e5d2e core: Inhert ~/@/& cmp traits, remove old modules
This commit removes the std::{managed, reference} modules. The modules serve
essentially no purpose, and the only free function removed was `managed::ptr_eq`
which can be achieved by comparing references.

[breaking-change]
2014-05-07 08:15:58 -07:00
Alex Crichton
5592a8f5db core: Inherit the cmp module
This removes the TotalOrd and TotalEq implementation macros, they will be added
later to the numeric modules (where the other comparison implementations live).
2014-05-07 08:15:19 -07:00
Alex Crichton
b024ba544c core: Inherit the iter module 2014-05-07 08:14:56 -07:00
Alex Crichton
06fcb6b1c8 core: Inherit the option module 2014-05-07 08:14:56 -07:00
Alex Crichton
6636215a44 core: Inherit the bool module 2014-05-07 08:14:56 -07:00
Alex Crichton
92095d125a core: Inherit the tuple module 2014-05-07 08:14:54 -07:00
Alex Crichton
1a989d6769 core: Bring clone tests up to date in style 2014-05-07 08:14:26 -07:00
Alex Crichton
54b81997f3 core: Inherit the clone module 2014-05-07 08:13:56 -07:00
Alex Crichton
e7eed5f670 core: Inherit the unit module 2014-05-07 08:13:56 -07:00
Alex Crichton
dfd967f239 core: Inherit the default module 2014-05-07 08:13:56 -07:00
Alex Crichton
17cb238ee8 core: Inherit the raw module 2014-05-07 08:13:56 -07:00
Alex Crichton
8ed728babb core: Inherit the any module 2014-05-07 08:13:56 -07:00
Alex Crichton
85a8e6b80a core: Inherit the finally module 2014-05-07 08:13:24 -07:00
Alex Crichton
7192452545 core: Inherit the char module 2014-05-07 08:13:24 -07:00
Alex Crichton
d9708539af core: Inherit the container module 2014-05-07 08:13:24 -07:00
Alex Crichton
2ad98fbb27 core: Inherit the ty module 2014-05-07 08:13:24 -07:00
Alex Crichton
ead6e16a60 core: Inherit the ops module 2014-05-07 08:13:06 -07:00
Alex Crichton
ec8a805b6d core: Inherit the kinds module 2014-05-07 08:13:06 -07:00
Alex Crichton
28624661c3 core: Inherit the cast module 2014-05-07 08:13:06 -07:00
Alex Crichton
645b157564 core: Inherit the ptr module 2014-05-07 08:13:06 -07:00
Alex Crichton
dca8a0d6e4 core: Inherit the mem module 2014-05-07 08:12:48 -07:00
Alex Crichton
5b75e44fb0 core: Inherit the intrinsics module 2014-05-07 08:12:48 -07:00
Alex Crichton
836d4b96a9 mk: Add libcore 2014-05-07 08:12:48 -07:00
bors
445988b478 auto merge of #13832 : alexcrichton/rust/cfail-full, r=brson
Compile-fail tests for syntax extensions belong in this suite which has correct
dependencies on all artifacts rather than just the target artifacts.

Closes #13818
2014-05-07 08:11:52 -07:00
Alex Crichton
678b1659f9 std: Implement the Buffer trait for some wrappers
This will allow methods like read_line() on RefReader, LimitReader, etc.
2014-05-07 08:11:19 -07:00
bors
f83cf6cf2a auto merge of #13967 : richo/rust/features/ICE-fails, r=alexcrichton
This change makes internal compile errors in the compile-fail tests failures.

I believe this is the correct behaviour- those tests are intended to assert that the compiler doesn't proceed, not that it explodes.

So far, it fails on 4 tests in my environment, my testcase for #13943 which is what caused me to tackle this, and 3 others:

```
failures:
    [compile-fail] compile-fail/incompatible-tuple.rs # This one is mine and not on master
    [compile-fail] compile-fail/inherit-struct8.rs
    [compile-fail] compile-fail/issue-9725.rs
    [compile-fail] compile-fail/unsupported-cast.rs
```
2014-05-07 06:46:54 -07:00
bors
ef6daf9935 auto merge of #13958 : pcwalton/rust/detilde, r=pcwalton
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

r? @brson or @alexcrichton or whoever
2014-05-07 05:16:48 -07:00
bors
4a5d39001b auto merge of #13914 : alexcrichton/rust/pile-o-rustdoc-fixes, r=brson
Lots of assorted things here and there, all the details are in the commits.

Closes #11712
2014-05-07 03:21:47 -07:00
bors
897b96a2e2 auto merge of #13836 : jbcrail/rust/add-bitv-doc, r=alexcrichton 2014-05-07 01:56:48 -07:00
Patrick Walton
090040bf40 librustc: Remove ~EXPR, ~TYPE, and ~PAT from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
2014-05-06 23:12:54 -07:00
Richo Healey
d31230819d Add testcase for #11493 2014-05-06 23:04:14 -07:00
bors
2dcbad5bc4 auto merge of #13754 : alexcrichton/rust/net-experimental, r=brson
The underlying I/O objects implement a good deal of various options here and
there for tuning network sockets and how they perform. Most of this is a relic
of "whatever libuv provides", but these options are genuinely useful.

It is unclear at this time whether these options should be well supported or
not, or whether they have correct names or not. For now, I believe it's better
to expose the functionality than to not, but all new methods are added with
an #[experimental] annotation.
2014-05-06 22:01:43 -07:00
Richo Healey
201cd9e3f9 Ignore tests broken by failing on ICE 2014-05-06 21:47:25 -07:00
Richo Healey
48b1a45cbc Fail on internal compiler errors in compile-fail 2014-05-06 21:47:21 -07:00
Alex Crichton
08237cad8d rustc: Enable writing "unsafe extern fn() {}"
Previously, the parser would not allow you to simultaneously implement a
function with a different abi as well as being unsafe at the same time. This
extends the parser to allow functions of the form:

    unsafe extern fn foo() {
        // ...
    }

The closure type grammar was also changed to reflect this reversal, types
previously written as "extern unsafe fn()" must now be written as
"unsafe extern fn()". The parser currently has a hack which allows the old
style, but this will go away once a snapshot has landed.

Closes #10025

[breaking-change]
2014-05-06 21:03:59 -07:00
Alan Williams
8543e1b6ce Add documentation for Windows compatibility layer and remove unneeded attributes 2014-05-06 20:39:06 -07:00
Joseph Crail
2fc3b3a48f Add documentation for Bitv. 2014-05-06 23:34:19 -04:00
bors
24f6f26e63 auto merge of #13892 : alexcrichton/rust/mixing-rlib-dylib-deps, r=brson
Currently, rustc requires that a linkage be a product of 100% rlibs or 100%
dylibs. This is to satisfy the requirement that each object appear at most once
in the final output products. This is a bit limiting, and the upcoming libcore
library cannot exist as a dylib, so these rules must change.

The goal of this commit is to enable *some* use cases for mixing rlibs and
dylibs, primarily libcore's use case. It is not targeted at allowing an
exhaustive number of linkage flavors.

There is a new dependency_format module in rustc which calculates what format
each upstream library should be linked as in each output type of the current
unit of compilation. The module itself contains many gory details about what's
going on here.

cc #10729
2014-05-06 19:46:44 -07:00
Alex Crichton
49efab8ac9 rustc: Fix enum variant privacy across crates
The code in resolve erroneously assumed that private enums weren't visited, so
the logic was adjusted to check to see if the enum definition itself was public.

Closes #11680
2014-05-06 16:45:21 -07:00
bors
b299231d12 auto merge of #13982 : alexcrichton/rust/more-logging, r=nikomatsakis
This was accidentally left out of the recent logging improvements.
2014-05-06 16:31:39 -07:00
Felix S. Klock II
a22413b46a Revise doc-comments for graphviz to avoid generating files from rustdoc runs.
Fix #13965.

There is a dance here between the `main` that actually runs versus the
`main` that is printed in the output documentation.  We don't run the
latter `main`, but we do at least compile (and thus type-check) it.
It is still the responsibility of the documenter to ensure that the
signatures of `fn render` are kept in sync across the blocks.
2014-05-07 00:52:27 +02:00
Alex Crichton
be71d809bd log: Use writeln!() instead of write!()
This was accidentally left out of the recent logging improvements.
2014-05-06 15:08:16 -07:00
bors
df621acf5f auto merge of #13960 : brandonw/rust/master, r=alexcrichton
Update the example to make the usage of `pub mod foo;` much more
apparent, as well as using an example where setting the visibility of
the module is actually necessary.
2014-05-06 15:06:52 -07:00