]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUse correct type in diagnostics again
Oliver Scherer [Thu, 24 Sep 2020 08:06:07 +0000 (10:06 +0200)]
Use correct type in diagnostics again

3 years agoDon't talk about determinism
Oliver Scherer [Thu, 24 Sep 2020 07:43:10 +0000 (09:43 +0200)]
Don't talk about determinism

3 years agoUpdate documentation tests
Oliver Scherer [Wed, 23 Sep 2020 16:55:27 +0000 (18:55 +0200)]
Update documentation tests

3 years agoMake sure we keep emitting a hard error
Oliver Scherer [Wed, 23 Sep 2020 16:36:53 +0000 (18:36 +0200)]
Make sure we keep emitting a hard error

3 years agoMake sure we report a future incompat error in all cases
Oliver Scherer [Wed, 23 Sep 2020 16:04:44 +0000 (18:04 +0200)]
Make sure we report a future incompat error in all cases

3 years agoName function correctly
Oliver Scherer [Wed, 23 Sep 2020 15:55:14 +0000 (17:55 +0200)]
Name function correctly

3 years agoMake sure we don't hide errors just because a lint has been emitted
Oliver Scherer [Wed, 23 Sep 2020 15:52:37 +0000 (17:52 +0200)]
Make sure we don't hide errors just because a lint has been emitted

3 years agoDeduplicate errors in const to pat conversion
Oliver Scherer [Wed, 23 Sep 2020 15:03:31 +0000 (17:03 +0200)]
Deduplicate errors in const to pat conversion

3 years agoTalk about unpredictable instead of "not deterministic"
Oliver Scherer [Wed, 23 Sep 2020 14:38:30 +0000 (16:38 +0200)]
Talk about unpredictable instead of "not deterministic"

3 years agoRemove the "lift constant to reference" logic
Oliver Scherer [Wed, 23 Sep 2020 14:28:45 +0000 (16:28 +0200)]
Remove the "lift constant to reference" logic

3 years agoPacify tidy
Oliver Scherer [Mon, 21 Sep 2020 14:38:29 +0000 (16:38 +0200)]
Pacify tidy

3 years agoDocument future incompat lints
Oliver Scherer [Mon, 21 Sep 2020 12:27:14 +0000 (14:27 +0200)]
Document future incompat lints

3 years agoUse precise errors during const to pat conversion instead of a catch-all on the main...
Oliver Scherer [Sun, 20 Sep 2020 15:22:33 +0000 (17:22 +0200)]
Use precise errors during const to pat conversion instead of a catch-all on the main constant

3 years agoLint on function pointers used in patterns
Oliver Scherer [Sun, 20 Sep 2020 15:11:00 +0000 (17:11 +0200)]
Lint on function pointers used in patterns

3 years agoSplit check for `PartialEq` impl into a method
Oliver Scherer [Sun, 20 Sep 2020 14:59:15 +0000 (16:59 +0200)]
Split check for `PartialEq` impl into a method

3 years agoImplement destructuring for all aggregates and for references
Oliver Scherer [Wed, 1 Jul 2020 13:10:51 +0000 (15:10 +0200)]
Implement destructuring for all aggregates and for references

3 years agoAdd a query for dereferencing constants of reference type
Oliver Scherer [Wed, 1 Jul 2020 09:41:38 +0000 (11:41 +0200)]
Add a query for dereferencing constants of reference type

3 years agoMerge tuple and struct pattern generation.
Oliver Scherer [Fri, 3 Apr 2020 13:22:37 +0000 (15:22 +0200)]
Merge tuple and struct pattern generation.

3 years agoAuto merge of #76411 - RalfJung:promote-in-const-fn, r=ecstatic-morse
bors [Sun, 20 Sep 2020 06:20:16 +0000 (06:20 +0000)]
Auto merge of #76411 - RalfJung:promote-in-const-fn, r=ecstatic-morse

Some promotion cleanup

Based on top of both https://github.com/rust-lang/rust/pull/75502 and https://github.com/rust-lang/rust/pull/75585, this does some cleanup of the promotion code. The last 2 commits are new.

* Remove the remaining cases where `const fn` is treated different from `fn`. This means no longer promoting ptr-to-int casts, raw ptr operations, and union field accesses in `const fn` -- or anywhere, for that matter. These are all unstable in const-context so this should not break any stable code. Fixes https://github.com/rust-lang/rust/issues/75586.
* ~~Promote references to statics even outside statics (i.e., in functions) for consistency.~~
* Promote `&mut []` everywhere, not just in non-`const` functions, for consistency.
* Explain why we do not promote deref's of statics outside statics. ~~(This is the only remaining direct user of `const_kind`.)~~

This can only land once the other two PRs land; I am mostly putting this up already because I couldn't wait ;) and to get some feedback from `@rust-lang/wg-const-eval` .

3 years agoAuto merge of #75346 - davidtwco:issue-69925-polymorphic-instancedef-fnptrshim, r...
bors [Sun, 20 Sep 2020 04:15:43 +0000 (04:15 +0000)]
Auto merge of #75346 - davidtwco:issue-69925-polymorphic-instancedef-fnptrshim, r=nikomatsakis

shim: monomorphic `FnPtrShim`s during construction

Fixes #69925.

This PR adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`).

r? `@eddyb`

3 years agoAuto merge of #72632 - jonas-schievink:dest-prop, r=oli-obk
bors [Sun, 20 Sep 2020 01:38:26 +0000 (01:38 +0000)]
Auto merge of #72632 - jonas-schievink:dest-prop, r=oli-obk

Implement a generic Destination Propagation optimization on MIR

This takes the work that was originally started by `@eddyb` in https://github.com/rust-lang/rust/pull/47954, and then explored by me in https://github.com/rust-lang/rust/pull/71003, and implements it in a general (ie. not limited to acyclic CFGs) and dataflow-driven way (so that no additional infrastructure in rustc is needed).

The pass is configured to run at `mir-opt-level=2` and higher only. To enable it by default, some followup work on it is still needed:
* Performance needs to be evaluated. I did some light optimization work and tested against `tuple-stress`, which caused trouble in my last attempt, but didn't go much in depth here.
  * We can also enable the pass only at `opt-level=2` and higher, if it is too slow to run in debug mode, but fine when optimizations run anyways.
* Debuginfo needs to be fixed after locals are merged. I did not look into what is required for this.
* Live ranges of locals (aka `StorageLive` and `StorageDead`) are currently deleted. We either need to decide that this is fine, or if not, merge the variable's live ranges (or remove these statements entirely – https://github.com/rust-lang/rust/issues/68622).

Some benchmarks of the pass were done in https://github.com/rust-lang/rust/pull/72635.

3 years agofix some comments
Ralf Jung [Wed, 9 Sep 2020 10:57:36 +0000 (12:57 +0200)]
fix some comments

3 years agonever promote non-const operations; revert STATIC promotion change
Ralf Jung [Wed, 9 Sep 2020 08:00:23 +0000 (10:00 +0200)]
never promote non-const operations; revert STATIC promotion change

3 years agofix doc comment
Ralf Jung [Mon, 7 Sep 2020 11:22:59 +0000 (13:22 +0200)]
fix doc comment

3 years agocleanup promotion const_kind checks
Ralf Jung [Sun, 6 Sep 2020 14:06:39 +0000 (16:06 +0200)]
cleanup promotion const_kind checks

in particular allow a few more promotions for consistency when they were already allowed in other contexts

3 years agoAuto merge of #76929 - ssomers:btree_cleanup_2, r=Mark-Simulacrum
bors [Sat, 19 Sep 2020 19:15:06 +0000 (19:15 +0000)]
Auto merge of #76929 - ssomers:btree_cleanup_2, r=Mark-Simulacrum

BTreeMap: wrap node's raw parent pointer in NonNull

Now that the other `*const` (root) is gone, seemed like a small step forward.

r? `@Mark-Simulacrum`

3 years agoBTreeMap: wrap node's raw parent pointer in NonNull
Stein Somers [Sat, 19 Sep 2020 14:47:03 +0000 (16:47 +0200)]
BTreeMap: wrap node's raw parent pointer in NonNull

3 years agoAuto merge of #76327 - lzutao:split-core-num, r=SimonSapin
bors [Sat, 19 Sep 2020 16:13:26 +0000 (16:13 +0000)]
Auto merge of #76327 - lzutao:split-core-num, r=SimonSapin

Split `core/num/mod.rs` to smaller mods

Note for reviewer:
* I split to multiple commits for easier reviewing, but I could git squash them all to one if requested.
* Recommend pulling this change locally and using advanced git diff viewer or this command:
  ```
  git show --reverse --color-moved=dimmed-zebra master..
  ```

---

I split `core/num/mod.rs` to these modules:

* `error`: For error structs like `ParseIntError`.
* blanket `shells` dir: For dummy number type modules: std::i32, std::f32, and the likes. Why? See below.
* `int_macros` and `uint_macros`: Real implementation of all integer types via `int_impl` and `uint_impl`
* `nonzero`: For `NonZero*` types and their implementations.
* `wrapping`: For `Wrapping<T>` types.

3 years agoRemove outdated ignored tidy comment
Lzu Tao [Fri, 4 Sep 2020 15:31:23 +0000 (15:31 +0000)]
Remove outdated ignored tidy comment

3 years agoMove (u)int_impl macros to their own files
Lzu Tao [Fri, 4 Sep 2020 14:20:01 +0000 (14:20 +0000)]
Move (u)int_impl macros to their own files

3 years agoMove dummy integer modules (like core::u32) to shells dir
Lzu Tao [Fri, 4 Sep 2020 14:00:38 +0000 (14:00 +0000)]
Move dummy integer modules (like core::u32) to shells dir

3 years agoMove error structs to new mod
Lzu Tao [Fri, 4 Sep 2020 13:37:15 +0000 (13:37 +0000)]
Move error structs to new mod

3 years agoMove Wrapping<T> definition to wrapping mod
Lzu Tao [Fri, 4 Sep 2020 13:14:39 +0000 (13:14 +0000)]
Move Wrapping<T> definition to wrapping mod

3 years agoMove NonZero* to its file
Lzu Tao [Fri, 4 Sep 2020 13:07:03 +0000 (13:07 +0000)]
Move NonZero* to its file

3 years agoAuto merge of #76880 - shepmaster:cc-rs, r=Mark-Simulacrum
bors [Sat, 19 Sep 2020 13:31:23 +0000 (13:31 +0000)]
Auto merge of #76880 - shepmaster:cc-rs, r=Mark-Simulacrum

Update cc crate to 1.0.60 to understand aarch64-apple-darwin with clang

r? `@Mark-Simulacrum`

/cc `@alexcrichton`

3 years agoAuto merge of #76912 - RalfJung:rollup-q9ur56h, r=RalfJung
bors [Sat, 19 Sep 2020 11:29:00 +0000 (11:29 +0000)]
Auto merge of #76912 - RalfJung:rollup-q9ur56h, r=RalfJung

Rollup of 14 pull requests

Successful merges:

 - #73963 (deny(unsafe_op_in_unsafe_fn) in libstd/path.rs)
 - #75099 (lint/ty: move fns to avoid abstraction violation)
 - #75502 (Use implicit (not explicit) rules for promotability by default in `const fn`)
 - #75580 (Add test for checking duplicated branch or-patterns)
 - #76310 (Add `[T; N]: TryFrom<Vec<T>>` (insta-stable))
 - #76400 (Clean up vec benches bench_in_place style)
 - #76434 (do not inline black_box when building for Miri)
 - #76492 (Add associated constant `BITS` to all integer types)
 - #76525 (Add as_str() to string::Drain.)
 - #76636 (assert ScalarMaybeUninit size)
 - #76749 (give *even better* suggestion when matching a const range)
 - #76757 (don't convert types to the same type with try_into (clippy::useless_conversion))
 - #76796 (Give a better error message when x.py uses the wrong stage for CI)
 - #76798 (Build fixes for RISC-V 32-bit Linux support)

Failed merges:

r? `@ghost`

3 years agoRollup merge of #76798 - alistair23:alistair/rv32-linux, r=jyn514
Ralf Jung [Sat, 19 Sep 2020 09:47:56 +0000 (11:47 +0200)]
Rollup merge of #76798 - alistair23:alistair/rv32-linux, r=jyn514

Build fixes for RISC-V 32-bit Linux support

This fixes build issues with the 32-bit RISC-V port.

3 years agoRollup merge of #76796 - jyn514:wrong-stage, r=shepmaster
Ralf Jung [Sat, 19 Sep 2020 09:47:54 +0000 (11:47 +0200)]
Rollup merge of #76796 - jyn514:wrong-stage, r=shepmaster

Give a better error message when x.py uses the wrong stage for CI

r? @shepmaster

3 years agoRollup merge of #76757 - matthiaskrgr:clippy_try_into, r=lcnr
Ralf Jung [Sat, 19 Sep 2020 09:47:52 +0000 (11:47 +0200)]
Rollup merge of #76757 - matthiaskrgr:clippy_try_into, r=lcnr

don't convert types to the same type with try_into (clippy::useless_conversion)

3 years agoRollup merge of #76749 - guswynn:hir_ranges, r=estebank
Ralf Jung [Sat, 19 Sep 2020 09:47:50 +0000 (11:47 +0200)]
Rollup merge of #76749 - guswynn:hir_ranges, r=estebank

give *even better* suggestion when matching a const range

notice that the err already has "constant defined here"
so this is now *exceedingly clear*

extension to #76222

r? @estebank

3 years agoRollup merge of #76636 - RalfJung:miri-size-assert, r=oli-obk
Ralf Jung [Sat, 19 Sep 2020 09:47:49 +0000 (11:47 +0200)]
Rollup merge of #76636 - RalfJung:miri-size-assert, r=oli-obk

assert ScalarMaybeUninit size

I noticed most low-level Miri types have such an assert but `ScalarMaybeUninit` does not, so let's add that. Good t see that the `Option`-like optimization kicks in and this is no bigger than `Scalar`. :)

r? @oli-obk

3 years agoRollup merge of #76525 - fusion-engineering-forks:string-drain, r=dtolnay
Ralf Jung [Sat, 19 Sep 2020 09:47:47 +0000 (11:47 +0200)]
Rollup merge of #76525 - fusion-engineering-forks:string-drain, r=dtolnay

Add as_str() to string::Drain.

Vec's Drain recently [had its `.as_slice()` stabilized](https://github.com/rust-lang/rust/pull/72584), but String's Drain was still missing the analogous `.as_str()`. This adds that.

Also improves the Debug implementation, which now shows the remaining data instead of just `"Drain { .. }"`.

3 years agoRollup merge of #76492 - fusion-engineering-forks:int-bits, r=dtolnay
Ralf Jung [Sat, 19 Sep 2020 09:47:45 +0000 (11:47 +0200)]
Rollup merge of #76492 - fusion-engineering-forks:int-bits, r=dtolnay

Add associated constant `BITS` to all integer types

Recently I've regularly come across this snippet (in a few different crates, including `core` and `std`):
```rust
std::mem::size_of<usize>() * 8
```

I think it's time for a `usize::BITS`.

3 years agoRollup merge of #76434 - RalfJung:black-box, r=Mark-Simulacrum
Ralf Jung [Sat, 19 Sep 2020 09:47:43 +0000 (11:47 +0200)]
Rollup merge of #76434 - RalfJung:black-box, r=Mark-Simulacrum

do not inline black_box when building for Miri

We cannot do the assembly trick in Miri, but let's at least make sure MIR inlining does not circumvent the black_box.

Also use black_box instead of local optimization barriers in a few const tests.

3 years agoRollup merge of #76400 - pickfire:patch-5, r=dtolnay
Ralf Jung [Sat, 19 Sep 2020 09:47:41 +0000 (11:47 +0200)]
Rollup merge of #76400 - pickfire:patch-5, r=dtolnay

Clean up vec benches bench_in_place style

3 years agoRollup merge of #76310 - scottmcm:array-try_from-vec, r=dtolnay
Ralf Jung [Sat, 19 Sep 2020 09:47:39 +0000 (11:47 +0200)]
Rollup merge of #76310 - scottmcm:array-try_from-vec, r=dtolnay

Add `[T; N]: TryFrom<Vec<T>>` (insta-stable)

This is very similar to the [existing](https://doc.rust-lang.org/nightly/std/convert/trait.TryFrom.html#impl-TryFrom%3CBox%3C%5BT%5D%3E%3E) `Box<[T; N]>: TryFrom<Box<[T]>>`, but allows avoiding the `shrink_to_fit` if you have a vector and not a boxed slice.

Like the slice equivalents of this, it fails if the length of the vector is not exactly `N`.
This uses `Vec<T>` as the `Error` type to return the input, like how the `Rc<[T]> -> Rc<[T; N]>` (and Arc) ones also reflect the input directly in the error type.

```rust
#[stable(feature = "array_try_from_vec", since = "1.47.0")]
impl<T, const N: usize> TryFrom<Vec<T>> for [T; N] {
    type Error = Vec<T>;
    fn try_from(mut vec: Vec<T>) -> Result<[T; N], Vec<T>>;
}
```

Inspired by this zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/APIs.20for.20getting.20stuff.20from.20a.20Vec.20by.20owned/near/209048103

3 years agoRollup merge of #75580 - JulianKnodt:or_pattern, r=wesleywiser
Ralf Jung [Sat, 19 Sep 2020 09:47:37 +0000 (11:47 +0200)]
Rollup merge of #75580 - JulianKnodt:or_pattern, r=wesleywiser

Add test for checking duplicated branch or-patterns

This adds a regression test for checking `or-patterns` in MIR as shown in #75439.
This doesn't introduce a fix as I'm not sure where it would go(I suspect maybe here: src/librustc_mir_build/build/matches/mod.rs), and I'm not particularly able to fix it.

cc: @lzutao

3 years agoRollup merge of #75502 - ecstatic-morse:implicit-promotion-in-const-fn, r=RalfJung
Ralf Jung [Sat, 19 Sep 2020 09:47:35 +0000 (11:47 +0200)]
Rollup merge of #75502 - ecstatic-morse:implicit-promotion-in-const-fn, r=RalfJung

Use implicit (not explicit) rules for promotability by default in `const fn`

For crater run. See https://github.com/rust-lang/const-eval/pull/54#discussion_r469995552.

cc #75586

3 years agoRollup merge of #75099 - davidtwco:is-zst-abstraction-violation, r=eddyb
Ralf Jung [Sat, 19 Sep 2020 09:47:34 +0000 (11:47 +0200)]
Rollup merge of #75099 - davidtwco:is-zst-abstraction-violation, r=eddyb

lint/ty: move fns to avoid abstraction violation

This PR moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types, hopefully addressing @eddyb's concern [from this comment](https://github.com/rust-lang/rust/pull/74340#discussion_r456534910).

3 years agoRollup merge of #73963 - hellow554:unsafe_path, r=Mark-Simulacrum
Ralf Jung [Sat, 19 Sep 2020 09:47:31 +0000 (11:47 +0200)]
Rollup merge of #73963 - hellow554:unsafe_path, r=Mark-Simulacrum

deny(unsafe_op_in_unsafe_fn) in libstd/path.rs

The libstd/path.rs part of #73904 . Wraps the two calls to an unsafe fn Initializer::nop() in an unsafe block.

3 years agoAuto merge of #76886 - Aaron1011:fix/ensure-stack-predicate, r=Mark-Simulacrum
bors [Sat, 19 Sep 2020 09:21:22 +0000 (09:21 +0000)]
Auto merge of #76886 - Aaron1011:fix/ensure-stack-predicate, r=Mark-Simulacrum

Wrap recursive predicate evaluation with `ensure_sufficient_stack`

I haven't been able to come up with a minimized test case for #76770,
but this fixes a stack overflow in rustc as well.

3 years agoAuto merge of #76879 - shepmaster:zlib-sys, r=Mark-Simulacrum
bors [Sat, 19 Sep 2020 06:28:37 +0000 (06:28 +0000)]
Auto merge of #76879 - shepmaster:zlib-sys, r=Mark-Simulacrum

Upgrade libz-sys to 1.1.2

The current version has warnings that become errors on new versions of clang shipped in XCode:

```
warning: src/zlib/gzlib.c:214:15: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
warning:         (void)snprintf(state->path, len + 1, "%s", (const char *)path);
warning:               ^
warning: src/zlib/gzlib.c:214:15: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
warning: 1 error generated.

warning: src/zlib/gzwrite.c:428:11: error: implicitly declaring library function 'vsnprintf' with type 'int (char *, unsigned long, const char *, __builtin_va_list)' [-Werror,-Wimplicit-function-declaration
warning:     len = vsnprintf(next, state->size, format, va);
warning:           ^
warning: src/zlib/gzwrite.c:428:11: note: include the header <stdio.h> or explicitly provide a declaration for 'vsnprintf'
warning: 1 error generated.
```

r? `@Mark-Simulacrum`

/cc `@joshtriplett`

3 years agoAdd tracking issue number for string_drain_as_str.
Mara Bos [Sat, 19 Sep 2020 06:23:23 +0000 (08:23 +0200)]
Add tracking issue number for string_drain_as_str.

3 years agoAdd tracking issue number for int_bits_const.
Mara Bos [Sat, 19 Sep 2020 06:14:41 +0000 (08:14 +0200)]
Add tracking issue number for int_bits_const.

3 years agoUse `T::BITS` instead of `size_of::<T> * 8`.
Mara Bos [Tue, 8 Sep 2020 19:39:13 +0000 (21:39 +0200)]
Use `T::BITS` instead of `size_of::<T> * 8`.

3 years agoAdd example/test to <int types>::BITS.
Mara Bos [Tue, 8 Sep 2020 18:24:55 +0000 (20:24 +0200)]
Add example/test to <int types>::BITS.

3 years agoAdd `BITS` associated constant to all integer types.
Mara Bos [Tue, 8 Sep 2020 18:17:23 +0000 (20:17 +0200)]
Add `BITS` associated constant to all integer types.

3 years agoAuto merge of #76856 - jonas-schievink:dist-rustc-src, r=Mark-Simulacrum
bors [Sat, 19 Sep 2020 04:21:11 +0000 (04:21 +0000)]
Auto merge of #76856 - jonas-schievink:dist-rustc-src, r=Mark-Simulacrum

Distribute rustc sources as part of `rustc-dev`

They can be used to provide IDE features when working on rustc plugins/backends/etc without having to locate a separate Rust checkout.

r? `@Mark-Simulacrum`

3 years agoAuto merge of #76838 - est31:dogfood_uninit_features, r=oli-obk
bors [Sat, 19 Sep 2020 02:21:19 +0000 (02:21 +0000)]
Auto merge of #76838 - est31:dogfood_uninit_features, r=oli-obk

Dogfood new_uninit and maybe_uninit_slice in rustc_arena

Dogfoods a few cool `MaybeUninit` related features in the compiler's rustc_arena crate.

Split off from #76821

r? `@oli-obk`

3 years agoAuto merge of #76787 - lzutao:slice_iters_new, r=lcnr
bors [Fri, 18 Sep 2020 23:38:17 +0000 (23:38 +0000)]
Auto merge of #76787 - lzutao:slice_iters_new, r=lcnr

Using <Iter>::new instead of exposing internal fields

As requested in https://github.com/rust-lang/rust/pull/76311#discussion_r487685126

3 years agoAuto merge of #76782 - lzutao:rd-cap, r=jyn514
bors [Fri, 18 Sep 2020 21:31:08 +0000 (21:31 +0000)]
Auto merge of #76782 - lzutao:rd-cap, r=jyn514

Specialize merge_attrs in good case

Just a non-important micro-optimization.
r? `@jyn514`

3 years agoClarify FIXME
Jonas Schievink [Thu, 17 Sep 2020 20:19:24 +0000 (22:19 +0200)]
Clarify FIXME

3 years agoReturn `Place` by value
Jonas Schievink [Thu, 17 Sep 2020 20:17:09 +0000 (22:17 +0200)]
Return `Place` by value

3 years agoMove inner items outside
Jonas Schievink [Sat, 12 Sep 2020 18:36:29 +0000 (20:36 +0200)]
Move inner items outside

3 years agoFix rebase fallout
Jonas Schievink [Sat, 12 Sep 2020 13:18:50 +0000 (15:18 +0200)]
Fix rebase fallout

3 years agoLimit block count
Jonas Schievink [Wed, 24 Jun 2020 20:55:12 +0000 (22:55 +0200)]
Limit block count

3 years agoFix rebase fallout
Jonas Schievink [Wed, 24 Jun 2020 00:47:16 +0000 (02:47 +0200)]
Fix rebase fallout

3 years agoProperly inherit conflicts when merging locals
Jonas Schievink [Wed, 24 Jun 2020 00:23:53 +0000 (02:23 +0200)]
Properly inherit conflicts when merging locals

3 years agoMore logging
Jonas Schievink [Mon, 22 Jun 2020 23:25:52 +0000 (01:25 +0200)]
More logging

3 years agoRecord intra-statement/terminator conflicts
Jonas Schievink [Sat, 12 Sep 2020 13:15:05 +0000 (15:15 +0200)]
Record intra-statement/terminator conflicts

Some MIR statements and terminators have an (undocumented...) invariant
that some of their input and outputs must not overlap. This records
conflicts between locals used in these positions.

3 years agoperf: bail out when there's >500 candidate locals
Jonas Schievink [Tue, 26 May 2020 19:39:24 +0000 (21:39 +0200)]
perf: bail out when there's >500 candidate locals

3 years agoperf: only calculate conflicts for candidates
Jonas Schievink [Tue, 26 May 2020 20:21:10 +0000 (22:21 +0200)]
perf: only calculate conflicts for candidates

3 years agoFix dest-prop mir-opt tests
Jonas Schievink [Sat, 12 Sep 2020 13:10:51 +0000 (15:10 +0200)]
Fix dest-prop mir-opt tests

3 years agoperf: walk liveness backwards in Conflicts::build
Jonas Schievink [Sat, 12 Sep 2020 13:10:38 +0000 (15:10 +0200)]
perf: walk liveness backwards in Conflicts::build

3 years agoAdd a few dest-prop MIR tests
Jonas Schievink [Sun, 24 May 2020 19:37:09 +0000 (21:37 +0200)]
Add a few dest-prop MIR tests

3 years agoFix dataflow assert errors
Jonas Schievink [Sat, 12 Sep 2020 12:58:52 +0000 (14:58 +0200)]
Fix dataflow assert errors

3 years agoBless mir-opt tests
Jonas Schievink [Sat, 12 Sep 2020 12:58:46 +0000 (14:58 +0200)]
Bless mir-opt tests

3 years agoMake nrvo-simple set mir-opt-level=1
Jonas Schievink [Mon, 25 May 2020 21:37:10 +0000 (23:37 +0200)]
Make nrvo-simple set mir-opt-level=1

The additional copies are due to the lack of copy propagation

3 years agosimplify_try: clean up test
Jonas Schievink [Mon, 25 May 2020 21:22:47 +0000 (23:22 +0200)]
simplify_try: clean up test

3 years agosimplify_try: print dest_prop diff and bless
Jonas Schievink [Mon, 25 May 2020 21:22:19 +0000 (23:22 +0200)]
simplify_try: print dest_prop diff and bless

The new diff is to convince me that this is correct and nothing funky
is going on.

3 years agoImplement a destination propagation pass
Jonas Schievink [Sun, 24 May 2020 16:22:04 +0000 (18:22 +0200)]
Implement a destination propagation pass

3 years agoAuto merge of #76884 - Mark-Simulacrum:fix-macos-ci, r=pietroalbini
bors [Fri, 18 Sep 2020 19:13:02 +0000 (19:13 +0000)]
Auto merge of #76884 - Mark-Simulacrum:fix-macos-ci, r=pietroalbini

Add host triples to target lists

This PR is primarily intended to fix https://github.com/rust-lang/rustup/issues/2494, which is the second commit. That bug was introduced by #76415, and incompletely fixed by #76639. (#76639 added host triples, which gave us compilers, but missed that we also need documentation and other target-only things). However, it also removes duplicate macOS CI builders.

r? `@pietroalbini`

3 years agoAuto merge of #76575 - lcnr:abstract-const, r=oli-obk
bors [Fri, 18 Sep 2020 16:59:50 +0000 (16:59 +0000)]
Auto merge of #76575 - lcnr:abstract-const, r=oli-obk

compare generic constants using `AbstractConst`s

This is a MVP of rust-lang/compiler-team#340. The changes in this PR should only be relevant if `feature(const_evaluatable_checked)` is enabled.

~~currently based on top of #76559, so blocked on that.~~

r? `@oli-obk` cc `@varkor` `@eddyb`

3 years agoWrap recursive predicate evaluation with `ensure_sufficient_stack`
Aaron Hill [Fri, 18 Sep 2020 15:09:00 +0000 (11:09 -0400)]
Wrap recursive predicate evaluation with `ensure_sufficient_stack`

I haven't been able to come up with a minimized test case for #76770,
but this fixes a stack overflow in rustc as well.

3 years agoMake sure we build target-only things (e.g., docs) for host platforms too
Mark Rousskov [Fri, 18 Sep 2020 15:56:41 +0000 (11:56 -0400)]
Make sure we build target-only things (e.g., docs) for host platforms too

3 years agoRemove duplicate macOS builders
Mark Rousskov [Fri, 18 Sep 2020 15:54:00 +0000 (11:54 -0400)]
Remove duplicate macOS builders

3 years agoadd `const-evaluatable_checked` check back in
Bastian Kauschke [Fri, 18 Sep 2020 15:36:11 +0000 (17:36 +0200)]
add `const-evaluatable_checked` check back in

3 years agoreview, small cleanup
Bastian Kauschke [Fri, 18 Sep 2020 15:11:17 +0000 (17:11 +0200)]
review, small cleanup

3 years agodocument `const_evaluatable`
Bastian Kauschke [Fri, 11 Sep 2020 19:50:17 +0000 (21:50 +0200)]
document `const_evaluatable`

3 years agoremove allow(warnings)
Bastian Kauschke [Fri, 11 Sep 2020 19:19:15 +0000 (21:19 +0200)]
remove allow(warnings)

3 years agosupport const_evaluatable_checked across crate boundaries
Bastian Kauschke [Fri, 11 Sep 2020 19:16:16 +0000 (21:16 +0200)]
support const_evaluatable_checked across crate boundaries

3 years agoadd test for let-bindings
Bastian Kauschke [Fri, 11 Sep 2020 08:46:35 +0000 (10:46 +0200)]
add test for let-bindings

3 years agoadd function calls
Bastian Kauschke [Fri, 11 Sep 2020 08:35:28 +0000 (10:35 +0200)]
add function calls

3 years agoallow unary operations and ignore StorageLive/Dead stmts
Bastian Kauschke [Fri, 11 Sep 2020 08:00:06 +0000 (10:00 +0200)]
allow unary operations and ignore StorageLive/Dead stmts

3 years agouse newtype_index for abstract_const::NodeId
Bastian Kauschke [Fri, 11 Sep 2020 07:18:54 +0000 (09:18 +0200)]
use newtype_index for abstract_const::NodeId

3 years agorefactor AbstractConstBuilder
Bastian Kauschke [Fri, 11 Sep 2020 07:00:21 +0000 (09:00 +0200)]
refactor AbstractConstBuilder

3 years agouse abstract consts when unifying ConstKind::Unevaluated
Bastian Kauschke [Thu, 10 Sep 2020 16:48:18 +0000 (18:48 +0200)]
use abstract consts when unifying ConstKind::Unevaluated

3 years agoinitial working state
Bastian Kauschke [Thu, 10 Sep 2020 07:06:30 +0000 (09:06 +0200)]
initial working state

3 years agoAuto merge of #72412 - VFLashM:issue-72408-nested-closures-exponential, r=tmandry
bors [Fri, 18 Sep 2020 14:08:39 +0000 (14:08 +0000)]
Auto merge of #72412 - VFLashM:issue-72408-nested-closures-exponential, r=tmandry

Issue 72408 nested closures exponential

This fixes #72408.

Nested closures were resulting in exponential compilation time.

This PR is enhancing asymptotic complexity, but also increasing the constant, so I would love to see perf run results.

3 years agoUpdate cc crate to understand aarch64-apple-darwin with clang
Jake Goulding [Wed, 16 Sep 2020 17:09:25 +0000 (13:09 -0400)]
Update cc crate to understand aarch64-apple-darwin with clang