about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2019-11-04Use build-pass in ui tests where appropriateTomasz Miąsko-52/+52
2019-11-04Use run-pass for ui tests where appropriateTomasz Miąsko-2/+2
2019-11-04Remove no longer useful ui testTomasz Miąsko-4/+0
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-103/+188
Reduce amount of errors given unclosed delimiter When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it on a more granular way in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace. Fix #63690.
2019-11-03Auto merge of #65759 - tmiasko:ui, r=petrochenkovbors-258/+270
Validate error patterns and error annotation in ui tests when present Previously, when compilation succeeded, neither error patterns nor error annotation would be validated. Additionally, when compilation failed, only error patterns would be validated if both error patterns and error annotation were present. Now both error patterns and error annotation are validated when present, regardless of compilation status. Furthermore, for test that should run, the error patterns are matched against executable output, which is what some of tests already expect to happen, and when #65506 is merged even more ui tests will. Fixes #56277
2019-11-03Use check-pass for never type testsTomasz Miąsko-10/+5
2019-11-03Avoid matching type in huge-struct test error annotationTomasz Miąsko-1/+1
The concrete type that will be too big is target dependent. Avoid matching it in error annotation to make test work correctly across different targets.
2019-11-03Update error annotations positionsTomasz Miąsko-9/+13
Since 8ec9d7242c3352fbc617d907bec3632215811356, in the case of a local macro expansion, the errors are now matched to macro definition location. Update test cases accordingly.
2019-11-03Avoid mixing error patterns with error annotationsTomasz Miąsko-8/+6
When both error patterns and error annotations are present in an ui test, only error patterns are validated against the output. Replace the error pattern with an error annotation to avoid silently ignoring the other error annotation.
2019-11-02Auto merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikicbors-0/+160
Make <*const/mut T>::offset_from `const fn` This reenables offset_of cc @mjbshaw after https://github.com/rust-lang/rust/pull/63075 broke it
2019-11-02adjust for missing spans on x86 test runnerRalf Jung-8/+7
2019-11-02Auto merge of #66004 - eddyb:revert-early-gate, r=petrochenkovbors-149/+50
Partially revert the early feature-gatings added in #65742. The intent here is to address #65860 ASAP (in time for beta, ideally), while leaving as much of #65742 around as possible, to make it easier to re-enable later. Therefore, I've only kept the parts of the revert that re-add the old (i.e. non-early) feature-gating checks that were removed in #65742, and the test reverts. I've disabled the new early feature-gating checks from #65742 entirely for now, but it would be easy to put them behind a `-Z` flag, or turn them into warnings, which would allow us to keep tests for both the early and late versions of the checks - assuming that's desirable. cc @nikomatsakis @Mark-Simulacrum @Centril
2019-11-02Update error annotations in tests that successfully compileTomasz Miąsko-229/+245
Those annotation are silently ignored rather than begin validated against compiler output. Update them before validation is enabled, to avoid test failures.
2019-11-02Remove erroneous error-pattern from run-pass testTomasz Miąsko-1/+0
2019-11-01Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichtonTyler Mandry-0/+61
Revert PR 64324: dylibs export generics again (for now) As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols. The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319. In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872. Fix #64872 Reopen #64319
2019-11-01Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebankTyler Mandry-3/+6
Add error code E0743 for "C-variadic has been used on a non-foreign function" Fixes https://github.com/rust-lang/rust/issues/65967
2019-11-01Rollup merge of #65977 - ↵Tyler Mandry-46/+46
ohadravid:fix-incorrect-diagnostics-with-an-associated-type, r=estebank Fix incorrect diagnostics for expected type in E0271 with an associated type With code like the following code: ```rust #[derive(Debug)] struct Data {} fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) { for item in iterator { println!("{:?}", item) } } fn main() { let v = vec![Data {}]; do_stuff(v.into_iter()); } ``` the diagnostic (in nightly & stable) wrongly complains about the expected type: ``` error[E0271]: type mismatch resolving `<std::vec::IntoIter<Data> as std::iter::Iterator>::Item == &Data` --> src/main.rs:15:5 | 5 | fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) { | -------- --------------- required by this bound in `do_stuff` ... 15 | do_stuff(v.into_iter()); | ^^^^^^^^ expected struct `Data`, found &Data | = note: expected type `Data` found type `&Data` ``` This PR fixes this issue by flipping the expected/actual values where appropriate, so it looks like this: ``` error[E0271]: type mismatch resolving `<std::vec::IntoIter<Data> as std::iter::Iterator>::Item == &Data` --> main.rs:15:5 | 5 | fn do_stuff<'a>(iterator: impl Iterator<Item = &'a Data>) { | -------- --------------- required by this bound in `do_stuff` ... 15 | do_stuff(v.into_iter()); | ^^^^^^^^ expected &Data, found struct `Data` | = note: expected type `&Data` found type `Data` ``` This improves the output of a lot of existing tests (check out `associated-types-binding-to-type-defined-in-supertrait`!). The only change which I wasn't too sure about is in the test `associated-types-overridden-binding-2`, but I think it's an improvement and the underlying problem is with handling of `trait_alias`. Fix #57226, fix #64760, fix #58092.
2019-11-01Rollup merge of #65914 - estebank:type-alias-bounds-sugg, r=davidtwcoTyler Mandry-24/+96
Use structured suggestion for unnecessary bounds in type aliases
2019-11-01Rollup merge of #65902 - gilescope:issue62570, r=estebankTyler Mandry-0/+96
Make ItemContext available for better diagnositcs Fix #62570
2019-11-01Rollup merge of #65471 - GuillaumeGomez:long-err-explanation-E0578, r=Dylan-DPCTyler Mandry-0/+1
Add long error explanation for E0578 Part of #61137 r? @kinnison
2019-11-01Rollup merge of #65112 - jack-t:type-parens-lint, r=varkorTyler Mandry-18/+37
Add lint and tests for unnecessary parens around types This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way. The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` &mdash; I'm not totally sure it worked right, though &mdash; and I've tried to follow the instructions linked in the readme. I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something. There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
2019-11-01ui test formulation of regression test for issue 64872.Felix S. Klock II-0/+61
(Many thanks to alex for 1. making this even smaller than what I had originally minimized, and 2. pointing out that there is precedent for having ui tests with crate dependency chains of length > 2, thus allowing me to avoid encoding this as a run-make test.)
2019-10-31Revert "pre-expansion gate trait_alias."Eduard-Mihai Burtescu-19/+1
This reverts commit 2d182b82ce5ecfe8090ba3d4e78f1cd72c072ef1.
2019-10-31Revert "pre-expansion gate associated_type_bounds"Eduard-Mihai Burtescu-14/+1
This reverts commit c17a1fd7d0ef0f1f546445d0c8bdb11be55e4be7.
2019-10-31Revert "pre-expansion gate crate_visibility_modifier"Eduard-Mihai Burtescu-13/+1
This reverts commit 04c661ba021730bc13d33c6d55cb9aad05026f36.
2019-10-31Revert "pre-expansion gate const_generics"Eduard-Mihai Burtescu-29/+15
This reverts commit 49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.
2019-10-31Revert "pre-expansion gate decl_macro"Eduard-Mihai Burtescu-14/+1
This reverts commit 1f470ceac2202ecffe8a15acc1139edb9ad4a03b.
2019-10-31Revert "pre-expansion gate box_patterns"Eduard-Mihai Burtescu-16/+1
This reverts commit 2aff6b36d7ed5c25700669a92b4a43200ee0fe6b.
2019-10-31Revert "pre-expansion gate exclusive_range_pattern"Eduard-Mihai Burtescu-22/+20
This reverts commit 665a876e307933c6480a6c55a3e38e88937aff2c.
2019-10-31Revert "pre-expansion gate try_blocks"Eduard-Mihai Burtescu-7/+4
This reverts commit 1935ba658c576f14397c2c7a26a6642cf08f26a6.
2019-10-31Revert "pre-expansion gate label_break_value"Eduard-Mihai Burtescu-5/+2
This reverts commit 137ded8ab1edf5112c45e0b6854272ae2e9d3a6d.
2019-10-31Revert "pre-expansion gate box_syntax"Eduard-Mihai Burtescu-5/+2
This reverts commit e4ed8865786a787a7b0c045f7674569b6be0e9bc.
2019-10-31Revert "pre-expansion gate type_ascription"Eduard-Mihai Burtescu-5/+2
This reverts commit 15a6c09b6e8a977f2c6f5a73de01a20d00b37930.
2019-10-31update ui testsGuillaume Gomez-0/+1
2019-10-31Auto merge of #63803 - GuillaumeGomez:stabilize-doctest, ↵bors-16/+0
r=ollie27,QuietMisdreavus,Mark-Simulacrum [rustdoc] stabilize cfg(doctest) Fixes #62210. Since we removed rustdoc from providing cfg(test) on test runs, it's been replaced by cfg(doctest). It'd be nice to have it in not too far in the future.
2019-10-31Update ui testsGuillaume Gomez-3/+6
2019-10-31Fix incorrect diagnostics for expected type in E0271 with an associated typeOhad Ravid-46/+46
2019-10-30Do not complain about missing `fn main()` in some casesEsteban Küber-106/+24
2019-10-30Reduce ammount of errors given unclosed delimiterEsteban Küber-52/+219
When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it more granularly in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace.
2019-10-30Update ui testsGuillaume Gomez-1/+2
2019-10-30Make ItemContext available for better diagnositcs.Giles Cope-0/+96
2019-10-30Auto merge of #65068 - estebank:trait-impl-lt-mismatch, r=nikomatsakisbors-53/+54
Custom lifetime error for `impl` item doesn't conform to `trait` Partly addresses #42706, #41343, fix #40900.
2019-10-29Rollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakisTyler Mandry-0/+21
save-analysis: Account for async desugaring in async fn return types Closes #65590 When visiting the return type of an async function we need to take into account its desugaring, since it introduces a new definition under which the return type is redefined. r? @nikomatsakis
2019-10-29Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichtonTyler Mandry-36/+32
Re-enable Emscripten's exception handling support Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests. r? @alexcrichton
2019-10-29Rollup merge of #65539 - traxys:fix_62334, r=petrochenkovTyler Mandry-13/+24
resolve: Turn the "non-empty glob must import something" error into a lint This fixes #62334 by changing the error to a lint warning the glob. I changed the test but I'm very unsure of what I did as I do not know how to correctly check for the warning
2019-10-29Add lint for unnecessary parens around typesjack-t-18/+37
2019-10-29Silence crate external span error in x86 platformsEsteban Küber-1/+3
This causes issues in at least `dist-i586-gnu-i586-i686-musl`, possibly others.
2019-10-29Fix NLL testEsteban Küber-18/+7
2019-10-29Make error apply only to impl/trait mismatchEsteban Küber-6/+17
2019-10-29Point at the trait item and tweak wordingEsteban Küber-12/+21