about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
2022-02-02Stop generating inference vars for nested impl trait and let type equality ↵Oli Scherer-8/+32
handle it. This means we stop supporting the case where a locally defined trait has only a single impl so we can always use that impl (see nested-tait-inference.rs).
2022-02-02Register member constraints on the final merged hidden typeOli Scherer-32/+2
Previously we did this per hidden type candiate, which didn't always have all the information available.
2022-02-02Lazily resolve type-alias-impl-trait defining usesOli Scherer-506/+429
by using an opaque type obligation to bubble up comparisons between opaque types and other types Also uses proper obligation causes so that the body id works, because out of some reason nll uses body ids for logic instead of just diagnostics.
2021-12-17Fix typo in "new region bound" suggestionEsteban Kuber-15/+15
The lifetime name shoud always appear in text surrounded by `.
2021-12-15update testslcnr-1/+6
2021-12-11Auto merge of #91769 - estebank:type-trait-bound-span-2, r=oli-obkbors-6/+23
Tweak assoc type obligation spans * Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors r? `@oli-obk` This is a(n uncontroversial) subset of #85799.
2021-12-11Tweak assoc type obligation spansEsteban Kuber-6/+23
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
2021-12-10Tweak wordingEsteban Kuber-12/+12
2021-12-10Use a more accurate `Span` for `'static` obligation from return typeEsteban Kuber-16/+16
2021-12-10Point at return type when it introduces `'static` obligationEsteban Kuber-0/+28
2021-12-10Clean up visual output logicEsteban Kuber-5/+5
2021-11-26Perform Sync check on static items in wf-check instead of during const checksOli Scherer-2/+2
2021-11-26Auto merge of #85102 - estebank:point-at-assignment, r=oli-obkbors-0/+3
Diagnostic tweaks * On type mismatch caused by assignment, point at the source of the expectation * Hide redundant errors * Suggest `while let` when `let` is missing in some cases
2021-11-25On type mismatch caused by assignment, point at assigneeEsteban Küber-0/+3
* Do not emit unnecessary E0308 after E0070 * Show fewer errors on `while let` missing `let` * Hide redundant E0308 on `while let` missing `let` * Point at binding definition when possible on invalid assignment * do not point at closure twice * do not suggest `if let` for literals in lhs * account for parameter types
2021-11-23Fix printing unit return ty, don't elaborate FnOnce unless we see itMichael Goulet-9/+9
2021-11-23Update test outputsMichael Goulet-17/+17
2021-11-20Point at bounds when comparing impl items to traitEsteban Kuber-2/+2
2021-11-18Print output ty for opaque future tyMichael Goulet-2/+2
2021-11-09Rollup merge of #90708 - NieDzejkob:feature-note, r=jackh726Yuki Okushi-0/+9
Add a note about feature(explicit_generic_args_with_impl_trait) to the relevant error message Fixes #90615
2021-11-09Auto merge of #87337 - jyn514:lint-error, r=oli-obk,flip1995bors-7/+16
Don't abort compilation after giving a lint error The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors. Closes https://github.com/rust-lang/rust/issues/82761. This is a WIP because I have a feeling it will exit with 0 even if there were lint errors; I don't have a computer that can build rustc locally at the moment.
2021-11-08Add a note about feature(explicit_generic_args_with_impl_trait) to the ↵Jakub Kądziołka-0/+9
relevant error message
2021-11-08Don't abort compilation after giving a lint errorJoshua Nelson-7/+16
The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors.
2021-11-06Move some tests to more reasonable directoriesCaio-0/+35
2021-10-25fix(rustc_typeck): report function argument errors on matching typeMichael Howell-4/+8
Fixes #90101
2021-10-24Always sort suggestions before emitting themEsteban Kuber-4/+4
2021-10-24Point at overlapping impls when type annotations are neededEsteban Kuber-3/+18
2021-10-18Remove regionck member constraint handling and leave it to mir borrowckOli Scherer-252/+67
2021-10-15simplify constrain_opaque_typesNiko Matsakis-123/+244
2021-10-13Bless nll testsOli Scherer-10/+12
2021-10-13Re-use logic for adding a suggestion when a lifetime bound is missing on an ↵Oli Scherer-0/+15
impl trait
2021-10-13Remove explicit -Zborrowck=mir which does not affect test anymoreOli Scherer-6/+2
2021-10-13Remove a feature attribute for an accepted featureOli Scherer-2/+1
2021-10-13Use a label instead of a note for member constraint errorsOli Scherer-26/+11
2021-10-13Remove textual span from diagnostic stringOli Scherer-6/+6
2021-10-03Don't suggest replacing region with 'static in NLLAaron Hill-4/+0
Fixes #73159 This is similar to #69350 - if the user didn't initially write out a 'static lifetime, adding 'static in response to a lifetime error is usually the wrong thing to do.
2021-09-28Pick one possible lifetime in case there are multiple choicesOli Scherer-2/+10
2021-09-21Disable visible path calculation for PrettyPrinter in Ok path of compilerAlik Aslanyan-2/+2
2021-09-15Move some tests to more reasonable directoriesCaio-0/+31
2021-09-02Preserve most sub-obligations in the projection cacheAaron Hill-6/+6
2021-08-31Auto merge of #88100 - HTG-YT:edition2021-compopt-stabilization, r=m-ou-sebors-1/+1
Make Edition 2021 Stable An item of #87959. This is an "on-demand" pull request, which means it will be merged when it is the right time to.
2021-08-30Update test output for stable Rust 2021.Mara Bos-1/+1
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-76/+0
2021-08-24Normalize associated types with bound varsJack Huey-2/+2
2021-08-18Rollup merge of #88136 - spastorino:fix-test-directory, r=oli-obkGuillaume Gomez-0/+13
Move private_unused.rs test to impl-trait This test was added to fix this issue #55124 which is about impl traits but not related with type alias impl traits. r? `@oli-obk` `@bors` rollup=always
2021-08-18Move private_unused.rs test to impl-traitSantiago Pastorino-0/+13
2021-08-18Auto merge of #87738 - lqd:polonius-master, r=nikomatsakisbors-1/+1
Update `polonius-engine` to 0.13.0 This PR updates the use of `polonius-engine` to the recently released 0.13.0: - this version renamed a lot of relations to match the current terminology - "illegal subset relationships errors" (AKA "subset errors" or "universal region errors" in rustc parlance) have been implemented in all variants, and therefore the `Hybrid` variant can be the rustc default once again - some of the blessed expectations were updated: new tests have been added since the last time I updated the tests, diagnostics have changed, etc. In particular: - a few tests had trivial expectations changes such as basic diagnostics changes for the migrate-mode and full NLLs - others were recursion and lengths limits which emits a file, and under the polonius compare-mode, the folder has a different name - a few tests were ignored in the NLL compare-mode for reasons that obviously also apply to Polonius - some diagnostics were unified so that older expectations no longer made sense: the NLL and Polonius outputs were identical. - in a few cases Polonius gets a chance to emit more errors than NLLs A few tests in the compare-mode still are super slow and trigger the 60s warning, or OOM rustc during fact generation, and I've detailed these [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/186049-t-compiler.2Fwg-polonius/topic/Challenges.20for.20move.2Finit.2C.20liveness.2C.20and.20.60Location.3A.3AAll.60): - `src/test/ui/numbers-arithmetic/saturating-float-casts.rs` -> OOM during rustc fact generation - `src/test/ui/numbers-arithmetic/num-wrapping.rs` - `src/test/ui/issues/issue-72933-match-stack-overflow.rs` - `src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs` - `src/test/ui/repr/repr-no-niche.rs` In addition, 2 tests don't currently pass and I didn't want to bless them now: they deal with HRTBs and miss errors that NLLs emit. We're currently trying to see if we need chalk to deal with HRTB errors (as we thought we would have to) but during the recent sprint, we discovered that we may be able to detect some of these errors in a way that resembles subset errors: - `ui/hrtb/hrtb-just-for-static.rs` -> 3 errors in NLL, 2 in polonius: a missing error about HRTB + needing to outlive 'static - `ui/issues/issue-26217.rs` -> missing HRTB that makes the test compile instead of emitting an error We'll keep talking about this at the next sprint as well. cc `@rust-lang/wg-polonius` r? `@nikomatsakis`
2021-08-16Use note to point at bound introducing requirementEsteban Küber-6/+10
2021-08-11Modify structured suggestion outputEsteban Küber-99/+157
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-06Point to the value instead of the TAIT declaration for obligation failuresOli Scherer-15/+18
2021-08-06Rollup merge of #87727 - SkiFire13:fix-87718, r=jackh726Yuki Okushi-3/+41
explicit_generic_args_with_impl_trait: fix min expected number of generics Fixes #87718 The problem was that `synth_type_param_count` was already subtracted from `named_type_param_count`, so this ended up being subtracted again. This caused `expected_min` to overflow, and ultimately resulting in weird and wrong behaviour. I've also added another test not present in the original issue but caused by the same bug.