Commit Graph

35 Commits

Author SHA1 Message Date
Arthur Cohen
99d57ee23d core: Mark all safe intrinsics with #[rustc_safe_intrinsic] 2022-09-27 15:55:42 +02:00
Michael Benfield
d7a750b504 Use niche-filling optimization even when multiple variants have data.
Fixes #46213
2022-09-07 20:12:45 +00:00
est31
0a03825f76 Remove even more box syntax uses from src/test
Prior work, notably 6550021124 from #88316
has removed box syntax from most of the testsuite. However,
some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
Some tests that are very box syntax specific are not being migrated.
2022-08-07 04:22:20 +02:00
Fabian Wolff
e3c7e04a44 Warn about dead tuple struct fields 2022-08-03 12:17:23 +02:00
Caio
bff6f6dffb Move some tests to more reasonable places 2022-05-01 08:47:38 -03:00
Michael Goulet
de04c05dea Specialize suggestion for Option<T> 2022-03-31 08:04:53 -07:00
Caio
6947a772dd Remove duplicated and unused test files 2022-03-28 10:16:32 -03:00
Takayuki Maeda
925857d8dc stop emitting E0026 for struct enums with underscores 2022-03-23 22:54:02 +09:00
David Koloski
ea68758299 Add needs-unwind to tests that depend on panicking
This directive isn't automatically set by compiletest or x.py, but can
be turned on manually for targets that require it.
2021-12-09 22:03:52 +00:00
Caio
ab5434f9b8 Move some tests to more reasonable directories 2021-11-14 14:38:42 -03:00
Yuki Okushi
6e39d27a82 Rollup merge of #90591 - richlowe:illumos-ui-target, r=Mark-Simulacrum
treat illumos like solaris in failing ui tests which need it

Just adding the right cfg target for tests which fail because they don't know illumos is a thing.

(cc `````@jclulow)`````
2021-11-09 22:02:22 +09:00
Caio
7fd15f0900 Move some tests to more reasonable directories 2021-11-06 15:35:20 -03:00
Richard Lowe
dbc3bf48c4 treat illumos like solaris in failing ui tests which need it 2021-11-04 17:00:19 -05:00
est31
6550021124 Remove box syntax from most places in src/test outside of the issues dir 2021-09-26 04:07:44 +02:00
Caio
1b0186e9ec Move some tests to more reasonable directories 2021-09-15 14:03:27 -03:00
Fabian Wolff
79adda930f Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
Esteban Küber
99f2977031 Modify structured suggestion output
* On suggestions that include deletions, use a diff inspired output format
* When suggesting addition, use `+` as underline
* Color highlight modified span
2021-08-11 09:46:24 +00:00
bors
d4d129d566 Auto merge of #85012 - FabianWolff:struct-rec, r=davidtwco
Fix stack overflow when checking for structural recursion

This pull request aims to fix #74224 and fix #84611. The current logic for detecting ADTs with structural recursion is flawed because it only looks at the root type, and then for exact matches. What I mean by this is that for examples such as:
```rust
struct A<T> {
    x: T,
    y: A<A<T>>,
}

struct B {
    z: A<usize>
}

fn main() {}
```
When checking `A`, the compiler correctly determines that it has an infinite size (because the "root" type is `A`, and `A` occurs, albeit with different type arguments, as a nested type in `A`).

However, when checking `B`, it also recurses into `A`, but now `B` is the root type, and it only checks for _exact_ matches of `A`, but since `A` never precisely contains itself (only `A<A<T>>`, `A<A<A<T>>>`, etc.), an endless recursion ensues until the stack overflows.

In this PR, I have attempted to fix this behavior by implementing a two-phase checking: When checking `B`, my code first checks `A` _separately_ and stops if `A` already turns out to be infinite. If not (such as for `Option<T>`), the second phase checks whether the root type (`B`) is ever nested inside itself, e.g.:
```rust
struct Foo { x: Option<Option<Foo>> }
```

Special care needs to be taken for mutually recursive types, e.g.:
```rust
struct A<T> {
    z: T,
    x: B<T>,
}

struct B<T> {
    y: A<T>
}
```
Here, both `A` and `B` both _are_ `SelfRecursive` and _contain_ a recursive type. The current behavior, which I have maintained, is to treat both `A` and `B` as `SelfRecursive`, and accordingly report errors for both.
2021-05-11 00:00:53 +00:00
Fabian Wolff
98728c2b35 Implement changes suggested by tmiasko and davidtwco 2021-05-10 17:47:50 +02:00
Tyler Mandry
947ad5838c Fix up/ignore failing ui tests on fuchsia 2021-05-06 02:49:34 +00:00
Caio
3490170893 Move some tests to more reasonable directories - 5 2021-03-20 11:41:24 -03:00
Caio
e7e93717ce Move some tests to more reasonable directories 2021-02-16 21:22:21 -03:00
Mark Rousskov
4614671cae Update code to account for extern ABI requirement 2021-01-13 07:49:45 -05:00
Mark Rousskov
8a3edb1d66 Update tests for extern block linting 2021-01-13 07:49:16 -05:00
Vadim Petrochenkov
4d2d0bad4e Remove compile-fail test suite 2020-12-29 23:39:56 +03:00
bstrie
90a2e5e3fe Update tests to remove old numeric constants
Part of #68490.

Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros.

For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-29 00:55:55 -05:00
Aaron Hill
6f91c32da6 Fix new 'unnecessary trailing semicolon' warnings 2020-11-26 17:08:36 -05:00
Lzu Tao
6bfe27a3e0 Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
Dylan DPC
8993358e77 Rollup merge of #70081 - lcnr:issue68387, r=varkor
add `unused_braces` lint

Add the lint `unused_braces` which is warn by default.

`unused_parens` is also extended and now checks anon consts.

closes #68387

r? @varkor
2020-04-01 00:27:20 +02:00
Bastian Kauschke
698b20eeda update tests 2020-03-31 19:01:49 +02:00
Daniel Frampton
d19562062c Ensure there are versions of test code for aarch64 windows 2020-03-19 16:00:45 -07:00
Mark Rousskov
c205f6a06a Remove mem::uninitalized from tests
This purges uses of uninitialized where possible from test cases. Some
are merely moved over to the equally bad pattern of
MaybeUninit::uninit().assume_init() but with an annotation that this is
"the best we can do".
2019-12-22 21:58:12 -05:00
Umesh Kalappa
eb6d757cb0 UI failures fix 2019-10-23 10:19:45 -07:00
Kevin Per
df713dd397 Group all ui tests and move to abi #62593 2019-08-15 16:00:54 +02:00
Vadim Petrochenkov
9be35f82c1 tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00