]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoFix build after rebase
Andrew Cann [Thu, 1 Dec 2016 04:41:21 +0000 (12:41 +0800)]
Fix build after rebase

7 years agoStyle fix
Andrew Cann [Thu, 1 Dec 2016 03:56:55 +0000 (11:56 +0800)]
Style fix

7 years agoImprove error message, fix and add tests.
Andrew Cann [Thu, 1 Dec 2016 03:37:03 +0000 (11:37 +0800)]
Improve error message, fix and add tests.

Changes the non-exhaustive match error message to generate more general
witnesses.

7 years agoMore pattern matching for empty types changes
Andrew Cann [Wed, 30 Nov 2016 17:12:03 +0000 (01:12 +0800)]
More pattern matching for empty types changes

Fix is_uninhabited for enum types. It used to assume that an enums variant's
fields were all private.

Fix MIR generation for irrefutable Variant pattern matches. This allows code
like this to work:

    let x: Result<32, !> = Ok(123);
    let Ok(y) = x;

Carry type information on dummy wildcard patterns. Sometimes we need to expand
these patterns into their constructors and we don't want to be expanding a
TyError into a Constructor::Single.

7 years agoMake is_useful handle empty types properly
Andrew Cann [Tue, 29 Nov 2016 07:10:26 +0000 (15:10 +0800)]
Make is_useful handle empty types properly

7 years agoStart enabling empty types in pattern matching.
Andrew Cann [Mon, 28 Nov 2016 10:38:27 +0000 (18:38 +0800)]
Start enabling empty types in pattern matching.

Remove the assumption at the start of is_useful that any suitably-long array of
wildcard patterns is useful relative the any empty vector. Instead we just
continue to recurse column-wise over the matrix.

This assumption is false in the presence of empty types.
eg. in the simplest case:

let x: ! = ...;
match x {
    // This pattern should not be considered useful by the algorithm
    _   => ...
}

7 years agoAuto merge of #38782 - clarcharr:stupid, r=GuillaumeGomez
bors [Tue, 3 Jan 2017 02:21:00 +0000 (02:21 +0000)]
Auto merge of #38782 - clarcharr:stupid, r=GuillaumeGomez

Reword 'stupid' and 'crazy' in docs.

These terms are not very descriptive and are better reworded as something else.

7 years agoReword 'stupid' and 'crazy' in docs.
Clar Charr [Mon, 2 Jan 2017 20:47:00 +0000 (15:47 -0500)]
Reword 'stupid' and 'crazy' in docs.

7 years agoAuto merge of #38543 - philipc:unsized-debuginfo, r=michaelwoerister
bors [Mon, 2 Jan 2017 20:17:01 +0000 (20:17 +0000)]
Auto merge of #38543 - philipc:unsized-debuginfo, r=michaelwoerister

Fix debuginfo for unsized struct members

The member was given the size of a fat pointer, which caused
llvm to emit DWARF attributes for a 128-bit bitfield.

7 years agoAuto merge of #38760 - est31:ignorecfg, r=sanxiyn
bors [Mon, 2 Jan 2017 18:10:37 +0000 (18:10 +0000)]
Auto merge of #38760 - est31:ignorecfg, r=sanxiyn

Fix pre-cfg_attr notation in comment

Commit aa3b1261b164eeac3e68573bfc698d1ca943fb05 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.

7 years agoAuto merge of #38766 - eddyb:less-fake-hir, r=arielb1
bors [Mon, 2 Jan 2017 13:51:43 +0000 (13:51 +0000)]
Auto merge of #38766 - eddyb:less-fake-hir, r=arielb1

Stop creating fake HIR pattern nodes.

This replaces all the HIR patterns `rustc_const_eval` creates with the more appropriate HAIR equivalent.

The only place left that creates HIR nodes is the "explicit lifetimes in function signature" suggestion, which only creates type nodes while rebuilding the signature, but that is only in case of an error.

cc @arielb1

7 years agoAuto merge of #38548 - GuillaumeGomez:thread_struct_docs, r=frewsxcv
bors [Sun, 1 Jan 2017 22:45:02 +0000 (22:45 +0000)]
Auto merge of #38548 - GuillaumeGomez:thread_struct_docs, r=frewsxcv

Add missing example for Thread struct

r? @frewsxcv

7 years agoAuto merge of #38765 - xen0n:i-dont-like-red-bots-2, r=alexcrichton
bors [Sun, 1 Jan 2017 20:43:21 +0000 (20:43 +0000)]
Auto merge of #38765 - xen0n:i-dont-like-red-bots-2, r=alexcrichton

rustbuild: fix dist-analysis with full bootstrap disabled

Really fixes #38734, per discussion in #38752 which was solving the underlying problem the wrong way.

This just mirrors the [similar logic] in documentation building as suggested, that just takes the stage1 compiler artifacts instead in case of non-full-bootstrap builds. Actually copying the artifacts around seems to be unnecessary.

r? @alexcrichton

[similar logic]: https://github.com/rust-lang/rust/blob/7b659cfdbce094a790dbb246da2681a47565782a/src/bootstrap/doc.rs#L140-L144

7 years agorustc_const_eval: convert constants to Pattern instead of hir::Pat.
Eduard-Mihai Burtescu [Sun, 1 Jan 2017 20:17:18 +0000 (22:17 +0200)]
rustc_const_eval: convert constants to Pattern instead of hir::Pat.

7 years agorustbuild: fix dist-analysis with full bootstrap disabled
Wang Xuerui [Sun, 1 Jan 2017 20:12:49 +0000 (04:12 +0800)]
rustbuild: fix dist-analysis with full bootstrap disabled

7 years agoFix pre-cfg_attr notation in comment
est31 [Sun, 1 Jan 2017 19:34:23 +0000 (20:34 +0100)]
Fix pre-cfg_attr notation in comment

Commit aa3b1261b164eeac3e68573bfc698d1ca943fb05 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.

7 years agorustc_const_eval: build Pattern instead of hir::Pat for pretty-printing.
Eduard-Mihai Burtescu [Sun, 1 Jan 2017 18:57:21 +0000 (20:57 +0200)]
rustc_const_eval: build Pattern instead of hir::Pat for pretty-printing.

7 years agoAuto merge of #38692 - estebank:remove-try-from-pprust, r=petrochenkov
bors [Sun, 1 Jan 2017 18:42:34 +0000 (18:42 +0000)]
Auto merge of #38692 - estebank:remove-try-from-pprust, r=petrochenkov

Use `?` instead of `try!` macro in `print::pprust`

7 years agoAuto merge of #38753 - philipc:debuginfo-union, r=petrochenkov
bors [Sun, 1 Jan 2017 16:41:29 +0000 (16:41 +0000)]
Auto merge of #38753 - philipc:debuginfo-union, r=petrochenkov

Add pretty printing of unions in debuggers

Fixes #37479

7 years agoAuto merge of #38745 - CannedYerins:llvm-code-style, r=rkruppe
bors [Sun, 1 Jan 2017 11:58:02 +0000 (11:58 +0000)]
Auto merge of #38745 - CannedYerins:llvm-code-style, r=rkruppe

Improve naming style in rustllvm.

As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.

Fixes #38688.

r? @rkruppe

7 years agoAuto merge of #38726 - japaric:sparc64, r=sanxiyn
bors [Sun, 1 Jan 2017 09:56:18 +0000 (09:56 +0000)]
Auto merge of #38726 - japaric:sparc64, r=sanxiyn

sparc64-linux support

This is built on top of #38656 and depends on rust-lang/libc#483

Hello world works.

The libc-test test suite passes.

`panic!` doesn't fully work:

```
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Illegal instruction (core dumped)
```

Backtraces don't work either, probably related to the previous point:

```
$ export RUST_BACKTRACE=1
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
stack backtrace:
Illegal instruction (core dumped)
```

r? @alexcrichton

@jakllsch Does panicking / backtraces work on sparc64-netbsd?

cc @glaubitz

7 years agoAdd pretty printing of unions in debuggers
Philip Craig [Sun, 1 Jan 2017 07:46:15 +0000 (17:46 +1000)]
Add pretty printing of unions in debuggers

Fixes #37479

7 years agoAuto merge of #38711 - programble:doc/slice-iter-method-links, r=brson
bors [Sun, 1 Jan 2017 07:54:04 +0000 (07:54 +0000)]
Auto merge of #38711 - programble:doc/slice-iter-method-links, r=brson

Add links to methods on all slice iterator struct docs

In the same style as `std::slice::Iter` to help people find how to create iterators.

r? @steveklabnik

7 years agoAuto merge of #38713 - clarcharr:trusted_len, r=brson
bors [Sun, 1 Jan 2017 05:39:16 +0000 (05:39 +0000)]
Auto merge of #38713 - clarcharr:trusted_len, r=brson

TrustedLen for Empty and Once.

These implementations were missing, so, I went ahead and added them.

7 years agoMerge branch 'master' into sparc64
Seo Sanghyeon [Sun, 1 Jan 2017 03:40:10 +0000 (12:40 +0900)]
Merge branch 'master' into sparc64

7 years agoAuto merge of #38653 - Mark-Simulacrum:dropless-arena, r=eddyb
bors [Sun, 1 Jan 2017 02:39:40 +0000 (02:39 +0000)]
Auto merge of #38653 - Mark-Simulacrum:dropless-arena, r=eddyb

Add a DroplessArena and utilize it as a more efficient arena when possible

I will collect performance (probably just `-Ztime-passes`, and more if that shows significant differences, perhaps).

6feba98 also fixes a potential infinite loop if inplace reallocation failed for `TypedArena` (and `DroplessArena` via copied code).

r? @eddyb

7 years agoAuto merge of #38736 - xen0n:save-the-save-analysis, r=alexcrichton
bors [Sun, 1 Jan 2017 00:27:35 +0000 (00:27 +0000)]
Auto merge of #38736 - xen0n:save-the-save-analysis, r=alexcrichton

rustbuild: save the save analysis

Fixes #38734. ~~call me the nightly firefighter~~

r? @alexcrichton

7 years agoAuto merge of #38708 - alexcrichton:add-distcheck, r=brson
bors [Sat, 31 Dec 2016 22:08:32 +0000 (22:08 +0000)]
Auto merge of #38708 - alexcrichton:add-distcheck, r=brson

Gate on distcheck on Travis

This commit adds a new entry to the Travis matrix to gate on distcheck, the illustrious test process that has historically taken *8 hours* to complete and also breaks all the time on nightly. By adding it to Travis we should hope to never see nightly breakage (like https://github.com/rust-lang/rust/issues/38690) because of this ever again!

"But wait, surely we can't wait 8 hours for all PRs!" you might be thinking, and you are indeed correct. The distcheck added here is much more optimized for speed than the old buildbot instances for a number of reasons:

* We're not building *two host compilers* beforehand. The current distcheck bot does a cross for i686 Linux and x86_64 Linux before it actually runs distcheck, building 6 compilers and LLVM twice. None of this is done in parallel as well (e.g. `-j1`). Not doing any of this work will be a huge win!
* We're using sccache to compile LLVM, so it should be much faster. Distcheck on the bots didn't cache LLVM well and rebuilt it every time.

All in all, this version of "distcheck" should be exactly like other matrix entries that run tests except that it's a *little* slower to start as it has to create the source tarball then rebuild the build system in the distcheck dir. Overall this should be well under the 2 hours that Android is currently taking anyway.

Closes https://github.com/rust-lang/rust/issues/38691

7 years agoAuto merge of #38482 - est31:i128, r=eddyb
bors [Sat, 31 Dec 2016 18:54:31 +0000 (18:54 +0000)]
Auto merge of #38482 - est31:i128, r=eddyb

i128 and u128 support

Brings i128 and u128 support to nightly rust, behind a feature flag. The goal of this PR is to do the bulk of the work for 128 bit integer support. Smaller but just as tricky features needed for stabilisation like 128 bit enum discriminants are left for future PRs.

Rebased version of  #37900, which in turn was a rebase + improvement of #35954 . Sadly I couldn't reopen #37900 due to github. There goes my premium position in the homu queue...

[plugin-breaking-change]

cc #35118 (tracking issue)

7 years agoUtilize new in_arena method instead of hashing for Lifting interned items
Mark Simulacrum [Sat, 31 Dec 2016 15:38:27 +0000 (08:38 -0700)]
Utilize new in_arena method instead of hashing for Lifting interned items

7 years agoSplit CtxtArenas into GlobalArenas and CtxtInterners.
Mark Simulacrum [Sat, 24 Dec 2016 03:48:21 +0000 (20:48 -0700)]
Split CtxtArenas into GlobalArenas and CtxtInterners.

CtxtInterners contains a single DroplessArena, while GlobalArenas
contains the TypedArenas still required for the remaining
Drop-containing types.

7 years agoImprove naming style in rustllvm.
Ian Kerins [Sat, 31 Dec 2016 17:01:23 +0000 (12:01 -0500)]
Improve naming style in rustllvm.

As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.

Fixes #38688.

7 years agoFix iabs and add some more tests
est31 [Sat, 31 Dec 2016 17:16:55 +0000 (18:16 +0100)]
Fix iabs and add some more tests

7 years agoAuto merge of #38737 - keeperofdakeys:proc-macro-derive-Dec-16, r=jseyfried
bors [Sat, 31 Dec 2016 16:49:27 +0000 (16:49 +0000)]
Auto merge of #38737 - keeperofdakeys:proc-macro-derive-Dec-16, r=jseyfried

Fix panic when using a macros 1.1 custom derive on a struct containing a macro invocation

Fixes #38706

r? @jseyfried

7 years agoFix TypedArena infinitely looping when inplace reallocation fails.
Mark Simulacrum [Sat, 24 Dec 2016 03:47:47 +0000 (20:47 -0700)]
Fix TypedArena infinitely looping when inplace reallocation fails.

7 years agoAdd a non type-specific arena.
Mark Simulacrum [Thu, 22 Dec 2016 17:12:56 +0000 (10:12 -0700)]
Add a non type-specific arena.

It relies on the underlying types not having special Drop behavior.

7 years agorustbuild: fix save-analysis not being saved for 2-stage builds
Wang Xuerui [Sat, 31 Dec 2016 06:31:08 +0000 (14:31 +0800)]
rustbuild: fix save-analysis not being saved for 2-stage builds

7 years agoAuto merge of #38709 - alexcrichton:check-xsv, r=nikomatsakis
bors [Sat, 31 Dec 2016 12:44:32 +0000 (12:44 +0000)]
Auto merge of #38709 - alexcrichton:check-xsv, r=nikomatsakis

cargotest: Add xsv to tested crates

This was intended to land in #37149 but I ended up backing it out to land the
rollup (#38697) last night as I was itching to do so. This morning though xsv
has been fixed now (BurntSushi/xsv#53) so we should be able to add it!

7 years agoAdd missing example for Thread struct
Guillaume Gomez [Thu, 22 Dec 2016 15:50:34 +0000 (16:50 +0100)]
Add missing example for Thread struct

7 years agoAuto merge of #38702 - philipc:debuginfo-lldb, r=alexcrichton
bors [Sat, 31 Dec 2016 10:39:46 +0000 (10:39 +0000)]
Auto merge of #38702 - philipc:debuginfo-lldb, r=alexcrichton

rustbuild: allow running debuginfo-lldb tests on linux

7 years agoAuto merge of #38667 - alexcrichton:stage0-tools, r=brson
bors [Sat, 31 Dec 2016 08:21:59 +0000 (08:21 +0000)]
Auto merge of #38667 - alexcrichton:stage0-tools, r=brson

rustbuild: Compile all support tools in stage0

This commit changes all tools and such to get compiled in stage0, not in
later stages. The purpose of this commit is to cut down dependencies on later
stages for future modifications to the build system. Notably we're going to be
adding builders that produce a full suite of cross-compiled artifacts for a
particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu`
compiler more than once. Currently dependencies on, for example, the error index
end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary.

As a result here we move many dependencies on these tools to being produced by a
stage0 compiler, not a stage1+ compiler. None of these tools actually need to be
staged at all, so they'll exhibit consistent behavior across the stages.

7 years agoStyle fixes
Josh Driver [Sat, 31 Dec 2016 07:25:59 +0000 (17:55 +1030)]
Style fixes

7 years agoStop macro calls in structs for proc_macro_derive from panicing
Josh Driver [Sat, 31 Dec 2016 05:32:06 +0000 (16:02 +1030)]
Stop macro calls in structs for proc_macro_derive from panicing

7 years agorustbuild: check if compiler is final stage wrt the full bootstrap setting
Wang Xuerui [Sat, 31 Dec 2016 06:29:27 +0000 (14:29 +0800)]
rustbuild: check if compiler is final stage wrt the full bootstrap setting

7 years agoAuto merge of #38729 - alexcrichton:android-steps, r=brson
bors [Sat, 31 Dec 2016 04:44:52 +0000 (04:44 +0000)]
Auto merge of #38729 - alexcrichton:android-steps, r=brson

rustbuild: Add more deps on android-copy-libs

The android-copy-libs step is crucial for running tests on the Android target as
it copies necessary scripts and such to the emulator. We must run that before
running any tests there, but we erroneously only did it for compiletest test
suites!

7 years agorustbuild: Add more deps on android-copy-libs
Alex Crichton [Sat, 31 Dec 2016 02:54:05 +0000 (18:54 -0800)]
rustbuild: Add more deps on android-copy-libs

The android-copy-libs step is crucial for running tests on the Android target as
it copies necessary scripts and such to the emulator. We must run that before
running any tests there, but we erroneously only did it for compiletest test
suites!

7 years agoCalculate discriminant bounds within 64 bits
Simonas Kazlauskas [Sat, 31 Dec 2016 02:55:29 +0000 (04:55 +0200)]
Calculate discriminant bounds within 64 bits

Since discriminants do not support i128 yet, lets just calculate the boundaries within the 64 bits
that are supported. This also avoids an issue with bootstrapping on 32 bit systems due to #38727.

7 years agosparc64-linux support
Jorge Aparicio [Fri, 30 Dec 2016 06:34:06 +0000 (01:34 -0500)]
sparc64-linux support

7 years agoAuto merge of #38601 - schulzch:master, r=brson
bors [Sat, 31 Dec 2016 00:50:46 +0000 (00:50 +0000)]
Auto merge of #38601 - schulzch:master, r=brson

Partial fix for #38489.

Fixes script name resolution for windows by invoking `emcc.bat` instead of `emcc`, etc.

Remaining issue:
```
Traceback (most recent call last):
  File "C:\Program Files\Emscripten\emscripten\1.35.0\\emcc", line 1309, in <module>
    final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL)
  File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\shared.py", line 1471, in llvm_opt
    assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:
```

7 years agoAuto merge of #38701 - karpinski:rustllvm-style, r=brson
bors [Fri, 30 Dec 2016 22:43:44 +0000 (22:43 +0000)]
Auto merge of #38701 - karpinski:rustllvm-style, r=brson

Making code style consistent for src/rustllvm (#38688)

Part of #38688

r? @brson

7 years agoTrustedLen for Empty and Once.
Clar Charr [Fri, 30 Dec 2016 19:34:47 +0000 (14:34 -0500)]
TrustedLen for Empty and Once.

7 years agoAdd links to methods on all slice iterator struct docs
Curtis McEnroe [Fri, 30 Dec 2016 18:50:11 +0000 (13:50 -0500)]
Add links to methods on all slice iterator struct docs

7 years agoAuto merge of #38658 - alexcrichton:less-docs, r=nikomatsakis
bors [Fri, 30 Dec 2016 18:24:27 +0000 (18:24 +0000)]
Auto merge of #38658 - alexcrichton:less-docs, r=nikomatsakis

std: Don't build docs for misc facade crates

Retain the same behavior as stable.

Closes #38319

7 years agostd: Don't build docs for misc facade crates
Alex Crichton [Wed, 28 Dec 2016 18:53:43 +0000 (10:53 -0800)]
std: Don't build docs for misc facade crates

Retain the same behavior as stable.

Closes #38319

7 years agocargotest: Add xsv to tested crates
Alex Crichton [Fri, 30 Dec 2016 17:56:43 +0000 (09:56 -0800)]
cargotest: Add xsv to tested crates

This was intended to land in #37149 but I ended up backing it out to land the
rollup (#38697) last night as I was itching to do so. This morning though xsv
has been fixed now (BurntSushi/xsv#53) so we should be able to add it!

7 years agotravis: Add a distcheck target
Alex Crichton [Fri, 30 Dec 2016 17:26:25 +0000 (09:26 -0800)]
travis: Add a distcheck target

This commit adds a new entry to the Travis matrix which performs a "distcheck",
which basically means that we create a tarball, extract that tarball, and then
build/test inside there. This ensures that the tarballs we produce are actually
able to be built/tested!

Along the way this also updates the rustbuild distcheck definition to propagate
the configure args from the top-level invocation.

Closes #38691

7 years agorustbuild: Fix source tarballs and the vendor dir
Alex Crichton [Fri, 30 Dec 2016 17:29:21 +0000 (09:29 -0800)]
rustbuild: Fix source tarballs and the vendor dir

The source tarball creation step would attempt to skip a number of files that we
want to ignore ourselves, but once we've hit the vendor directory we don't want
to skip anything so be sure to vendor everything inside that directory.

Closes #38690

7 years agorustbuild: Compile all support tools in stage0
Alex Crichton [Wed, 28 Dec 2016 23:01:21 +0000 (15:01 -0800)]
rustbuild: Compile all support tools in stage0

This commit changes all tools and such to get compiled in stage0, not in
later stages. The purpose of this commit is to cut down dependencies on later
stages for future modifications to the build system. Notably we're going to be
adding builders that produce a full suite of cross-compiled artifacts for a
particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu`
compiler more than once. Currently dependencies on, for example, the error index
end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary.

As a result here we move many dependencies on these tools to being produced by a
stage0 compiler, not a stage1+ compiler. None of these tools actually need to be
staged at all, so they'll exhibit consistent behavior across the stages.

7 years agoSwitching from NULL to nullptr in src/rustllvm.
karpinski [Fri, 30 Dec 2016 12:21:21 +0000 (13:21 +0100)]
Switching from NULL to nullptr in src/rustllvm.

7 years agoRan clang-format on src/rustllvm with llvm as the coding style.
karpinski [Fri, 30 Dec 2016 11:22:11 +0000 (12:22 +0100)]
Ran clang-format on src/rustllvm with llvm as the coding style.

7 years agoFix warning when compiling on 64 bit Linux
est31 [Mon, 26 Dec 2016 19:13:58 +0000 (20:13 +0100)]
Fix warning when compiling on 64 bit Linux

Code is much simpler now as well.

7 years agoAdd test to ensure unadjusted stays unstable
est31 [Mon, 26 Dec 2016 16:20:33 +0000 (17:20 +0100)]
Add test to ensure unadjusted stays unstable

7 years agoFurther and hopefully final Windows fixes
Simonas Kazlauskas [Fri, 23 Dec 2016 08:05:41 +0000 (10:05 +0200)]
Further and hopefully final Windows fixes

7 years agoMore windows fixes
est31 [Thu, 22 Dec 2016 11:06:30 +0000 (12:06 +0100)]
More windows fixes

7 years agoFix build
est31 [Wed, 21 Dec 2016 20:09:52 +0000 (21:09 +0100)]
Fix build

7 years agoThe windows special-cases only apply to x64
Simonas Kazlauskas [Wed, 21 Dec 2016 19:28:13 +0000 (21:28 +0200)]
The windows special-cases only apply to x64

7 years agoFix a return type
Simonas Kazlauskas [Wed, 21 Dec 2016 03:40:46 +0000 (05:40 +0200)]
Fix a return type

7 years agoFix sign-extension in stage1 compiler
Simonas Kazlauskas [Sat, 17 Dec 2016 23:47:38 +0000 (01:47 +0200)]
Fix sign-extension in stage1 compiler

7 years agoFix rebase fallout and compilation fixes
est31 [Fri, 16 Dec 2016 17:01:32 +0000 (18:01 +0100)]
Fix rebase fallout and compilation fixes

7 years agoFeature gate: 1.16.0 instead of 1.15.0
est31 [Thu, 15 Dec 2016 21:57:59 +0000 (22:57 +0100)]
Feature gate: 1.16.0 instead of 1.15.0

7 years agoFix rebase fallout
est31 [Wed, 14 Dec 2016 11:57:38 +0000 (12:57 +0100)]
Fix rebase fallout

7 years agoTidy
est31 [Wed, 14 Dec 2016 04:12:12 +0000 (05:12 +0100)]
Tidy

7 years agoFix another windows ABI mistake
est31 [Wed, 14 Dec 2016 03:19:45 +0000 (04:19 +0100)]
Fix another windows ABI mistake

...this time with the float intrinsics.

7 years agointrinsics: try to return everything via {u,i}128ret to match LLVM
est31 [Mon, 12 Dec 2016 03:56:00 +0000 (04:56 +0100)]
intrinsics: try to return everything via {u,i}128ret to match LLVM

on suggestion by nagisa.

7 years agoWindows x64 ABI requires i128 params to be passed as reference
est31 [Sat, 10 Dec 2016 21:18:01 +0000 (22:18 +0100)]
Windows x64 ABI requires i128 params to be passed as reference

7 years agoTidy
est31 [Thu, 8 Dec 2016 19:02:20 +0000 (20:02 +0100)]
Tidy

7 years agoPort to wrapping_* and unchecked_* operations
est31 [Thu, 8 Dec 2016 18:02:22 +0000 (19:02 +0100)]
Port to wrapping_* and unchecked_* operations

Otherwise, we codegen panic calls which create problems with debug assertions turned on.

7 years agoRemove unimplemented() function
est31 [Wed, 7 Dec 2016 15:56:26 +0000 (16:56 +0100)]
Remove unimplemented() function

7 years agolibcompiler_builtins: don't codegen dead code call to eh_personality
est31 [Wed, 7 Dec 2016 15:28:45 +0000 (16:28 +0100)]
libcompiler_builtins: don't codegen dead code call to eh_personality

There was a linker error on 32 bit platforms with optimisations turned off,
complaining that there was an undefined reference to "rust_eh_personality",
when compiling the rustc_const_math as stage1 artifact.

Apparently the compiler_builtins crate includes a call to "rust_eh_personality".
If compiled for 64 bits, this call doesn't appear, which explains why the linker
error only happens on 32 bit platforms, and optimisations will get it removed
on 32 bit as well.

There were two origins of the call:
    1. A for loop where apparently the compiler wasn't sure
       whether next() could panic or not, and therefore generated a landing
       pad for the worst case. The minimal reproducible example is "for _ in 0..sr { }".
    2. A default impl of uabs where the compiler apparently wasn't sure either
       whether iabs() could panic or not. Many thanks to nagisa for
       contributing the fix.

This commit also puts extern "C" to the intrinsics, as this is generally a
good thing to do.

7 years agoTry to fix some things
est31 [Mon, 5 Dec 2016 23:48:54 +0000 (00:48 +0100)]
Try to fix some things

* shift so that no panics are generated (otherwise results in linker error)
* no_std as insurance to not get into issues with errors like "cannot satisfy dependencies so `rustc_i128` only shows up once" (pure guessing here, but it doesn't hurt...)

7 years agoAlways use Rust based intrinsics on Windows
est31 [Sun, 4 Dec 2016 06:58:49 +0000 (07:58 +0100)]
Always use Rust based intrinsics on Windows

The check inside compiler-rt file int_types.h to #define CRT_HAS_128BIT
looks like:

 #if (defined(__LP64__) || defined(__wasm__)) && \
     !(defined(__mips__) && defined(__clang__))
 #define CRT_HAS_128BIT
 #endif

Windows uses LLP64 instead of LP64, so it doesn't ship with the C based
intrinsics.

Also, add libcompiler_builtins to the list of crates that may have platform
specific checks (like the ones we just added).

7 years ago40 -> 39, as ceil(log10(2^128)) == 39
est31 [Mon, 28 Nov 2016 01:18:34 +0000 (02:18 +0100)]
40 -> 39, as ceil(log10(2^128)) == 39

just as ceil(log10(2^64)) == 20

7 years agoMove from RUSTC_CRATES to TARGET_CRATES
est31 [Sun, 27 Nov 2016 23:57:25 +0000 (00:57 +0100)]
Move from RUSTC_CRATES to TARGET_CRATES

7 years agoFix warning on 64 bit
est31 [Sat, 26 Nov 2016 17:30:14 +0000 (18:30 +0100)]
Fix warning on 64 bit

7 years agointrinsics : uabs and iabs
est31 [Fri, 25 Nov 2016 01:33:35 +0000 (02:33 +0100)]
intrinsics : uabs and iabs

7 years agoFix intrinsics and expand tests
est31 [Thu, 24 Nov 2016 23:08:40 +0000 (00:08 +0100)]
Fix intrinsics and expand tests

7 years agoMake rustdoc aware of the primitive i128 type
est31 [Mon, 21 Nov 2016 04:40:35 +0000 (05:40 +0100)]
Make rustdoc aware of the primitive i128 type

Many thanks to ollie27 for spotting all the places.

7 years agoCompilation fixes
est31 [Sun, 20 Nov 2016 05:44:56 +0000 (06:44 +0100)]
Compilation fixes

7 years agoUse LLVMRustConstInt128Get on stage1 too
est31 [Sun, 20 Nov 2016 04:06:53 +0000 (05:06 +0100)]
Use LLVMRustConstInt128Get on stage1 too

llvm::LLVMConstIntGetZExtValue doesn't accept values with more than 64 bits.

This fixes an LLVM assertion error when compiling libcore with stage1:

src/llvm/include/llvm/ADT/APInt.h:1336:
uint64_t llvm::APInt::getZExtValue() const:
Assertion `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.

7 years agoFix rebase fallout
est31 [Sun, 20 Nov 2016 00:26:51 +0000 (01:26 +0100)]
Fix rebase fallout

7 years agoWIP intrinsics
Simonas Kazlauskas [Sun, 2 Oct 2016 20:01:57 +0000 (23:01 +0300)]
WIP intrinsics

7 years agoFix rebase fallout
Simonas Kazlauskas [Tue, 27 Sep 2016 16:06:44 +0000 (19:06 +0300)]
Fix rebase fallout

This commit includes manual merge conflict resolution changes from a rebase by @est31.

7 years agoFix i128 alignment calculation
Simonas Kazlauskas [Tue, 27 Sep 2016 13:22:02 +0000 (16:22 +0300)]
Fix i128 alignment calculation

7 years agoImplement emit_iu128 for json serialiser
Simonas Kazlauskas [Sat, 27 Aug 2016 21:59:14 +0000 (00:59 +0300)]
Implement emit_iu128 for json serialiser

Causes ICEs otherwise while trying to dump AST

7 years agoAdd a way to retrieve constant value in 128 bits
Simonas Kazlauskas [Thu, 25 Aug 2016 22:32:46 +0000 (01:32 +0300)]
Add a way to retrieve constant value in 128 bits

Fixes rebase fallout, makes code correct in presence of 128-bit constants.

This commit includes manual merge conflict resolution changes from a rebase by @est31.

7 years agoimpl Step for iu128
Simonas Kazlauskas [Wed, 24 Aug 2016 23:16:21 +0000 (02:16 +0300)]
impl Step for iu128

Also fix the leb128 tests

7 years agoFix parse-fail and compile-fail tests
Simonas Kazlauskas [Wed, 24 Aug 2016 19:38:14 +0000 (22:38 +0300)]
Fix parse-fail and compile-fail tests

7 years agoWrapping<i128> and attempt at LLVM 3.7 compat
Simonas Kazlauskas [Wed, 24 Aug 2016 16:29:15 +0000 (19:29 +0300)]
Wrapping<i128> and attempt at LLVM 3.7 compat

This commit includes manual merge conflict resolution changes from a rebase by @est31.

7 years agoMakefiles support for rustc_i128 crate
Simonas Kazlauskas [Wed, 24 Aug 2016 13:48:35 +0000 (16:48 +0300)]
Makefiles support for rustc_i128 crate

This commit includes manual merge conflict resolution changes from a rebase by @est31.

7 years agoTidy
Simonas Kazlauskas [Wed, 24 Aug 2016 13:10:38 +0000 (16:10 +0300)]
Tidy

This commit includes manual merge conflict resolution changes from a rebase by @est31.