Commit Graph

28732 Commits

Author SHA1 Message Date
Patrick Walton
6559a3675e librustc: Remove all uses of ~str from librustc. 2014-05-12 11:28:57 -07:00
bors
e8053b9a7f auto merge of #13932 : MrAlert/rust/win-compat, r=brson
This addresses #12842 by offering fallback implementations for functions that aren't available.

In this case, as Windows XP simply doesn't support symbolic links at all, the fallbacks simply return an error code indicating that the function hasn't been implemented. This should allow programs written in Rust to run under XP while still offering full support for symbolic links under newer versions of Windows with the same binary, but due to LLVM using stderror_s(), which isn't available in msvcrt.dll in XP, rustc itself will not.

The fallback implementation is as follows:

Calling the function instead calls to a mutable function pointer. This in and of itself would not constitute a performance hit because DLL calls are implemented in a similar manner (see Import Address Table). The function pointer initially points to a thunk which tries to get the address of the associated function and write it back to the function pointer. If it fails to find the function, it instead writes the address to a fallback. As this operation is idempotent, reading and writing the pointer simply needs to be atomic. Subsequent calls to the function should be as fast as any other DLL call, as the pointer will then point directly to either the correct function or a fallback.
2014-05-12 09:12:04 -07:00
bors
edae0bdabf auto merge of #13922 : Rufflewind/rust/patch-1, r=pnkfelix
Since rust-top-item-beg-re hasn't been defined yet, using defvar instead of
setq is more appropriate here (and also silences compilation warnings).
2014-05-12 03:36:53 -07:00
bors
0550b79f73 auto merge of #14127 : thestinger/rust/snapshot, r=huonw 2014-05-12 00:31:52 -07:00
Daniel Micay
8b912bc56b register snapshots 2014-05-12 02:52:32 -04:00
bors
e031ba1028 auto merge of #14096 : nick29581/rust/driver, r=brson
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... functions easier to use by tools (which is a good thing :-) ).

This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
2014-05-11 21:31:48 -07:00
bors
72fc4a5eb7 auto merge of #14119 : thestinger/rust/heap, r=cmr 2014-05-11 17:51:41 -07:00
Daniel Micay
f1735cefcf make sure jemalloc valgrind support is enabled
This requires pointing it at the valgrind headers we carry in-tree.
2014-05-11 20:05:22 -04:00
bors
b40c3e9d3d auto merge of #14110 : SSheldon/rust/strbuf_mutable, r=alexcrichton
Despite implementing the Container trait, StrBuf did not implement the Mutable trait and had no clear method; this request implements the clear method of the Mutable trait for StrBuf.

Testing done: added a test and ran `make check` without any failures.
2014-05-11 16:21:44 -07:00
Daniel Micay
69b321c84b heap: replace exchange_free with deallocate
The `std::rt::heap` API is Rust's global allocator, so there's no need
to have this as a separate API.
2014-05-11 18:41:45 -04:00
bors
f483aa3a91 auto merge of #14102 : moonglum/rust/slice-clarification-in-readme, r=kballard
There are no arrays in Rust, they are slices. Especially in the tutorial beginners should not be confused with wrong terminology. It helps to know the right names for things when you want to find something in the documentation.

@erickt explained that today to me and it helped me a lot when getting started 😉 Maybe we should also explain what a slice and what a vector is in the tutorial. If you like that, I will try to do that and attach that to the pull request 😉
2014-05-11 14:51:46 -07:00
Daniel Micay
32988db2bd heap: add a way to print allocator statistics 2014-05-11 17:41:36 -04:00
Daniel Micay
f3de28a920 mark rust_malloc/rust_free as unsafe
Support for this was added by 08237cad8d.
2014-05-11 17:41:36 -04:00
Alex Crichton
034f218061 mk: Bundle jemalloc with make dist
The dist tarball doesn't depend on git, so all git submodules must be included
inside of it.
2014-05-11 17:41:36 -04:00
bors
20356e4cc3 auto merge of #14108 : thestinger/rust/jemalloc, r=huonw 2014-05-11 11:21:44 -07:00
Daniel Micay
420708f389 sync::deque: port to the new allocator API 2014-05-11 13:54:53 -04:00
Daniel Micay
7da24ea1a9 hashmap: port to the new allocator API 2014-05-11 13:30:19 -04:00
bors
c690bda159 auto merge of #14101 : alexcrichton/rust/issue-14095, r=kballard
When the values in html::item_type were updated, the JS definitions were
accidentally not updated as well.

Closes #14095
2014-05-11 09:51:43 -07:00
bors
032510bae2 auto merge of #14103 : alan-andrade/rust/manual-smallfix, r=alexcrichton
Hi,

I believe the word "managed" doesn't make sense here anymore. It's just a box.
2014-05-11 08:01:43 -07:00
bors
2877a4e989 auto merge of #14090 : TeXitoi/rust/shootout-nbody-improvement, r=alexcrichton
- minimize bound check
- factorise operations
- use x, y, z instead of [f64, ..3]
- ~1.15 faster
2014-05-11 04:41:43 -07:00
Steven Sheldon
a40b971aaf Implement Mutable trait for StrBuf. 2014-05-11 03:49:09 -07:00
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
moonglum
1895ad269c Clarification of Slice, Vector and Array
Especially in the tutorial beginners should not be confused with
wrong terminology. It helps to know the right names for things
when you want to find something in the documentation.
2014-05-10 18:02:02 -07:00
Alan Andrade
4e1f239721 remove the word managed from the trait explanation 2014-05-10 17:30:59 -07:00
Alex Crichton
30927f15b7 rustdoc: Fix search links to enums/typedefs
When the values in html::item_type were updated, the JS definitions were
accidentally not updated as well.

Closes #14095
2014-05-10 17:00:39 -07: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
Nick Cameron
37ca36783c Reorganise driver code.
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... fns easier to use by tools.

This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
2014-05-11 11:08:01 +12: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
Guillaume Pinot
db93ca28e2 shootout-nbody improvements
- minimize bound check
- factorise operations
- use x, y, z instead of [f64, ..3]
- ~1.15 faster
2014-05-10 20:32:31 +02: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