Commit Graph

28702 Commits

Author SHA1 Message Date
bors
fb569fd398 auto merge of #14069 : alexcrichton/rust/cast-module, r=brson
This commit revisits the `cast` module in libcore and libstd, and scrutinizes
all functions inside of it. The result was to remove the `cast` module entirely,
folding all functionality into the `mem` module. Specifically, this is the fate
of each function in the `cast` module.

* transmute - This function was moved to `mem`, but it is now marked as
              #[unstable]. This is due to planned changes to the `transmute`
              function and how it can be invoked (see the #[unstable] comment).
              For more information, see RFC 5 and #12898

* transmute_copy - This function was moved to `mem`, with clarification that is
                   is not an error to invoke it with T/U that are different
                   sizes, but rather that it is strongly discouraged. This
                   function is now #[stable]

* forget - This function was moved to `mem` and marked #[stable]

* bump_box_refcount - This function was removed due to the deprecation of
                      managed boxes as well as its questionable utility.

* transmute_mut - This function was previously deprecated, and removed as part
                  of this commit.

* transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                         can be achieved with an `as` in safe code, so it was
                         removed.

* transmute_lifetime - This function was removed because it is likely a strong
                       indication that code is incorrect in the first place.

* transmute_mut_lifetime - This function was removed for the same reasons as
                           `transmute_lifetime`

* copy_lifetime - This function was moved to `mem`, but it is marked
                  `#[unstable]` now due to the likelihood of being removed in
                  the future if it is found to not be very useful.

* copy_mut_lifetime - This function was also moved to `mem`, but had the same
                      treatment as `copy_lifetime`.

* copy_lifetime_vec - This function was removed because it is not used today,
                      and its existence is not necessary with DST
                      (copy_lifetime will suffice).

In summary, the cast module was stripped down to these functions, and then the
functions were moved to the `mem` module.

    transmute - #[unstable]
    transmute_copy - #[stable]
    forget - #[stable]
    copy_lifetime - #[unstable]
    copy_mut_lifetime - #[unstable]
2014-05-11 02:26:43 -07:00
Alex Crichton
f94d671bfa core: Remove the cast module
This commit revisits the `cast` module in libcore and libstd, and scrutinizes
all functions inside of it. The result was to remove the `cast` module entirely,
folding all functionality into the `mem` module. Specifically, this is the fate
of each function in the `cast` module.

* transmute - This function was moved to `mem`, but it is now marked as
              #[unstable]. This is due to planned changes to the `transmute`
              function and how it can be invoked (see the #[unstable] comment).
              For more information, see RFC 5 and #12898

* transmute_copy - This function was moved to `mem`, with clarification that is
                   is not an error to invoke it with T/U that are different
                   sizes, but rather that it is strongly discouraged. This
                   function is now #[stable]

* forget - This function was moved to `mem` and marked #[stable]

* bump_box_refcount - This function was removed due to the deprecation of
                      managed boxes as well as its questionable utility.

* transmute_mut - This function was previously deprecated, and removed as part
                  of this commit.

* transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                         can be achieved with an `as` in safe code, so it was
                         removed.

* transmute_lifetime - This function was removed because it is likely a strong
                       indication that code is incorrect in the first place.

* transmute_mut_lifetime - This function was removed for the same reasons as
                           `transmute_lifetime`

* copy_lifetime - This function was moved to `mem`, but it is marked
                  `#[unstable]` now due to the likelihood of being removed in
                  the future if it is found to not be very useful.

* copy_mut_lifetime - This function was also moved to `mem`, but had the same
                      treatment as `copy_lifetime`.

* copy_lifetime_vec - This function was removed because it is not used today,
                      and its existence is not necessary with DST
                      (copy_lifetime will suffice).

In summary, the cast module was stripped down to these functions, and then the
functions were moved to the `mem` module.

    transmute - #[unstable]
    transmute_copy - #[stable]
    forget - #[stable]
    copy_lifetime - #[unstable]
    copy_mut_lifetime - #[unstable]

[breaking-change]
2014-05-11 01:13:02 -07:00
bors
adb8b0b230 auto merge of #14006 : thestinger/rust/jemalloc, r=alexcrichton
Closes #11807
2014-05-10 23:21:44 -07:00
Daniel Micay
81fadbbc41 android workaround 2014-05-11 00:57:41 -04:00
Daniel Micay
e2479b8cac pass correct CFLAGS for jemalloc 2014-05-11 00:07:21 -04:00
Daniel Micay
121ad1cb7d rename global_heap -> libc_heap
This module only contains wrappers for malloc and realloc with
out-of-memory checks.
2014-05-10 19:58:18 -04:00
Daniel Micay
87b658cf72 gitattributes: rm obsolete jemalloc entry 2014-05-10 19:58:17 -04:00
Daniel Micay
7e84b221de vec: factor out some deallocation code 2014-05-10 19:58:17 -04:00
Daniel Micay
0621ccac62 vec: move some code inside alloc_or_realloc 2014-05-10 19:58:17 -04:00
Daniel Micay
f8e92cbbe3 fix Vec<ZeroSizeType> 2014-05-10 19:58:17 -04:00
Daniel Micay
138437956c initial port of the exchange allocator to jemalloc
In stage0, all allocations are 8-byte aligned. Passing a size and
alignment to free is not yet implemented everywhere (0 size and 8 align
are used as placeholders). Fixing this is part of #13994.

Closes #13616
2014-05-10 19:58:17 -04:00
Daniel Micay
aaf6e06b01 use jemalloc to implement Vec<T> 2014-05-10 19:58:17 -04:00
Daniel Micay
03a5eb4b52 add an align parameter to exchange_malloc
Closes #13094
2014-05-10 19:58:17 -04:00
Daniel Micay
1b1ca6d546 add back jemalloc to the tree
This adds a `std::rt::heap` module with a nice allocator API. It's a
step towards fixing #13094 and is a starting point for working on a
generic allocator trait.

The revision used for the jemalloc submodule is the stable 3.6.0 release.

Closes #11807
2014-05-10 19:58:17 -04:00
bors
11571cd9c1 auto merge of #14081 : Manishearth/rust/c-schar-reexport, r=huonw
Don't merge this until #14076 merges, since it is based on top of that branch to avoid merge conflicts.
2014-05-10 12:31:35 -07:00
bors
1001635dc1 auto merge of #14073 : alexcrichton/rust/snapshots, r=huonw 2014-05-10 09:56:34 -07:00
Manish Goregaokar
4cbd7754ea Reexport wchar_t, c_schar 2014-05-10 19:35:14 +05:30
bors
e850316408 auto merge of #14068 : alexcrichton/rust/rustdoc-xcrate-links, r=brson
This should improve the libcore experience quite a bit when looking at the
libstd documentation.
2014-05-10 03:36:30 -07:00
bors
061450dcf1 auto merge of #14066 : edwardw/rust/pod-to-copy, r=alexcrichton
Some error messages still use the word `Pod` instead of `Copy`. Renames
them.
2014-05-10 02:11:32 -07:00
bors
a7d877ce62 auto merge of #14056 : kballard/rust/vim_indent_fix, r=huonw
cindent handles the following case incorrectly:

    impl X {
        b: int,
        //
        c: int,
    }

if you try and insert a new line after the `c` declaration.

To fix this, fix the get_line_trimmed() function to work properly, and
then extend GetRustIndent to keep searching backwards until it finds a
non-blank line after trimming. This lets it handle the trailing comma
case properly, as if the comment were never there.

Fixes #14041.
2014-05-09 23:51:30 -07:00
Alex Crichton
3f5e3af838 Register new snapshots 2014-05-09 21:13:02 -07:00
bors
5b4774dafc auto merge of #14065 : alexcrichton/rust/ignore-flaky-windows-test, r=brson
See #14064 for some rationale, but the basic idea is that I suspect that there
is an LLVM codegen bug somewhere, and I'm not entirely sure why it's happening
intermittently rather than deterministically...

cc #14064
2014-05-09 20:31:31 -07:00
bors
fb8773463a auto merge of #14063 : TeXitoi/rust/shootout-meteor-improvement, r=pcwalton
- 5-10% of raw speedup
- parallelization of the search
2014-05-09 18:36:29 -07:00
bors
e3c62a20c3 auto merge of #14057 : kballard/rust/remove_no-bounds, r=sfackler
Printing <no-bounds> on trait objects comes from a time when trait
objects had a non-empty default bounds set. As they no longer have any
default bounds, printing <no-bounds> is just noise.
2014-05-09 16:41:47 -07:00
bors
3d6cf1d525 auto merge of #14055 : nikomatsakis/rust/issue-5527-use-substs-in-trans, r=pcwalton
Code to use `ty::substs` in trans. As part of this, uncovered (and fixed) issue #14050.

r? @pcwalton
2014-05-09 14:51:38 -07:00
Alex Crichton
620b4352f2 doc: Fix some broken links 2014-05-09 14:42:12 -07:00
Alex Crichton
1ba4971ab8 rustdoc: Hyperlink cross-crate reexports
This should improve the libcore experience quite a bit when looking at the
libstd documentation.
2014-05-09 14:42:12 -07:00
bors
66f4f558cb auto merge of #14054 : luqmana/rust/at, r=alexcrichton
`/data/local/tmp` seems to be more common.
2014-05-09 12:56:35 -07:00
bors
47ecc2e889 auto merge of #14046 : alexcrichton/rust/ignore-a-test-on-freebsd, r=kballard
This test runs successfully manually, but the bots are having trouble getting
this test to pass. Ignore it on freebsd for now.
2014-05-09 11:01:42 -07:00
Edward Wang
0f25aad746 Rename Pod to Copy
Some error messages still use the word `Pod` instead of `Copy`. Renames
them.
2014-05-10 02:01:29 +08:00
Alex Crichton
300109e5eb serialize: Ignore two flaky json tests on windows
See #14064 for some rationale, but the basic idea is that I suspect that there
is an LLVM codegen bug somewhere, and I'm not entirely sure why it's happening
intermittently rather than deterministically...

cc #14064
2014-05-09 09:49:30 -07:00
bors
58d540f0c6 auto merge of #14053 : FlaPer87/rust/master, r=huonw
This patch allows for using derivings for `kinds` in libcore

r? @alexcrichton
2014-05-09 09:11:35 -07:00
Guillaume Pinot
3fa293c10f shootout-meteor improvement
- 5-10% of raw speedup
- parallelization of the search
2014-05-09 17:39:00 +02:00
bors
176df98a19 auto merge of #14044 : hirschenberger/rust/lint_mut_match, r=alexcrichton
fixing #13866
2014-05-09 06:26:33 -07:00
bors
65205652b8 auto merge of #14043 : sanxiyn/rust/attr-reference, r=alexcrichton
Attribute grammar in reference manual allowed `#[foo, bar]`, which does not match parser behavior.

Also rename nonterminals to match parser code.

Fix #13825.
2014-05-09 04:36:33 -07:00
Niko Matsakis
ed7c849057 Currently trans uses Vec<ty::t> to represent substitutions instead of a proper
ty::substs struct. This is a holdover from the olden days of yore. This patch
removes the last vestiges of that practice. This is part of the work
I was doing on #5527.
2014-05-09 05:56:44 -04:00
Niko Matsakis
b6c9dbd3e4 Check lifetime parameters when we do check for supertrait impls. Fixes #14050. 2014-05-09 05:55:42 -04:00
Niko Matsakis
fa43727781 Rename resolve_regions to resolve_regions_and_report_errors 2014-05-09 05:55:42 -04:00
bors
52002154c7 auto merge of #14035 : alexcrichton/rust/experimental, r=huonw
This was intended as part of the I/O timeouts commit, but it was mistakenly
forgotten. The type of the timeout argument is not guaranteed to remain constant
into the future.
2014-05-09 02:41:36 -07:00
bors
ab369c4353 auto merge of #14025 : tbrooks8/rust/big_uint_doc, r=alexcrichton
I changed the documentation for the BigUint to reflection the deprecation of ~[T] in favor of Vec<T>.
2014-05-09 00:51:35 -07:00
bors
fcf25ae83d auto merge of #14019 : brson/rust/docs, r=alexcrichton
Just small bits of polish.
2014-05-08 23:01:40 -07:00
Kevin Ballard
33cc0efa3d Remove <no-bounds> on trait objects
Printing <no-bounds> on trait objects comes from a time when trait
objects had a non-empty default bounds set. As they no longer have any
default bounds, printing <no-bounds> is just noise.
2014-05-08 21:37:57 -07:00
bors
a990920c6f auto merge of #13963 : kballard/rust/remove_owned_vec_from_iterator, r=pcwalton
With `~[T]` no longer growable, the `FromIterator` impl for `~[T]` doesn't make
much sense. Not only that, but nearly everywhere it is used is to convert from
a `Vec<T>` into a `~[T]`, for the sake of maintaining existing APIs. This turns
out to be a performance loss, as it means every API that returns `~[T]`, even a
supposedly non-copying one, is in fact doing extra allocations and memcpy's.
Even `&[T].to_owned()` is going through `Vec<T>` first.

Remove the `FromIterator` impl for `~[T]`, and adjust all the APIs that relied
on it to start using `Vec<T>` instead. This includes rewriting
`&[T].to_owned()` to be more efficient, among other performance wins.

Also add a new mechanism to go from `Vec<T>` -> `~[T]`, just in case anyone
truly needs that, using the new trait `FromVec`.

[breaking-change]
2014-05-08 21:01:42 -07:00
bors
c0a25e4fdc auto merge of #14001 : alexcrichton/rust/issue-11680, r=pcwalton
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-08 19:12:05 -07:00
Kevin Ballard
0381ad4fdf vim: Fix an indentation issue with cindent
cindent handles the following case incorrectly:

impl X {
    b: int,
    //
    c: int,
}

if you try and insert a new line after the `c` declaration.

To fix this, fix the get_line_trimmed() function to work properly, and
then extend GetRustIndent to keep searching backwards until it finds a
non-blank line after trimming. This lets it handle the trailing comma
case properly, as if the comment were never there.

Fixes #14041.
2014-05-08 19:04:23 -07:00
bors
74172341aa auto merge of #14010 : richo/rust/tests/11493, r=alexcrichton
Is this what you had in mind?

Closes #11493
2014-05-08 17:16:43 -07:00
Luqman Aden
b55423a852 libstd: Check TMPDIR for android as well and if not set use '/data/local/tmp' instead of '/data/tmp'. 2014-05-08 19:53:04 -04:00
Flavio Percoco
d90b4daac9 core: Allow kinds derivings 2014-05-09 00:08:26 +02:00
bors
c4f0980d2e auto merge of #13990 : nikomatsakis/rust/issue-5527-cleanup-writeback, r=pcwalton
As part of #5527 I had to make some changes here and I just couldn't take it anymore. Refactor the writeback code. Should be functionally equivalent to the old stuff.

r? @pcwalton
2014-05-08 14:16:41 -07:00
Falco Hirschenberger
de92d42d4c Fix false lint warnings in match arms with multiple patterns
fixing #13866
2014-05-08 21:48:45 +02:00