Commit graph

127779 commits

Author SHA1 Message Date
bors
fd702d2919 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.
2020-09-19 09:21:22 +00:00
Oliver Scherer
b8e6883a2f Reflect the "do not call this query directly" mentality in its name 2020-09-19 10:57:14 +02:00
Oliver Scherer
c5889e4dab Update incremental tests 2020-09-19 10:36:37 +02:00
Oliver Scherer
ef04e68462 Update compile-fail tests 2020-09-19 10:36:37 +02:00
Oliver Scherer
c3c8c981a8 Rustfmt 2020-09-19 10:36:36 +02:00
Oliver Scherer
182ed8544d Address review comments 2020-09-19 10:36:36 +02:00
Oliver Scherer
90708c15c4 Fix rebase fallout and make the test work with debug info 2020-09-19 10:36:36 +02:00
Oliver Scherer
888afd50d9 Unify the names of const eval queries and their return types 2020-09-19 10:36:36 +02:00
Oliver Scherer
69a6be73e6 Rename const eval queries to reflect the validation changes 2020-09-19 10:36:36 +02:00
Oliver Scherer
40c2087eb5 We can make const eval sound, it's just super expensive 2020-09-19 10:36:36 +02:00
Oliver Scherer
dd9702a059 Do not call the const_eval query in mir interpretation except for caching of nulary intrinsics 2020-09-19 10:36:36 +02:00
Oliver Scherer
a6c60bbe5d Clarify a statement in UB test 2020-09-19 10:36:36 +02:00
Oliver Scherer
48f366fced Replace and_then map_err and_then chain with a match 2020-09-19 10:36:36 +02:00
Oliver Scherer
b1bd34df0c turn_into_const is infallible 2020-09-19 10:36:36 +02:00
Oliver Scherer
4397d66d42 Document op_to_const's purpose 2020-09-19 10:36:36 +02:00
Oliver Scherer
6d3c7bb70d Update codegen tests 2020-09-19 10:36:36 +02:00
Oliver Scherer
2d7ac728e4 Stop using the const_eval query for initializers of statics
As a side effect, we now represent most promoteds as `ConstValue::Scalar` again. This is useful because all implict promoteds are just references anyway and most explicit promoteds are numeric arguments to `asm!` or SIMD instructions.
2020-09-19 10:36:36 +02:00
Oliver Scherer
083f1d7a37 Validate constants during const_eval_raw 2020-09-19 10:36:36 +02:00
bors
4e8a8b49ae 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`
2020-09-19 06:28:37 +00:00
Mara Bos
15eb638dc9 Add tracking issue number for string_drain_as_str. 2020-09-19 08:23:23 +02:00
Mara Bos
1bfe5efe8f Add tracking issue number for int_bits_const. 2020-09-19 08:14:41 +02:00
Mara Bos
1e2dba1e7c Use T::BITS instead of size_of::<T> * 8. 2020-09-19 06:54:42 +02:00
Mara Bos
5c30a16fa0 Add example/test to <int types>::BITS. 2020-09-19 06:50:45 +02:00
Mara Bos
3f68ae47df Add BITS associated constant to all integer types. 2020-09-19 06:50:45 +02:00
bors
ac19c3bda1 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`
2020-09-19 04:21:11 +00:00
bors
a2c82df1f5 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`
2020-09-19 02:21:19 +00:00
bors
c6ab8e5fe0 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
2020-09-18 23:38:17 +00:00
bors
bbc677480d Auto merge of #76782 - lzutao:rd-cap, r=jyn514
Specialize merge_attrs in good case

Just a non-important micro-optimization.
r? `@jyn514`
2020-09-18 21:31:08 +00:00
Jonas Schievink
2f9271b14c Clarify FIXME 2020-09-18 21:23:01 +02:00
Jonas Schievink
ffd9445812 Return Place by value 2020-09-18 21:23:01 +02:00
Jonas Schievink
682de94e31 Move inner items outside 2020-09-18 21:23:01 +02:00
Jonas Schievink
cd5d7201ad Fix rebase fallout 2020-09-18 21:23:01 +02:00
Jonas Schievink
7af964fecf Limit block count 2020-09-18 21:23:01 +02:00
Jonas Schievink
5728834448 Fix rebase fallout 2020-09-18 21:23:01 +02:00
Jonas Schievink
484db5b08a Properly inherit conflicts when merging locals 2020-09-18 21:23:01 +02:00
Jonas Schievink
934634eacc More logging 2020-09-18 21:23:01 +02:00
Jonas Schievink
88538adf9a 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.
2020-09-18 21:23:01 +02:00
Jonas Schievink
ddd6930b54 perf: bail out when there's >500 candidate locals 2020-09-18 21:23:01 +02:00
Jonas Schievink
ab26fb140c perf: only calculate conflicts for candidates 2020-09-18 21:23:01 +02:00
Jonas Schievink
665a98d21f Fix dest-prop mir-opt tests 2020-09-18 21:23:00 +02:00
Jonas Schievink
402f863d8a perf: walk liveness backwards in Conflicts::build 2020-09-18 21:23:00 +02:00
Jonas Schievink
7dbc7f76e1 Add a few dest-prop MIR tests 2020-09-18 21:23:00 +02:00
Jonas Schievink
812d4bbc8d Fix dataflow assert errors 2020-09-18 21:23:00 +02:00
Jonas Schievink
8a3e2b78bb Bless mir-opt tests 2020-09-18 21:23:00 +02:00
Jonas Schievink
8a7b1c3894 Make nrvo-simple set mir-opt-level=1
The additional copies are due to the lack of copy propagation
2020-09-18 21:23:00 +02:00
Jonas Schievink
1649895385 simplify_try: clean up test 2020-09-18 21:23:00 +02:00
Jonas Schievink
43ad8e4260 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.
2020-09-18 21:23:00 +02:00
Jonas Schievink
78ff69ba10 Implement a destination propagation pass 2020-09-18 21:23:00 +02:00
bors
2cbc570e58 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`
2020-09-18 19:13:02 +00:00
Bastian Kauschke
925cd26162 don't take TyCtxt by reference 2020-09-18 20:49:25 +02:00