2934 Commits

Author SHA1 Message Date
bjorn3
241eae76e2 Monomorphize ConstantKind::Unevaluated in mir_operand_get_const_val 2022-09-25 14:44:51 +02:00
bjorn3
5ed4377677 Fix ConstantKind::Ty codegen 2022-09-25 14:35:21 +02:00
bjorn3
b3d3ba9928 Rustup to rustc 1.66.0-nightly (3f83906b3 2022-09-24) 2022-09-25 14:11:30 +02:00
bjorn3
385003e4c1 Sync from rust 8e9c93df464b7ada3fc7a1c8ccddd9dcb24ee0a0 2022-09-25 13:55:23 +02:00
b-naber
7e250da20f rename Unevaluated to UnevaluatedConst 2022-09-23 14:27:34 +02:00
b-naber
3c5882018f introduce mir::Unevaluated 2022-09-22 12:35:28 +02:00
bors
6eeefe2ce6 Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebank
Allow patterns to constrain the hidden type of opaque types

fixes #96572

reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864)

TODO:

* check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-20 12:09:52 +00:00
bors
6214e085ed Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnr
Use only ty::Unevaluated<'tcx, ()> in type system

r? `@lcnr`
2022-09-17 03:04:22 +00:00
Oli Scherer
93af5f5999 Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank""
This reverts commit 4a742a691e7dd2522bad68b86fe2fd5a199d5561.
2022-09-16 11:36:39 +00:00
b-naber
d7c77313cb nits 2022-09-15 22:27:41 +02:00
bjorn3
d82b696594 Update for latests rustc test suite changes 2022-09-15 16:14:29 +00:00
bjorn3
b023e2f7d0 Fix bundled static libraries 2022-09-15 16:05:27 +00:00
bjorn3
879c86ff30 Implement dyn* support 2022-09-15 14:08:30 +00:00
bjorn3
f68742a03c Rustup to rustc 1.65.0-nightly (750bd1a7f 2022-09-14) 2022-09-15 14:59:14 +02:00
bjorn3
75d24552aa Sync from rust 00fcc82df204ab81cd887da7d04c023a201afd5b 2022-09-15 14:53:37 +02:00
bors
e4d2f94a83 Auto merge of #101212 - eholk:dyn-star, r=compiler-errors
Initial implementation of dyn*

This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things:

* Introduce `dyn_star` feature flag
* Adds parsing for `dyn* Trait` types
* Defines `dyn* Trait` as a sized type
* Adds support for explicit casts, like `42usize as dyn* Debug`
  * Including const evaluation of such casts
* Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope
* Adds codegen for method calls, at least for methods that take `&self`

Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits.

Joint work with `@nikomatsakis` and `@compiler-errors.`

r? `@bjorn3`
2022-09-14 18:10:51 +00:00
b-naber
a10dd1f340 address review again 2022-09-14 17:30:25 +02:00
Eric Holk
6d544a8a4c Address code review comments 2022-09-13 14:50:12 -07:00
b-naber
fa35afe8dc cranelift changes 2022-09-13 17:44:49 +02:00
b-naber
da373e3ea8 use ty::Unevaluated<'tcx, ()> in type system 2022-09-13 17:40:59 +02:00
bors
11c831d696 Auto merge of #99556 - davidtwco:collapse-debuginfo, r=wesleywiser
ssa: implement `#[collapse_debuginfo]`

cc #39153 rust-lang/compiler-team#386

Debuginfo line information for macro invocations are collapsed by default - line information are replaced by the line of the outermost expansion site. Using `-Zdebug-macros` disables this behaviour.

When the `collapse_debuginfo` feature is enabled, the default behaviour is reversed so that debuginfo is not collapsed by default. In addition, the `#[collapse_debuginfo]` attribute is available and can be applied to macro definitions which will then have their line information collapsed.

r? rust-lang/wg-debugging
2022-09-13 01:19:05 +00:00
Eric Holk
0221923952 Make x.py check work 2022-09-12 17:29:11 -07:00
bjorn3
107f9d8813
Merge pull request #1279 from bjorn3/build_system_rework
Some refactorings for the build system
2022-09-12 13:12:59 +02:00
bjorn3
a65c881aa3 Introduce hyperfine_command helper 2022-09-12 10:35:38 +00:00
bjorn3
be305c2b1f Introduce cargo_command helper 2022-09-12 10:35:38 +00:00
bjorn3
c677cba06b More uniform imports 2022-09-12 10:35:38 +00:00
bjorn3
721668f133 Tiny cleanup 2022-09-12 10:35:38 +00:00
bjorn3
b12286fec3 Let abi-checker take the full path to the cg_clif dylib 2022-09-12 10:35:38 +00:00
bjorn3
917be273ab Minor improvement to apply_patches 2022-09-12 10:35:38 +00:00
bjorn3
87bbc2d413 Rustup to rustc 1.65.0-nightly (59e7a308e 2022-09-11) 2022-09-12 12:28:14 +02:00
bjorn3
3afa1d6f32 Sync from rust 56e7678ca97e9740f7d09206f767d5bb676917f7 2022-09-12 11:47:11 +02:00
bors
16ed191362 Auto merge of #101483 - oli-obk:guaranteed_opt, r=fee1-dead
The `<*const T>::guaranteed_*` methods now return an option for the unknown case

cc https://github.com/rust-lang/rust/issues/53020#issuecomment-1236932443

I chose `0` for "not equal" and `1` for "equal" and left `2` for the unknown case so backends can just forward to raw pointer equality and it works 

r? `@fee1-dead` or `@lcnr`

cc `@rust-lang/wg-const-eval`
2022-09-10 09:50:21 +00:00
Oli Scherer
931c07c94f The <*const T>::guaranteed_* methods now return an option for the unknown case 2022-09-09 15:16:04 +00:00
bjorn3
fa7660440b
Merge pull request #1277 from bjorn3/simd_improvements
Implement a couple of portable simd intrinsics
2022-09-09 09:11:41 +02:00
Michael Benfield
944a142bfa Change name of "dataful" variant to "untagged"
This is in anticipation of a new enum layout, in which the niche
optimization may be applied even when multiple variants have data.
2022-09-07 20:12:45 +00:00
David Wood
1cf9be98cd ssa: implement #[collapse_debuginfo]
Debuginfo line information for macro invocations are collapsed by
default - line information are replaced by the line of the outermost
expansion site. Using `-Zdebug-macros` disables this behaviour.

When the `collapse_debuginfo` feature is enabled, the default behaviour
is reversed so that debuginfo is not collapsed by default. In addition,
the `#[collapse_debuginfo]` attribute is available and can be applied to
macro definitions which will then have their line information collapsed.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-07 13:54:51 +01:00
Oli Scherer
104168a0f8 Generalize the Assume intrinsic statement to a general Intrinsic statement 2022-09-06 14:18:32 +00:00
Oli Scherer
088e03fe22 Lower the assume intrinsic to a MIR statement 2022-09-06 14:18:32 +00:00
bjorn3
13fcf47600 Implement simd_select_bitmask 2022-09-05 16:37:22 +00:00
bjorn3
782b5fe7ac Implement simd_saturating_{add,sub} 2022-09-05 16:13:36 +00:00
bjorn3
0980596271 Extract codegen_saturating_int_binop function 2022-09-05 16:13:08 +00:00
bjorn3
f200fbca10 Implement simd_bitmask 2022-09-05 15:38:03 +00:00
bjorn3
0bb9bdf8e3 Use value_lane instead of value_field in simd/llvm.rs 2022-09-05 15:31:14 +00:00
bjorn3
c4c393c78e Update portable-simd 2022-09-05 12:01:37 +00:00
bjorn3
7f260a953b Rustup to rustc 1.65.0-nightly (84f0c3f79 2022-09-03) 2022-09-04 13:35:58 +02:00
bjorn3
b80970f27f Sync from rust 8521a8c92da6c0c845d4f6394e903651a227946a 2022-09-04 13:24:20 +02:00
bors
b8169a6da0 Auto merge of #97802 - Enselic:add-no_ignore_sigkill-feature, r=joshtriplett
Support `#[unix_sigpipe = "inherit|sig_dfl"]` on `fn main()` to prevent ignoring `SIGPIPE`

When enabled, programs don't have to explicitly handle `ErrorKind::BrokenPipe` any longer. Currently, the program

```rust
fn main() { loop { println!("hello world"); } }
```

will print an error if used with a short-lived pipe, e.g.

    % ./main | head -n 1
    hello world
    thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1016:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

by enabling `#[unix_sigpipe = "sig_dfl"]` like this

```rust
#![feature(unix_sigpipe)]
#[unix_sigpipe = "sig_dfl"]
fn main() { loop { println!("hello world"); } }
```

there is no error, because `SIGPIPE` will not be ignored and thus the program will be killed appropriately:

    % ./main | head -n 1
    hello world

The current libstd behaviour of ignoring `SIGPIPE` before `fn main()` can be explicitly requested by using `#[unix_sigpipe = "sig_ign"]`.

With `#[unix_sigpipe = "inherit"]`, no change at all is made to `SIGPIPE`, which typically means the behaviour will be the same as `#[unix_sigpipe = "sig_dfl"]`.

See https://github.com/rust-lang/rust/issues/62569 and referenced issues for discussions regarding the `SIGPIPE` problem itself

See the [this](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Proposal.3A.20First.20step.20towards.20solving.20the.20SIGPIPE.20problem) Zulip topic for more discussions, including about this PR.

Tracking issue: https://github.com/rust-lang/rust/issues/97889
2022-09-02 21:08:08 +00:00
bjorn3
9054e66703 Fix panic in ConcurrencyLimiter when unwinding
Fixes #1275
2022-09-02 09:34:41 +00:00
bjorn3
244455d8e3 Apply sysroot patches to rustc bootstrap and rustc test suite tests
This is necessary on AArch64 as 128bit atomics aren't yet supported by
Cranelift.
2022-09-01 16:41:01 +00:00
bjorn3
de7342b444 Implement core::hint::spin_loop() on AArch64
This is used in the futex based mutex implementation of libstd
2022-09-01 16:18:39 +00:00