Commit Graph

2609 Commits

Author SHA1 Message Date
bjorn3
9a21312480 Sync from rust 4137088d9d 2021-03-26 13:02:49 +01:00
bjorn3
73626efb26 Rustfmt 2021-03-21 10:05:48 +01:00
bjorn3
56fe51cb36 Update Cranelift 2021-03-21 10:05:22 +01:00
lcnr
500bcfcdb3 update const_eval_resolve 2021-03-20 17:22:24 +01:00
SparrowLii
e4a1092b9f Add simd_neg platform intrinsic 2021-03-19 02:16:21 +08:00
bjorn3
7bd3950831 Fix rustc test suite 2021-03-18 13:15:37 +01:00
bjorn3
0069007d5b Avoid nightly feature usage where easily possible 2021-03-18 12:23:55 +01:00
bjorn3
664b25ea38 Rustup to rustc 1.52.0-nightly (36f1f04f1 2021-03-17) 2021-03-18 12:19:31 +01:00
bjorn3
6a0ce7f6bb Sync from rust 04ae50179a 2021-03-17 18:36:30 +01:00
bjorn3
e86b95480f Directly invoke the main function in JIT mode
Fixes #1151
2021-03-17 13:56:54 +01:00
bjorn3
218b383f8f Rustfmt 2021-03-17 13:54:40 +01:00
bjorn3
53235d2abb Enable thread test in std_example
Turns out libstd doesn't use #[thread_local] on Windows at all
2021-03-15 18:01:48 +01:00
bjorn3
a47896d6e4
Merge pull request #1149 from bjorn3/test_rustc_testsuite
Run the rustc test suite on CI
2021-03-15 16:30:52 +01:00
bjorn3
80b2feae1a Run the rustc test suite on CI 2021-03-15 15:22:18 +01:00
bjorn3
154668bd02 Suppress an unnecessary warning and fix an incorrect warning 2021-03-15 14:48:58 +01:00
bjorn3
afc529dbe7 Fix assert_assignable adt checking 2021-03-15 14:22:11 +01:00
bjorn3
f545a21fbe Split rust fork setup out of test_bootstrap.sh 2021-03-15 14:21:15 +01:00
bjorn3
78d0b77651 Update Cranelift 2021-03-15 14:04:22 +01:00
bjorn3
3d85f05dfd Remove no longer necessary intcasts 2021-03-15 14:04:04 +01:00
Oli Scherer
21a0c8e9e4 s/ConstantSource/ConstantKind/ 2021-03-15 12:06:52 +00:00
bjorn3
b1d14ca05d Use mmap for metadata loading
This can have a significant improvement on compilation times. In
addition it reduces the memory consumption.

Fixes #927
2021-03-15 11:59:06 +01:00
bjorn3
578fcdef5f Special case ZST's in Rvalue::Repeat
Fixes #1146 by preventing a hang for [(); usize::MAX], which is used in
a test of libcore.
2021-03-15 10:22:29 +01:00
Oli Scherer
6b1dd82162 Prepare mir::Constant for ty::Const only supporting valtrees 2021-03-12 12:43:54 +00:00
bors
1b1f6ea468 Auto merge of #76570 - cratelyn:implement-rfc-2945-c-unwind-abi, r=Amanieu
Implement RFC 2945: "C-unwind" ABI

## Implement RFC 2945: "C-unwind" ABI

This branch implements [RFC 2945]. The tracking issue for this RFC is #74990.

The feature gate for the issue is `#![feature(c_unwind)]`.

This RFC was created as part of the ffi-unwind project group tracked at rust-lang/lang-team#19.

### Changes

Further details will be provided in commit messages, but a high-level overview
of the changes follows:

* A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`,
and `Thiscall` variants, marking whether unwinding across FFI boundaries is
acceptable. The cases where each of these variants' `unwind` member is true
correspond with the `C-unwind`, `system-unwind`, `stdcall-unwind`, and
`thiscall-unwind` ABI strings introduced in RFC 2945 [3].

* This commit adds a `c_unwind` feature gate for the new ABI strings.
Tests for this feature gate are included in `src/test/ui/c-unwind/`, which
ensure that this feature gate works correctly for each of the new ABIs.
A new language features entry in the unstable book is added as well.

* We adjust the `rustc_middle::ty::layout::fn_can_unwind` function,
used to compute whether or not a `FnAbi` object represents a function that
should be able to unwind when `panic=unwind` is in use.

* Changes are also made to
`rustc_mir_build::build::should_abort_on_panic` so that the function ABI is
used to determind whether it should abort, assuming that the `panic=unwind`
strategy is being used, and no explicit unwind attribute was provided.

[RFC 2945]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
2021-03-10 16:44:04 +00:00
katelyn a. martin
95182bb2cc rustc_target: add "unwind" payloads to Abi
### Overview

    This commit begins the implementation work for RFC 2945. For more
    information, see the rendered RFC [1] and tracking issue [2].

    A boolean `unwind` payload is added to the `C`, `System`, `Stdcall`,
    and `Thiscall` variants, marking whether unwinding across FFI
    boundaries is acceptable. The cases where each of these variants'
    `unwind` member is true correspond with the `C-unwind`,
    `system-unwind`, `stdcall-unwind`, and `thiscall-unwind` ABI strings
    introduced in RFC 2945 [3].

 ### Feature Gate and Unstable Book

    This commit adds a `c_unwind` feature gate for the new ABI strings.
    Tests for this feature gate are included in `src/test/ui/c-unwind/`,
    which ensure that this feature gate works correctly for each of the
    new ABIs.

    A new language features entry in the unstable book is added as well.

 ### Further Work To Be Done

    This commit does not proceed to implement the new unwinding ABIs,
    and is intentionally scoped specifically to *defining* the ABIs and
    their feature flag.

 ### One Note on Test Churn

    This will lead to some test churn, in re-blessing hash tests, as the
    deleted comment in `src/librustc_target/spec/abi.rs` mentioned,
    because we can no longer guarantee the ordering of the `Abi`
    variants.

    While this is a downside, this decision was made bearing in mind
    that RFC 2945 states the following, in the "Other `unwind` Strings"
    section [3]:

    >  More unwind variants of existing ABI strings may be introduced,
    >  with the same semantics, without an additional RFC.

    Adding a new variant for each of these cases, rather than specifying
    a payload for a given ABI, would quickly become untenable, and make
    working with the `Abi` enum prone to mistakes.

    This approach encodes the unwinding information *into* a given ABI,
    to account for the future possibility of other `-unwind` ABI
    strings.

 ### Ignore Directives

    `ignore-*` directives are used in two of our `*-unwind` ABI test
    cases.

    Specifically, the `stdcall-unwind` and `thiscall-unwind` test cases
    ignore architectures that do not support `stdcall` and
    `thiscall`, respectively.

    These directives are cribbed from
    `src/test/ui/c-variadic/variadic-ffi-1.rs` for `stdcall`, and
    `src/test/ui/extern/extern-thiscall.rs` for `thiscall`.

    This would otherwise fail on some targets, see:
    fcf697f902

 ### Footnotes

[1]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md
[2]: https://github.com/rust-lang/rust/issues/74990
[3]: https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md#other-unwind-abi-strings
2021-03-09 14:38:29 -05:00
kadmin
d674d3dad8 Clean up todos
Also add some span_bugs where it is unreachable
2021-03-09 19:31:31 +00:00
kadmin
d30c497de6 Build StKind::CopyOverlapping
This replaces where it was previously being constructed in intrinsics, with direct construction
of the Statement.
2021-03-09 16:54:14 +00:00
kadmin
83e6251f21 Update cranelift 2021-03-09 16:54:14 +00:00
bjorn3
6b58ed225e Adjust for changed -Zmir-opt-level numbering 2021-03-09 16:45:55 +01:00
bjorn3
871874817b Lower GHA timeout to 60 min 2021-03-09 16:30:31 +01:00
bjorn3
eefe1ede82 Update config name for latest rust-analyzer 2021-03-09 12:52:43 +01:00
bjorn3
9adb139356 Add rustc_private=true to the package metadata for rust-analyzer 2021-03-09 12:46:04 +01:00
bjorn3
826189ef51 Some clippy fixes 2021-03-09 12:37:39 +01:00
bjorn3
8f62149d07 Rustup to rustc 1.52.0-nightly (8f349be27 2021-03-08) 2021-03-09 10:16:43 +01:00
bjorn3
6ef48e9cb4 Sync from rust 4b9f5cc4c1 2021-03-09 10:10:40 +01:00
bors
7f020206e8 Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
Test the effect of shrinking the size of Rvalue by 16 bytes

r? `@ghost`
2021-03-08 08:39:24 +00:00
bjorn3
341a4863fa Use the new component dependency option of the rust-toolchain file (take 2) 2021-03-07 17:47:56 +01:00
bjorn3
05339134de Add license section to the readme
Just in case
2021-03-06 19:26:11 +01:00
bjorn3
95e4db3e03 More doc fixes 2021-03-06 19:22:36 +01:00
bjorn3
be3aa0689e Revert "Use jemalloc"
This reverts commit d194c707c8.

It fails the bootstrap test as jemalloc_sys is not built
2021-03-06 19:21:30 +01:00
bjorn3
76bb1f173f Move the more advanced ways to use cg_clif to usage.md 2021-03-06 19:19:29 +01:00
bjorn3
d194c707c8 Use jemalloc 2021-03-06 19:06:15 +01:00
bjorn3
cecd7a9ae6 Add clif comments when in release mode
Fixes #1130
2021-03-06 18:45:04 +01:00
bjorn3
4ca3384db6 Make it possible to enable the verifier in release mode 2021-03-06 15:33:47 +01:00
bjorn3
bd1b1dd58e Handle #![windows_subsystem] 2021-03-06 14:58:29 +01:00
bjorn3
5f3d640d45 Fix warning 2021-03-06 14:49:55 +01:00
bjorn3
0985044c75 Use --print file-names instead of a match on uname 2021-03-06 14:46:38 +01:00
bjorn3
274a7ac4c4
Merge pull request #1145 from bjorn3/mingw_support
Support cross-compiling to Windows using MinGW
2021-03-05 23:03:06 +01:00
bjorn3
00f1cddb9c Test Windows cross-compilation on CI 2021-03-05 21:58:38 +01:00
bjorn3
d23b12fa62 Build all tests when cross-compiling 2021-03-05 21:32:49 +01:00