Commit Graph

26407 Commits

Author SHA1 Message Date
bors
5a618129b8 auto merge of #11832 : jfager/rust/r5900, r=alexcrichton
I tried a couple of different ways to squash this, and still don't think this is ideal, but I wanted to get it out for feedback.

Closes #5900
Closes #9942

There are a few scenarios where the compiler tries to evaluate CastExprs without the corresponding types being available yet in the type context:  https://github.com/mozilla/rust/issues/10618, https://github.com/mozilla/rust/issues/5900, https://github.com/mozilla/rust/issues/9942

This PR takes the approach of having eval_const_expr_partial's CastExpr arm fall back to a limited ast_ty_to_ty call that only checks for (a subset of) valid const types, when the direct type lookup fails.  It's kind of hacky, so I understand if you don't want to take this as is.  I'd need a little mentoring to get this into better shape, as figuring out the proper fix has been a little daunting. I'm also happy if someone else wants to pick this up and run with it.

This closes 5900 and 9942, but only moves the goalposts a little on 10618, which now falls over in a later phase of the compiler.
2014-01-31 13:06:39 -08:00
bors
f47879637f auto merge of #11955 : alexcrichton/rust/fix-unwinding-on-mac-64, r=cmr
I believe that this is leading to lots of failures on the bots.

cc #11954
2014-01-31 11:21:33 -08:00
Alex Crichton
e8e0cdd73f Disable fp elim on mac64
I believe that this is leading to lots of failures on the bots.

cc #11954
2014-01-31 10:23:25 -08:00
bors
237885cc53 auto merge of #11917 : thestinger/rust/intrinsic, r=alexcrichton 2014-01-31 10:01:48 -08:00
bors
bec01ad17c auto merge of #11933 : kini/rust/patch-1, r=alexcrichton
Text refers to "the type shown earlier", when the type in
question was not in fact shown earlier.  I assume this is
an artifact of an earlier revision.
2014-01-31 08:46:34 -08:00
bors
535e806841 auto merge of #11929 : FlaPer87/rust/issue-11681, r=huonw
closes #11681
2014-01-31 05:36:31 -08:00
Ben Noordhuis
431edacbef Use __pthread_get_minstack() when available.
glibc >= 2.15 has a __pthread_get_minstack() function that returns
PTHREAD_STACK_MIN plus however many bytes are needed for thread-local
storage.  Use it when it's available because just PTHREAD_STACK_MIN is
not enough in applications that have big thread-local storage
requirements.

Fixes #6233.
2014-01-31 13:47:25 +01:00
Ben Noordhuis
b02b5cdcf4 Retry on EINVAL from pthread_attr_setstacksize()
Enforce that the stack size is > RED_ZONE + PTHREAD_STACK_MIN.  If the
call to pthread_attr_setstacksize() subsequently fails with EINVAL, it
means that the platform requires the stack size to be a multiple of the
page size.  In that case, round up to the nearest page and retry.

Fixes #11694.
2014-01-31 13:47:25 +01:00
Ben Noordhuis
464b2e2364 Add libc::consts::os::posix01::PTHREAD_STACK_MIN
Represents the minimum size of a thread's stack.  As such, it's both
platform and architecture-specific.

I put it under posix01 even though it predates POSIX.1-2001 by some
years.  I believe it was first formalized in SUSv2.  I doubt anyone
cares, though.
2014-01-31 13:47:25 +01:00
bors
0a0f87b7b8 auto merge of #11918 : omasanori/rust/reduce-warnings, r=alexcrichton
Moving forward to green waterfall.
2014-01-31 04:21:29 -08:00
David Manescu
bc8983a3fa Handle attributes on cross-crate tuple-structs correctly
Fixes #11741
2014-01-31 22:16:39 +11:00
bors
f910a977db auto merge of #11947 : alexcrichton/rust/osx-unwind, r=brson
On OSX 32-bit, the private fields are 5 words long, not 2. I found this
segfaulting before this change, and after this change it no longer segfaulted.
2014-01-30 23:51:28 -08:00
Alex Crichton
51b90004d9 Fix the size of the _Unwind_Exception struct
On OSX 32-bit, the private fields are 5 words long, not 2. I found this
segfaulting before this change, and after this change it no longer segfaulted.
2014-01-30 21:20:43 -08:00
bors
b7f673a627 auto merge of #11784 : eminence/rust/fix_run_tests, r=alexcrichton
This test is designed to ensure that running a non-existent executable
results in a correct error message (FileNotFound in this case of this
test).  However, if you try to run an executable that doesn't exist, and
that requires searching through the $PATH, and one of the $PATH components
is not readable, then a PermissionDenied error will be returned, instead
of FileNotFound.

Using an absolute path skips the $PATH search logic in exec, thus by-passing the logic in exec that would have returned a PermissionDenied

In the specific case of my machine, /usr/bin/games was part of $PATH, but my user account wasn't in the games group (thus being unable to read /usr/bin/games)

See the man pages for execv and execve for more details.

I've tested this on Linux and OSX, and I am fairly certain that there will be no problems on Windows
2014-01-30 18:11:30 -08:00
bors
7ac516a13b auto merge of #11759 : nathanielherman/rust/master, r=alexcrichton
For #5172
2014-01-30 15:46:28 -08:00
Nathaniel Herman
d9fadbc04f Make mut_last return Option instead of failing on empty vector (and add a test for mut_last) 2014-01-30 18:41:57 -05:00
Nathaniel Herman
339603426e Make pop_ref and mut_pop_ref return Option instead of failing on empty vectors 2014-01-30 18:41:43 -05:00
Nathaniel Herman
d451c15057 Make shift_ref and mut_shift_ref return Option instead of failing 2014-01-30 18:41:20 -05:00
Nathaniel Herman
89278f773d Make size_of, align_of, and element_offset functions return u64 instead of uint in trans::machine (per #5172) 2014-01-30 17:20:35 -05:00
bors
b3003e1e1a auto merge of #11895 : xales/rust/libstd, r=alexcrichton
Fixes #11814
2014-01-30 13:36:41 -08:00
bors
3427137f66 auto merge of #11217 : eddyb/rust/generic-default-type-params, r=cmr 2014-01-30 10:41:47 -08:00
Eduard Burtescu
7d967741c3 Implement default type parameters in generics. 2014-01-30 19:28:41 +02:00
bors
30e9bbaa2c auto merge of #11914 : FlaPer87/rust/issue-6157, r=alexcrichton
closes #6157
2014-01-30 07:06:27 -08:00
Keshav Kini
6a941ec602 Fix inconsistency in tutorial.md
Text refers to "the type shown earlier", when the type in
question was not in fact shown earlier.  I assume this is
an artifact of an earlier revision.
2014-01-30 08:36:49 -06:00
bors
e3dc5f5bcd auto merge of #11911 : kballard/rust/empty-functional-update, r=pcwalton
Fixes #8972
2014-01-30 05:06:30 -08:00
bors
a6764c28e6 auto merge of #11909 : thestinger/rust/tydesc, r=pcwalton 2014-01-30 03:36:25 -08:00
Flavio Percoco
0d0205a577 Add test case for issue #11681 2014-01-30 12:17:58 +01:00
bors
6b305f34fb auto merge of #11907 : sanxiyn/rust/simd-shift, r=thestinger
For the purpose of deciding whether to truncate or extend the right hand side of bit shifts, use the size of the element type for SIMD vector types.

Fix #11900.
2014-01-30 01:56:23 -08:00
bors
e3b1f3c443 auto merge of #11853 : alexcrichton/rust/up-llvm, r=brson
This upgrade brings commit by @eddyb to help optimizations of virtual calls in
a few places (https://github.com/llvm-mirror/llvm/commit/6d2bd95) as well as a
commit by @c-a to *greatly* improve the runtime of the optimization passes
(https://github.com/rust-lang/llvm/pull/3).

Nice work to these guys!
2014-01-29 23:46:26 -08:00
Alex Crichton
8cd935f52a Upgrade LLVM
This upgrade brings commit by @eddyb to help optimizations of virtual calls in
a few places (https://github.com/llvm-mirror/llvm/commit/6d2bd95) as well as a
commit by @c-a to *greatly* improve the runtime of the optimization passes
(https://github.com/rust-lang/llvm/pull/3).

Nice work to these guys!
2014-01-29 23:43:39 -08:00
bors
056363ff36 auto merge of #11839 : typelist/rust/issue3008, r=huonw
It was possible to trigger a stack overflow in rustc because the routine used to verify enum representability,
type_structurally_contains, would recurse on inner types until hitting the original type. The overflow condition was when a different structurally recursive type (enum or struct) was contained in the type being checked.

I suspect my solution isn't as efficient as it could be. I pondered adding a cache of previously-seen types to avoid duplicating work (if enums A and B both contain type C, my code goes through C twice), but I didn't want to do anything that may not be necessary.

I'm a new contributor, so please pay particular attention to any unidiomatic code, misuse of terminology, bad naming of tests, or similar horribleness :)

Updated to verify struct representability as well.

Fixes #3008.
Fixes #3779.
2014-01-29 22:21:29 -08:00
Johannes Muenzel
8d097b3bfb Consider types that contain fixed-length-zero vectors of themselves as non-representable until #11924 is resolved 2014-01-30 00:31:12 -05:00
bors
3cb72a3655 auto merge of #11672 : bjz/rust/remove-times, r=brson
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal (which I liked) was then lost after `do` was disabled for closures. It's time to let this one go.
2014-01-29 20:06:36 -08:00
Brendan Zabarauskas
729060dbb9 Remove Times trait
`Times::times` was always a second-class loop because it did not support the `break` and `continue` operations. Its playful appeal was then lost after `do` was disabled for closures. It's time to let this one go.
2014-01-30 14:52:25 +11:00
Johannes Muenzel
b46c0daa7b Add compile-fail tests for non-representable structs and enums 2014-01-29 20:33:51 -05:00
Johannes Muenzel
7a931574e3 Check enum and struct representability properly (issues #3008 and #3779) 2014-01-29 20:33:51 -05:00
xales
f17d972014 Remove seldom-used std::reference functions. 2014-01-29 20:31:03 -05:00
xales
d547f7ac21 Remove double-use of logging. 2014-01-29 20:31:03 -05:00
xales
d7f97e3018 Rename std::borrow to std::reference.
Fixes #11814
2014-01-29 20:31:03 -05:00
bors
704f93ff5e auto merge of #11893 : Armavica/rust/copyable-cloneable, r=huonw
I found awkward to have `MutableCloneableVector` and `CloneableIterator` on the one hand, and `CopyableVector` etc. on the other hand.

The concerned traits are:
* `CopyableVector` --> `CloneableVector`
* `OwnedCopyableVector` --> `OwnedCloneableVector`
* `ImmutableCopyableVector` --> `ImmutableCloneableVector`
* `CopyableTuple` --> `CloneableTuple`
2014-01-29 17:01:39 -08:00
Daniel Micay
e532e8d55d remove a layer of indirection from most intrinsics 2014-01-29 18:48:34 -05:00
OGINO Masanori
5281d874ef Append ; to #[allow(dead_code)].
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-30 08:42:50 +09:00
OGINO Masanori
d3270c215f Prefix _ to unused variables.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-30 08:42:50 +09:00
OGINO Masanori
96f0e9c74f Remove unused imports.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-30 08:42:50 +09:00
bors
f84b7291e7 auto merge of #11776 : FlaPer87/rust/issue-11681-static-lifetime, r=nikomatsakis
Closes #11681
Closes #11854
2014-01-29 15:01:43 -08:00
Flavio Percoco
dbd8f2605a Add test for issue 6157 2014-01-29 23:39:09 +01:00
Flavio Percoco
cb5d7236f1 Fixes temporary lifetime computation for static items
closes: #11854
2014-01-29 22:39:33 +01:00
bors
1e23c5c051 auto merge of #11879 : thestinger/rust/frame-pointer, r=alexcrichton
This is still used for Rust code (`Options.NoFramePointerElim = true`).
2014-01-29 13:36:40 -08:00
Daniel Micay
cb263e875e enable fp-elim when debug info is disabled
This can almost be fully disabled, as it no longer breaks retrieving a
backtrace on OS X as verified by @alexcrichton. However, it still
breaks retrieving the values of parameters. This should be fixable in
the future via a proper location list...

Closes #7477
2014-01-29 16:35:05 -05:00
Daniel Micay
383e3fd13b use a more efficient vtable representation
[TyDesc, ... methods] -> [destructor, ... methods]
2014-01-29 16:31:46 -05:00