about summary refs log tree commit diff
path: root/src/test/ui/structs-enums
AgeCommit message (Collapse)AuthorLines
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-8/+3
2021-09-15Move some tests to more reasonable directoriesCaio-0/+35
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-0/+6
2021-08-11Modify structured suggestion outputEsteban Küber-6/+6
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-05-11Auto merge of #85012 - FabianWolff:struct-rec, r=davidtwcobors-0/+138
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-10Implement changes suggested by tmiasko and davidtwcoFabian Wolff-0/+138
2021-05-06Fix up/ignore failing ui tests on fuchsiaTyler Mandry-0/+1
2021-03-20Move some tests to more reasonable directories - 5Caio-0/+26
2021-02-16Move some tests to more reasonable directoriesCaio-0/+173
2021-01-13Update code to account for extern ABI requirementMark Rousskov-2/+2
2021-01-13Update tests for extern block lintingMark Rousskov-3/+3
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-2/+2
2020-11-29Update tests to remove old numeric constantsbstrie-2/+0
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-26Fix new 'unnecessary trailing semicolon' warningsAaron Hill-2/+2
2020-11-22Drop support for cloudabi targetsLzu Tao-1/+0
2020-04-01Rollup merge of #70081 - lcnr:issue68387, r=varkorDylan DPC-0/+1
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-03-31update testsBastian Kauschke-0/+1
2020-03-19Ensure there are versions of test code for aarch64 windowsDaniel Frampton-7/+0
2019-12-22Remove mem::uninitalized from testsMark Rousskov-6/+13
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-10-23UI failures fixUmesh Kalappa-1/+2
2019-08-15Group all ui tests and move to abi #62593Kevin Per-64/+0
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+4925