Commit Graph

68 Commits

Author SHA1 Message Date
Santiago Pastorino
705813c84b
Bump mir-opt-level from 3 to 4 in tests 2021-03-05 17:13:57 -03:00
Felix S. Klock II
fb0e41f6b3 regression test for issue 80949. 2021-02-04 21:29:50 -05:00
Mara Bos
e9ad5be0f7 Allow/fix non_fmt_panic in tests. 2021-02-03 23:15:45 +01:00
Aaron Hill
dea8a16af5
Avoid describing a method as 'not found' when bounds are unsatisfied
Fixes #76267

When there is a single applicable method candidate, but its trait bounds
are not satisfied, we avoid saying that the method is "not found".
Insted, we update the error message to directly mention which bounds are
not satisfied, rather than mentioning them in a note.
2021-01-26 23:59:50 -05:00
Ömer Sinan Ağacan
e3faeb486a mir: Improve size_of handling when arg is unsized 2021-01-21 22:17:05 +03:00
Ömer Sinan Ağacan
3fb53c2c85 Fix ICE in mir when evaluating SizeOf on unsized type
Fixes #80742
2021-01-19 18:35:21 +03:00
bors
95cbcad920 Auto merge of #80942 - c410-f3r:tests-tests-tests, r=petrochenkov
Move some tests to more reasonable directories - 2

All tests with a score equal or greater than 1.0 were moved to their respective directories by issuing

```bash
cat FILE | tr -s " " | tr -d '():' | sort -k3 | awk '$3 >= 1' | cut -d " " -f1-2 | sed 's;\\;/;g' | xargs -n2 git mv
```
**Observation**: The first column values is the only column with results greater zero

To attest the confidentiality of the model, some manual revision of at least of tests is needed and this process will be tracked in the following list:

* `src/test/ui/abi/issue-28676.rs` OK #28676
* `src/test/ui/array-slice-vec/issue-15730.rs` OK
* `src/test/ui/associated-types/issue-24338.rs` OK #54823
* `src/test/ui/associated-types/issue-48551.rs` Looks OK #48551
* `src/test/ui/associated-types/issue-50301.rs` Looks OK #63577

...

cc #73494
r? `@petrochenkov`
2021-01-17 02:48:07 +00:00
Caio
ad35979c50 Move some tests to more reasonable directories - 2
Address comments

Update limits
2021-01-16 19:46:54 -03:00
Simonas Kazlauskas
af0d099004 Add a regression test for #50041
AFAICT the test case never landed alongside the fix for the issue.
2021-01-16 01:34:28 +02:00
Mark Rousskov
4614671cae Update code to account for extern ABI requirement 2021-01-13 07:49:45 -05:00
Rich Kadel
e4aa99fe7a Inlining enabled by -mir-opt-level > 1 is incompatible with coverage
Fixes: #80060

Also adds additional test cases for coverage of doctests.
2021-01-04 11:06:42 -08:00
Bastian Kauschke
c4ba60a191 update tests 2020-12-26 18:24:10 +01:00
Chenguang Wang
3812f70355 fix test case issue ref 2020-12-09 20:11:32 -08:00
Chenguang Wang
c6f2d49ff8 fix issue #78496 2020-12-09 18:56:27 -08:00
Lzu Tao
6bfe27a3e0 Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
Tomasz Miąsko
fac8b4e21a Support building clone shims for arrays with generic size 2020-11-21 00:00:00 +00:00
Tomasz Miąsko
0ab44584aa Revert "Normalize function type during validation"
This reverts commit d486bfcbff.
2020-11-19 05:36:55 +01:00
Tomasz Miąsko
f27d56d1ff Limit storage duration of inlined always live locals 2020-11-15 00:00:00 +00:00
Tomasz Miąsko
d486bfcbff Normalize function type during validation
During inlining, the callee body is normalized and has types revealed,
but some of locals corresponding to the arguments might come from the
caller body which is not. As a result the caller body does not pass
validation without additional normalization.
2020-11-12 20:57:43 +01:00
Yuki Okushi
a619865889 Add test for issue-77911 2020-10-20 17:25:21 +09:00
Yuki Okushi
af337e87e2 Add test for issue-76375 2020-10-20 17:25:19 +09:00
Yuki Okushi
7d4d64d69f Add test for issue-75053 2020-10-20 17:07:27 +09:00
Yuki Okushi
35b737465c Add test for issue-68841 2020-10-20 17:07:11 +09:00
Bastian Kauschke
ac893b8a02 add test for should_inline incorrect param_env 2020-10-07 10:04:08 +02:00
Bastian Kauschke
32739a2ff1 add regression test 2020-10-07 10:04:08 +02:00
Bastian Kauschke
f0487cee74 normalize substs during inlining 2020-10-07 10:04:08 +02:00
Dylan DPC
83c58d6fb6
Rollup merge of #77568 - lcnr:mir-inline-def-id, r=ecstatic-morse
inliner: use caller param_env

We used the callee param env instead of the caller param env by accident in #77430, this PR fixes that and caches it in the `Inliner` struct.

fixes #77564

r? @ecstatic-morse
2020-10-07 00:16:05 +02:00
Bastian Kauschke
daf48b82ab inliner: use caller param_env 2020-10-05 11:04:25 +02:00
Tomasz Miąsko
f271957d89 Add regression test for SimplifyBranchSame miscompilation 2020-10-04 00:00:00 +00:00
Camelid
4c9bcf3b39 Fix test name
Remove trailing `-`.
2020-10-02 14:33:23 -07:00
Wesley Wiser
f9d7720be7 Disable the SimplifyArmIdentity mir-opt
The optimization still has some bugs that need to be worked out
such as #77359.

We can try re-enabling this again after the known issues are resolved.
2020-10-01 20:29:53 -04:00
bors
4d52dc4790 Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morse
Clean up diagnostics for arithmetic operation errors

Plus a small tweak to a range pattern error message.
2020-09-29 14:28:58 +00:00
Wesley Wiser
b9d0ea95c8 [mir-opt] Introduce a new flag to enable experimental/unsound mir opts 2020-09-27 19:21:01 -04:00
varkor
8eb42ba0fb Make invalid integer operation messages consistent 2020-09-26 13:34:49 +01:00
bors
5b9e886403 Auto merge of #73453 - erikdesjardins:tuplayout, r=eddyb
Ignore ZST offsets when deciding whether to use Scalar/ScalarPair layout

This is important because Scalar/ScalarPair layout previously would not be used if any ZST had nonzero offset.
For example, before this change, only `((), u128)` would be laid out like `u128`, not `(u128, ())`.

Fixes #63244
2020-09-25 14:42:20 +00:00
Tomasz Miąsko
65edf54c25 Add a regression test for copy propagation miscompilation 2020-09-20 00:00:00 +00:00
Wesley Wiser
dbd7226d29 [mir-opt] Disable the ConsideredEqual logic in SimplifyBranchSame opt
The logic is currently broken and we need to disable it to fix a beta
regression (see #76803)
2020-09-17 09:36:50 -04:00
bors
0b65a3d0a6 Auto merge of #76123 - tmiasko:inline-args-storage, r=wesleywiser
inliner: Emit storage markers for introduced arg temporaries

When introducing argument temporaries during inlining, emit storage
marker statements just before the assignment and in the beginning of
the return block.

This ensures that such temporaries will not be considered live across
yield points after inlining inside a generator.

Fixes #71793.
2020-09-14 02:13:02 +00:00
Tomasz Miąsko
9daf8fd5b1 inliner: Emit storage markers for introduced arg temporaries
When introducing argument temporaries during inlining, emit storage
marker statements just before the assignment and in the beginning of
the return block.

This ensures that such temporaries will not be considered live across
yield points after inlining inside a generator.
2020-09-03 17:01:27 +02:00
Tomasz Miąsko
af19262ab4 Fold length constant in Rvalue::Repeat 2020-09-02 19:06:47 +02:00
Erik Desjardins
d3b9ece4c0 add tests related to tuple scalar layout with ZST in last field 2020-08-30 14:58:03 -04:00
Bastian Kauschke
d2398eee0f allow escaping bound vars when normalizing ty::Opaque 2020-08-12 09:08:34 +02:00
Oliver Scherer
819cde5dab Show the values and computation that would overflow a const evaluation or propagation 2020-06-26 10:08:52 +02:00
David Wood
14ea7a777f
lints: add improper_ctypes_definitions
This commit adds a new lint - `improper_ctypes_definitions` - which
functions identically to `improper_ctypes`, but on `extern "C" fn`
definitions (as opposed to `improper_ctypes`'s `extern "C" {}`
declarations).

Signed-off-by: David Wood <david@davidtw.co>
2020-06-24 12:09:35 +01:00
Oliver Scherer
5fa8b08808 The const propagator cannot trace references.
Thus we avoid propagation of a local the moment we encounter references to it.
2020-06-23 10:18:14 +02:00
Yuki Okushi
e069524c48
Add test for #66930 2020-05-28 16:50:10 +09:00
Yuki Okushi
9a164ff4c5
Skip tests on emscripten 2020-05-08 00:39:02 +09:00
Yuki Okushi
e69748ba4f
Move tests from test/run-fail to UI 2020-05-06 14:02:55 +09:00
Félix Fischer
072649ec5d Added new ui tests to show what errors MIR can now find at compile time 2020-04-28 00:44:54 -04:00
Yuki Okushi
0efc2cf547
Add test for issue-60390 2020-03-13 16:06:08 +09:00