]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #27823 - eefriedman:float-dep-core, r=alexcrichton
bors [Tue, 18 Aug 2015 04:23:25 +0000 (04:23 +0000)]
Auto merge of #27823 - eefriedman:float-dep-core, r=alexcrichton

There wasn't any particular reason the functions needed to be there
anyway, so just get rid of them, and adjust libstd to compensate.

With this change, libcore depends on exactly two floating-point functions:
fmod and fmodf.  They are implicitly referenced because they are used to
implement "%".

Dependencies of libcore on Linux x86-x64 with this patch:
```
0000000000000000         *UND* 0000000000000000 __powidf2
0000000000000000         *UND* 0000000000000000 __powisf2
0000000000000000         *UND* 0000000000000000 fmod
0000000000000000         *UND* 0000000000000000 fmodf
0000000000000000         *UND* 0000000000000000 memcmp
0000000000000000         *UND* 0000000000000000 memcpy
0000000000000000         *UND* 0000000000000000 memset
0000000000000000         *UND* 0000000000000000 rust_begin_unwind
0000000000000000         *UND* 0000000000000000 rust_eh_personality
```

8 years agoAuto merge of #27474 - bluss:twoway-reverse, r=brson
bors [Tue, 18 Aug 2015 02:02:57 +0000 (02:02 +0000)]
Auto merge of #27474 - bluss:twoway-reverse, r=brson

StrSearcher: Implement the complete reverse case for the two way algorithm

Fix quadratic behavior in StrSearcher in reverse search with periodic
needles.

This commit adds the missing pieces for the "short period" case in
reverse search. The short case will show up when the needle is literally
periodic, for example "abababab".

Two way uses a "critical factorization" of the needle: x = u v.

Searching matches v first, if mismatch at character k, skip k forward.
Matching u, if mismatch, skip period(x) forward.

To avoid O(mn) behavior after mismatch in u, memorize the already
matched prefix.

The short period case requires that |u| < period(x).

For the reverse search we need to compute a different critical
factorization x = u' v' where |v'| < period(x), because we are searching
for the reversed needle. A short v' also benefits the algorithm in
general.

The reverse critical factorization is computed quickly by using the same
maximal suffix algorithm, but terminating as soon as we have a location
with local period equal to period(x).

This adds extra fields crit_pos_back and memory_back for the reverse
case. The new overhead for TwoWaySearcher::new is low, and additionally
I think the "short period" case is uncommon in many applications of
string search.

The maximal_suffix methods were updated in documentation and the
algorithms updated to not use !0 and wrapping add, variable left is now
1 larger, offset 1 smaller.

Use periodicity when computing byteset: in the periodic case, just
iterate over one period instead of the whole needle.

Example before (rfind) after (twoway_rfind) benchmark shows the removal
of quadratic behavior.

needle: "ab" * 100, haystack: ("bb" + "ab" * 100) * 100

```
test periodic::rfind           ... bench:   1,926,595 ns/iter (+/- 11,390) = 10 MB/s
test periodic::twoway_rfind    ... bench:      51,740 ns/iter (+/- 66) = 386 MB/s
```

8 years agoAuto merge of #27169 - huonw:simd, r=alexcrichton
bors [Mon, 17 Aug 2015 23:41:36 +0000 (23:41 +0000)]
Auto merge of #27169 - huonw:simd, r=alexcrichton

This implements https://github.com/rust-lang/rfcs/pull/1199 (except for doing all the platform intrinsics).

Things remaining for SIMD (not necessarily in this PR):

- [x] I (@huonw) am signed up to ensure the compiler matches the RFC, when it lands
- [x] the platform specific intrinsics aren't properly type checked at the moment (LLVM will throw a "random" assertion)
- [ ] there's a lot of useful intrinsics that are missing, including whole platforms (mips, powerpc)
- [ ] the target-feature `cfg` detection/adding is not so great at the moment
- [x] I think the platform specific intrinsics should go in their own `extern` ABI (i.e. not `"rust-intrinsic"`)

(I'm adjusting the RFC to reflect the latter.)

I think it would be very nice for this to land without requiring the RFC to land first, because of the first point, and because this is the only way for any further work to happen/be experimented with, without requiring people to build/install/multirust a compiler from a custom branch.

r? @alexcrichton

8 years agoAdd AArch64 vrecpeq_... intrinsic (necessary for minimal API).
Huon Wilson [Sat, 15 Aug 2015 04:25:52 +0000 (21:25 -0700)]
Add AArch64 vrecpeq_... intrinsic (necessary for minimal API).

8 years agoClean up simd_cast translation.
Huon Wilson [Fri, 14 Aug 2015 22:46:51 +0000 (15:46 -0700)]
Clean up simd_cast translation.

8 years agoRevamp SIMD intrinsic trans error handling.
Huon Wilson [Fri, 14 Aug 2015 22:20:22 +0000 (15:20 -0700)]
Revamp SIMD intrinsic trans error handling.

Factor out common pieces, follow `expected ..., found ...` convention
everywhere.

8 years agosimd_shuffleNNN returns its type parameter directly.
Huon Wilson [Fri, 14 Aug 2015 20:45:42 +0000 (13:45 -0700)]
simd_shuffleNNN returns its type parameter directly.

I.e. the signature now must be

    fn simd_shuffleNNN<T, U>(x: T, y: T, idx: [u32; NNN]) -> U;

(modulo names.)

8 years agoShim some of the old std::simd functionality.
Huon Wilson [Fri, 14 Aug 2015 19:06:10 +0000 (12:06 -0700)]
Shim some of the old std::simd functionality.

Overload the operators using the traits so that things mostly keep
working during the deprecation period.

8 years agoRebase cleanup: is_simd lost its parameter.
Huon Wilson [Fri, 14 Aug 2015 04:34:20 +0000 (21:34 -0700)]
Rebase cleanup: is_simd lost its parameter.

8 years agoCode style tweaks.
Huon Wilson [Thu, 13 Aug 2015 23:00:44 +0000 (16:00 -0700)]
Code style tweaks.

8 years agoAdd tests for various intrinsic behaviours.
Huon Wilson [Thu, 13 Aug 2015 04:12:36 +0000 (21:12 -0700)]
Add tests for various intrinsic behaviours.

8 years agoTweak intrinsic error handling.
Huon Wilson [Thu, 13 Aug 2015 04:11:50 +0000 (21:11 -0700)]
Tweak intrinsic error handling.

Better error messages, US spelling, more real checks.

8 years agoFix existing tests for new `#[repr(simd)]`.
Huon Wilson [Wed, 12 Aug 2015 23:09:02 +0000 (16:09 -0700)]
Fix existing tests for new `#[repr(simd)]`.

8 years agoAllow generic repr(simd) types.
Huon Wilson [Wed, 12 Aug 2015 22:37:21 +0000 (15:37 -0700)]
Allow generic repr(simd) types.

Absolute correctness is checked at monomorphisation time.

8 years agoSwitch shuffle intrinsics to arrays of indices.
Huon Wilson [Wed, 12 Aug 2015 18:25:37 +0000 (11:25 -0700)]
Switch shuffle intrinsics to arrays of indices.

Format:

    fn shuffle_simdNNN<T, U>(x: T, y: T, idx: [u32; NNN]) -> U;

8 years agoAdd most ARM intrinsics.
Huon Wilson [Wed, 12 Aug 2015 00:44:18 +0000 (17:44 -0700)]
Add most ARM intrinsics.

8 years agoReorganise ARM intrinsic definitions.
Huon Wilson [Tue, 11 Aug 2015 16:55:16 +0000 (09:55 -0700)]
Reorganise ARM intrinsic definitions.

8 years agoAdd most AVX2 intrinsics.
Huon Wilson [Tue, 11 Aug 2015 01:30:33 +0000 (18:30 -0700)]
Add most AVX2 intrinsics.

8 years agoAdd most AVX intrinsics.
Huon Wilson [Tue, 11 Aug 2015 01:09:07 +0000 (18:09 -0700)]
Add most AVX intrinsics.

8 years agoRearrange x86 intrinsics to prepare for AVX.
Huon Wilson [Tue, 11 Aug 2015 00:50:31 +0000 (17:50 -0700)]
Rearrange x86 intrinsics to prepare for AVX.

8 years agoAdd most SSE4.1 intrinsics.
Huon Wilson [Tue, 11 Aug 2015 00:46:02 +0000 (17:46 -0700)]
Add most SSE4.1 intrinsics.

8 years agoAdd most SSSE3 intrinsics.
Huon Wilson [Tue, 11 Aug 2015 00:33:06 +0000 (17:33 -0700)]
Add most SSSE3 intrinsics.

8 years agoAdd most SSE3 intrinsics.
Huon Wilson [Tue, 11 Aug 2015 00:24:15 +0000 (17:24 -0700)]
Add most SSE3 intrinsics.

8 years agoReorganise x86 intrinsic definitions.
Huon Wilson [Tue, 11 Aug 2015 00:20:32 +0000 (17:20 -0700)]
Reorganise x86 intrinsic definitions.

- factor out redundant mm prefix
- group methods by instruction set

8 years agoAdd most SSE2 intrinsics.
Huon Wilson [Tue, 11 Aug 2015 00:15:34 +0000 (17:15 -0700)]
Add most SSE2 intrinsics.

8 years agoGeneralise SIMD casting to unequal bitwidths.
Huon Wilson [Mon, 10 Aug 2015 23:34:25 +0000 (16:34 -0700)]
Generalise SIMD casting to unequal bitwidths.

8 years agoAdd _mm_shuffle_epi8 intrinsic.
Huon Wilson [Mon, 10 Aug 2015 23:32:30 +0000 (16:32 -0700)]
Add _mm_shuffle_epi8 intrinsic.

8 years agoRename `simd_basics` feature gate to `repr_simd`.
Huon Wilson [Thu, 6 Aug 2015 23:03:41 +0000 (16:03 -0700)]
Rename `simd_basics` feature gate to `repr_simd`.

8 years agoUse error codes for platform-intrinsic typeck errors.
Huon Wilson [Thu, 6 Aug 2015 21:52:40 +0000 (14:52 -0700)]
Use error codes for platform-intrinsic typeck errors.

8 years agoCreate separate module for intrinsic typechecking.
Huon Wilson [Thu, 6 Aug 2015 18:29:26 +0000 (11:29 -0700)]
Create separate module for intrinsic typechecking.

8 years agoCreate "platform-intrinsic" ABI for SIMD/platform intrinsics.
Huon Wilson [Thu, 6 Aug 2015 18:11:26 +0000 (11:11 -0700)]
Create "platform-intrinsic" ABI for SIMD/platform intrinsics.

This is purposely separate to the "rust-intrinsic" ABI, because these
intrinsics are theoretically going to become stable, and should be fine
to be independent of the compiler/language internals since they're
intimately to the platform.

8 years agoType check platform-intrinsics in typeck.
Huon Wilson [Wed, 5 Aug 2015 16:08:03 +0000 (09:08 -0700)]
Type check platform-intrinsics in typeck.

8 years agoRemove automatic built-in SIMD operators.
Huon Wilson [Tue, 4 Aug 2015 00:24:12 +0000 (17:24 -0700)]
Remove automatic built-in SIMD operators.

These should now go via the intrinsics, and implement the standard traits.

8 years agoAdd intrinsics for SIMD arithmetic.
Huon Wilson [Fri, 31 Jul 2015 18:23:12 +0000 (11:23 -0700)]
Add intrinsics for SIMD arithmetic.

8 years agoAdd simd_cast intrinsic.
Huon Wilson [Wed, 29 Jul 2015 23:40:22 +0000 (16:40 -0700)]
Add simd_cast intrinsic.

8 years agoAdd x86 & arm reciprocal approximation intrinsics.
Huon Wilson [Wed, 29 Jul 2015 23:39:21 +0000 (16:39 -0700)]
Add x86 & arm reciprocal approximation intrinsics.

8 years agoImplement the simd_insert/simd_extract intrinsics.
Huon Wilson [Mon, 20 Jul 2015 18:55:47 +0000 (11:55 -0700)]
Implement the simd_insert/simd_extract intrinsics.

8 years agoAdd rustc_platform_intrinsics & some arm/x86 intrs.
Huon Wilson [Thu, 16 Jul 2015 23:46:36 +0000 (16:46 -0700)]
Add rustc_platform_intrinsics & some arm/x86 intrs.

These are enough to implement a cross-platform SIMD single-precision
mandelbrot renderer.

8 years agoAdd comparison and shuffle SIMD intrinsics.
Huon Wilson [Thu, 16 Jul 2015 18:59:23 +0000 (11:59 -0700)]
Add comparison and shuffle SIMD intrinsics.

- simd_eq, simd_ne, simd_lt, simd_le, simd_gt, simd_ge
- simd_shuffleNNN

8 years agoAdd some SIMD target_feature cfg's when appropriate.
Huon Wilson [Tue, 14 Jul 2015 22:49:03 +0000 (15:49 -0700)]
Add some SIMD target_feature cfg's when appropriate.

NB. this may not be 100% perfect.

8 years agofeature gate `cfg(target_feature)`.
Huon Wilson [Tue, 14 Jul 2015 00:10:44 +0000 (17:10 -0700)]
feature gate `cfg(target_feature)`.

This is theoretically a breaking change, but GitHub search turns up no
uses of it, and most non-built-in cfg's are passed via cargo features,
which look like `feature = "..."`, and hence can't overlap.

8 years agoswitch core::simd to repr(simd) and deprecate it.
Huon Wilson [Mon, 13 Jul 2015 18:57:46 +0000 (11:57 -0700)]
switch core::simd to repr(simd) and deprecate it.

This functionality will be available out of tree in the `simd` crate on
crates.io.

[breaking-change]

8 years agoAuto merge of #27833 - arielb1:robust-construction, r=eddyb
bors [Mon, 17 Aug 2015 21:02:47 +0000 (21:02 +0000)]
Auto merge of #27833 - arielb1:robust-construction, r=eddyb

Fixes #27815

r? @eddyb

8 years agoRemove dependencies on libm functions from libcore.
Eli Friedman [Sun, 16 Aug 2015 07:42:53 +0000 (00:42 -0700)]
Remove dependencies on libm functions from libcore.

There wasn't any particular reason the functions needed to be there
anyway, so just get rid of them, and adjust libstd to compensate.

With this change, libcore depends on exactly two floating-point functions:
fmod and fmodf.  They are implicitly referenced because they are
used to implement "%".

8 years agoImplement `repr(simd)` as an alias for `#[simd]`.
Huon Wilson [Mon, 13 Jul 2015 18:35:00 +0000 (11:35 -0700)]
Implement `repr(simd)` as an alias for `#[simd]`.

8 years agoAuto merge of #27864 - frewsxcv:regression-test, r=alexcrichton
bors [Mon, 17 Aug 2015 16:29:31 +0000 (16:29 +0000)]
Auto merge of #27864 - frewsxcv:regression-test, r=alexcrichton

Closes #23304

8 years agouse the correct substs when checking struct patterns
Ariel Ben-Yehuda [Sat, 15 Aug 2015 22:20:36 +0000 (01:20 +0300)]
use the correct substs when checking struct patterns

also, make sure this is tested.

8 years agoAdd regression tests for #23304
Corey Farwell [Mon, 17 Aug 2015 13:36:03 +0000 (09:36 -0400)]
Add regression tests for #23304

Closes #23304

8 years agoStrSearcher: Additional comments and small code moves
Ulrik Sverdrup [Sun, 16 Aug 2015 20:37:18 +0000 (22:37 +0200)]
StrSearcher: Additional comments and small code moves

Break out a separate static method to create the "byteset".

8 years agoAuto merge of #27858 - rkruppe:rustdoc-codespans, r=alexcrichton
bors [Sun, 16 Aug 2015 17:17:43 +0000 (17:17 +0000)]
Auto merge of #27858 - rkruppe:rustdoc-codespans, r=alexcrichton

Fixes #24746

8 years agoAuto merge of #27689 - dotdash:die_odr, r=michaelwoerister
bors [Sun, 16 Aug 2015 14:50:52 +0000 (14:50 +0000)]
Auto merge of #27689 - dotdash:die_odr, r=michaelwoerister

When using a generic enum type that was defined in an external crate,
our debuginfo currently claims that the concrete type (e.g. Option<i32>)
was defined in the current crate, where it was first used.

This means that if there are multiple crates that all use, for example,
Option<i32> values, they'll have conflicting debuginfo, each crate
claiming to have defined that type. This doesn't cause problems in
regular builds, but with LTO enabled, LLVM complains because it tries to
merge the debuginfo for those types and sees the ODR violations.

Since I couldn't find a way to get the file info for the external crate
that actually defined the enum, I'm working around the issue by using
"<unknown>" as the file for enum types. We'll want to re-visit and fix
this later, but this at least this fixes the ICE. And with the file
being unknown instead of wrong, the debuginfo isn't really worse than
before either.

Fixes #26447

8 years agoCorrect signature of hoedown callback for codespans
Robin Kruppe [Sun, 16 Aug 2015 14:49:10 +0000 (16:49 +0200)]
Correct signature of hoedown callback for codespans

8 years agoAuto merge of #27643 - mitaa:get_item_, r=arielb1
bors [Sun, 16 Aug 2015 12:14:29 +0000 (12:14 +0000)]
Auto merge of #27643 - mitaa:get_item_, r=arielb1

(this incidentally fixes an error message where the paths separator is " " instead of "::")

8 years agoAuto merge of #27853 - seckar:master, r=steveklabnik
bors [Sun, 16 Aug 2015 06:53:43 +0000 (06:53 +0000)]
Auto merge of #27853 - seckar:master, r=steveklabnik

8 years agoAuto merge of #27818 - alexcrichton:tag-all-the-issues, r=aturon
bors [Sun, 16 Aug 2015 05:10:23 +0000 (05:10 +0000)]
Auto merge of #27818 - alexcrichton:tag-all-the-issues, r=aturon

This commit turns `#[unstable]` attributes missing an `issue` annotation into a hard error. This will require the libs team to ensure that there's a tracking issue for all unstable features in the standard library.

All existing unstable features have had issues created and they've all been updated. Yay!

Closes #26868

8 years agoFix typo in doc string.
Nicholas Seckar [Sun, 16 Aug 2015 03:17:52 +0000 (20:17 -0700)]
Fix typo in doc string.

8 years agotest: Fix tests for requiring issues
Alex Crichton [Thu, 13 Aug 2015 20:06:25 +0000 (13:06 -0700)]
test: Fix tests for requiring issues

8 years agoAuto merge of #27851 - nikomatsakis:cleanup-ty-decoder, r=eddyb
bors [Sun, 16 Aug 2015 02:25:36 +0000 (02:25 +0000)]
Auto merge of #27851 - nikomatsakis:cleanup-ty-decoder, r=eddyb

Just a little code cleanup I was doing as part of another refactoring (which may turn out not to be needed). The main thrust of this is to cleanup the interface to `tydecode.rs` to be less ridiculously repetitive. I also purged the generic "def-id conversion" parameter in favor of a trait object, just to reduce code duplication a bit and make the signatures a bit less messy. I measured the bootstrapping time to build stage2 with these changes, it was identical. (But it'd be easy enough to restore the unboxed closure if we wanted it.)

8 years agoremove the last remnants of old interface
Niko Matsakis [Sun, 16 Aug 2015 01:35:49 +0000 (21:35 -0400)]
remove the last remnants of old interface

8 years agoAdd issue for the rustc_private feature everywhere
Alex Crichton [Thu, 13 Aug 2015 17:21:36 +0000 (10:21 -0700)]
Add issue for the rustc_private feature everywhere

8 years agostd: Add issues to all unstable features
Alex Crichton [Thu, 13 Aug 2015 17:12:38 +0000 (10:12 -0700)]
std: Add issues to all unstable features

8 years agocollections: Add issues for unstable features
Alex Crichton [Thu, 13 Aug 2015 05:19:51 +0000 (22:19 -0700)]
collections: Add issues for unstable features

8 years agorustc_unicode: Add issues for unstable features
Alex Crichton [Thu, 13 Aug 2015 05:19:39 +0000 (22:19 -0700)]
rustc_unicode: Add issues for unstable features

8 years agolibc,rand: Add issues for all unstable features
Alex Crichton [Thu, 13 Aug 2015 05:19:19 +0000 (22:19 -0700)]
libc,rand: Add issues for all unstable features

8 years agoalloc: Add issues for all unstable features
Alex Crichton [Thu, 13 Aug 2015 05:19:08 +0000 (22:19 -0700)]
alloc: Add issues for all unstable features

8 years agocore: Fill out issues for unstable features
Alex Crichton [Thu, 13 Aug 2015 00:23:48 +0000 (17:23 -0700)]
core: Fill out issues for unstable features

8 years agosyntax: Require issues for unstable features
Alex Crichton [Thu, 13 Aug 2015 00:23:17 +0000 (17:23 -0700)]
syntax: Require issues for unstable features

This turns an `#[unstable]` tag without an `issue` annotation into a hard error
to ensure that we've always got a tracking issue for unstable features in the
standard library.

8 years agoAuto merge of #27845 - dylanmckay:abstract-pointer-size-away, r=alexcrichton
bors [Sat, 15 Aug 2015 19:10:40 +0000 (19:10 +0000)]
Auto merge of #27845 - dylanmckay:abstract-pointer-size-away, r=alexcrichton

This patch rewrites code in several places which assume that the current target has either 32-bit or 64-bit pointers so that it can support arbitrary-width pointers.

It does not completely remove all assumptions of pointer width, but it does reduce them significantly. There is a discussion [here](https://internals.rust-lang.org/t/adding-16-bit-pointer-support/2484/10) about the change.

8 years agoprevent non-dict-structs from being intialized via FRU
Ariel Ben-Yehuda [Sat, 15 Aug 2015 18:03:10 +0000 (21:03 +0300)]
prevent non-dict-structs from being intialized via FRU

Fixes #27831

8 years agoclean-up ExprStruct and PatStruct type-checking
Ariel Ben-Yehuda [Sat, 15 Aug 2015 17:39:28 +0000 (20:39 +0300)]
clean-up ExprStruct and PatStruct type-checking

This fixes the crazy "transparent aliases" bug, which I hope nobody
relied on.

8 years agoAuto merge of #27847 - birkenfeld:patch-3, r=sfackler
bors [Sat, 15 Aug 2015 17:30:15 +0000 (17:30 +0000)]
Auto merge of #27847 - birkenfeld:patch-3, r=sfackler

8 years agoAuto merge of #27827 - w00ns:for-loop-expn-issue-27639, r=alexcrichton
bors [Sat, 15 Aug 2015 14:50:13 +0000 (14:50 +0000)]
Auto merge of #27827 - w00ns:for-loop-expn-issue-27639, r=alexcrichton

Fixes #27639

8 years agoIterator::all() - document short-circuiting property parallel to any()
Georg Brandl [Sat, 15 Aug 2015 09:49:33 +0000 (11:49 +0200)]
Iterator::all() - document short-circuiting property parallel to any()

8 years agoAuto merge of #27846 - AlisdairO:diagnostics248, r=Manishearth
bors [Sat, 15 Aug 2015 09:26:48 +0000 (09:26 +0000)]
Auto merge of #27846 - AlisdairO:diagnostics248, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoImprove 'unknown instrinsic' error message
Dylan McKay [Sat, 15 Aug 2015 09:06:06 +0000 (21:06 +1200)]
Improve 'unknown instrinsic' error message

If you had previously tried to get the ValueRef associated with an
intrinsic that hadn't been described in
`trans::context::declare_intrinsic()`, the compile would panic with
an empty message.

Now we print out details about the error in the panic message.

8 years agoAdd extended diagnostics for E0248
Alisdair Owens [Fri, 14 Aug 2015 20:33:40 +0000 (21:33 +0100)]
Add extended diagnostics for E0248

8 years agoastencode: convert code to use TyDecoder directly
Niko Matsakis [Fri, 14 Aug 2015 09:58:10 +0000 (05:58 -0400)]
astencode: convert code to use TyDecoder directly

8 years agos/PState/TyDecoder/
Niko Matsakis [Fri, 14 Aug 2015 09:37:49 +0000 (05:37 -0400)]
s/PState/TyDecoder/

8 years agotydecode: tighten privacy
Niko Matsakis [Fri, 14 Aug 2015 09:14:54 +0000 (05:14 -0400)]
tydecode: tighten privacy

8 years agoconvert tydecode to use an impl, eliminating a lot of boilerplate
Niko Matsakis [Fri, 14 Aug 2015 09:11:54 +0000 (05:11 -0400)]
convert tydecode to use an impl, eliminating a lot of boilerplate

8 years agoFix issue with for loop expansion
w00ns [Fri, 14 Aug 2015 05:23:29 +0000 (07:23 +0200)]
Fix issue with for loop expansion

8 years agoReduce rustc::trans's dependence on pointer width
Dylan McKay [Sat, 15 Aug 2015 06:43:39 +0000 (18:43 +1200)]
Reduce rustc::trans's dependence on pointer width

8 years agoReduce libcore/liballoc's dependence on pointer sizes
Dylan McKay [Sat, 15 Aug 2015 05:17:17 +0000 (17:17 +1200)]
Reduce libcore/liballoc's dependence on pointer sizes

8 years agoAuto merge of #27841 - jonas-schievink:still-repeating-span, r=alexcrichton
bors [Sat, 15 Aug 2015 06:16:41 +0000 (06:16 +0000)]
Auto merge of #27841 - jonas-schievink:still-repeating-span, r=alexcrichton

Current behaviour demo: http://is.gd/l3FEgo
(The span is printed at the start of the source code)

This patch moves the span to the use of `$i` in the macro rhs (as the code comment already claims)

8 years agoAuto merge of #27825 - withoutboats:default_array, r=alexcrichton
bors [Sat, 15 Aug 2015 04:19:14 +0000 (04:19 +0000)]
Auto merge of #27825 - withoutboats:default_array, r=alexcrichton

Implemented Default for arrays up to length 32 where T: Default using an additional macro.

8 years agoAuto merge of #27839 - gkoz:netbsd_ar, r=brson
bors [Sat, 15 Aug 2015 01:45:15 +0000 (01:45 +0000)]
Auto merge of #27839 - gkoz:netbsd_ar, r=brson

NetBSD didn't get its fix for #27124 and still suffers from that issue.

8 years agoconvert tydecode to use a closure for def-id conversion and
Niko Matsakis [Fri, 14 Aug 2015 08:56:07 +0000 (04:56 -0400)]
convert tydecode to use a closure for def-id conversion and
to store the closure in the PSState struct

8 years agomove InlinedItem into librustc, where it belongs
Niko Matsakis [Thu, 13 Aug 2015 14:57:34 +0000 (10:57 -0400)]
move InlinedItem into librustc, where it belongs

8 years agoAuto merge of #27400 - alexcrichton:less-jemalloc, r=brson
bors [Fri, 14 Aug 2015 22:52:11 +0000 (22:52 +0000)]
Auto merge of #27400 - alexcrichton:less-jemalloc, r=brson

This commit is an implementation of [RFC 1183][rfc] which allows swapping out
the default allocator on nightly Rust. No new stable surface area should be
added as a part of this commit.

[rfc]: https://github.com/rust-lang/rfcs/pull/1183

Two new attributes have been added to the compiler:

* `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to
  indicate that it requires an allocator crate to be in scope.
* `#![allocator]` - this is a indicator that the crate is an allocator which can
  satisfy the `needs_allocator` attribute above.

The ABI of the allocator crate is defined to be a set of symbols that implement
the standard Rust allocation/deallocation functions. The symbols are not
currently checked for exhaustiveness or typechecked. There are also a number of
restrictions on these crates:

* An allocator crate cannot transitively depend on a crate that is flagged as
  needing an allocator (e.g. allocator crates can't depend on liballoc).
* There can only be one explicitly linked allocator in a final image.
* If no allocator is explicitly requested one will be injected on behalf of the
  compiler. Binaries and Rust dylibs will use jemalloc by default where
  available and staticlibs/other dylibs will use the system allocator by
  default.

Two allocators are provided by the distribution by default, `alloc_system` and
`alloc_jemalloc` which operate as advertised.

Closes #27389

8 years agoFix span of invalid metavariable repetition
Jonas Schievink [Fri, 14 Aug 2015 21:26:19 +0000 (23:26 +0200)]
Fix span of invalid metavariable repetition

8 years agorustc: Allow changing the default allocator
Alex Crichton [Thu, 25 Jun 2015 17:07:01 +0000 (10:07 -0700)]
rustc: Allow changing the default allocator

This commit is an implementation of [RFC 1183][rfc] which allows swapping out
the default allocator on nightly Rust. No new stable surface area should be
added as a part of this commit.

[rfc]: https://github.com/rust-lang/rfcs/pull/1183

Two new attributes have been added to the compiler:

* `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to
  indicate that it requires an allocator crate to be in scope.
* `#![allocator]` - this is a indicator that the crate is an allocator which can
  satisfy the `needs_allocator` attribute above.

The ABI of the allocator crate is defined to be a set of symbols that implement
the standard Rust allocation/deallocation functions. The symbols are not
currently checked for exhaustiveness or typechecked. There are also a number of
restrictions on these crates:

* An allocator crate cannot transitively depend on a crate that is flagged as
  needing an allocator (e.g. allocator crates can't depend on liballoc).
* There can only be one explicitly linked allocator in a final image.
* If no allocator is explicitly requested one will be injected on behalf of the
  compiler. Binaries and Rust dylibs will use jemalloc by default where
  available and staticlibs/other dylibs will use the system allocator by
  default.

Two allocators are provided by the distribution by default, `alloc_system` and
`alloc_jemalloc` which operate as advertised.

Closes #27389

8 years agofixes #27124 for netbsd
Gleb Kozyrev [Fri, 14 Aug 2015 19:20:09 +0000 (22:20 +0300)]
fixes #27124 for netbsd

NetBSD didn't get its fix for #27124 and still suffers from that issue.

8 years agoAuto merge of #27838 - AlisdairO:diagnostics221, r=Manishearth
bors [Fri, 14 Aug 2015 19:21:59 +0000 (19:21 +0000)]
Auto merge of #27838 - AlisdairO:diagnostics221, r=Manishearth

As title :-)
Part of #24407.

r? @Manishearth

8 years agoadd diagnostics for E0221
Alisdair Owens [Fri, 14 Aug 2015 19:21:24 +0000 (20:21 +0100)]
add diagnostics for E0221

8 years agoImplemented Default for arrays up to [T; 32].
Without Boats [Fri, 14 Aug 2015 17:11:19 +0000 (10:11 -0700)]
Implemented Default for arrays up to [T; 32].

8 years agoAuto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc
bors [Fri, 14 Aug 2015 15:26:09 +0000 (15:26 +0000)]
Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc

This PR implements the majority of RFC 1214. In particular, it implements:

- the new outlives relation
- comprehensive WF checking

For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run.

There are some deviations from RFC 1214. Most notably:

- we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing).
- object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent.

Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests.

r? @nrc (or perhaps someone else?)

8 years agobe more robust to bogus items in struct patterns/constructors
Ariel Ben-Yehuda [Fri, 14 Aug 2015 13:14:09 +0000 (16:14 +0300)]
be more robust to bogus items in struct patterns/constructors

Fixes #27815

8 years agoCorrect nits from @nrc
Niko Matsakis [Fri, 14 Aug 2015 13:26:19 +0000 (09:26 -0400)]
Correct nits from @nrc

8 years agoAuto merge of #27822 - arielb1:inline-round-take-2, r=Gankro
bors [Fri, 14 Aug 2015 07:11:07 +0000 (07:11 +0000)]
Auto merge of #27822 - arielb1:inline-round-take-2, r=Gankro

This speeds up rustc on #25916 from 1.36±0.022s to 1.326±0.025s

Tests pass locally (even on 32-bit :-)

r? @Gankro

8 years agoAuto merge of #27821 - dhuseby:manual_snapshots_1af31d4, r=alexcrichton
bors [Fri, 14 Aug 2015 05:40:44 +0000 (05:40 +0000)]
Auto merge of #27821 - dhuseby:manual_snapshots_1af31d4, r=alexcrichton

@alexcrichton please upload these snapshots when landing this patch:

https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2015-08-11-1af31d4-bitrig-x86_64-739e0635cd5a1b3635f1457aae3ef6390ea9a7a8.tar.bz2
https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2015-08-11-1af31d4-freebsd-i386-3cd4a44fb97b3135be3d1b760bea604a381e85dc.tar.bz2
https://github.com/dhuseby/rust-manual-snapshots/raw/master/rust-stage0-2015-08-11-1af31d4-freebsd-x86_64-de1f36592bac0eeb90c049a8421246652c511b9e.tar.bz2