about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
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.
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-3/+3
2021-08-03bless trivial polonius diagnostics changesRémy Rakic-1/+1
2021-08-03Bless testGiacomo Stevanato-3/+3
2021-08-03Add regression testsGiacomo Stevanato-0/+38
2021-08-02Rollup merge of #86176 - nbdd0121:explicit-generic-args, r=jackh726Cameron Steffen-0/+49
Implement a `explicit_generic_args_with_impl_trait` feature gate Implements #83701 When this gate is enabled, explicit generic arguments can be specified even if `impl Trait` is used in argument position. Generic arguments can only be specified for explicit generic parameters but not for the synthetic type parameters from `impl Trait` So code like this will be accepted: ```rust #![feature(explicit_generic_args_with_impl_trait)] fn foo<T: ?Sized>(_f: impl AsRef<T>) {} fn main() { foo::<str>("".to_string()); } ```
2021-08-02Implement a `explicit_generic_args_with_impl_trait` feature gateGary Guo-0/+49
When this gate is enabled, explicit generic arguments can be specified even if `impl Trait` is used in argument position. Generic arguments can only be specified for explicit generic parameters but not for the synthetic type parameters from `impl Trait`
2021-08-01Auto merge of #87546 - rusticstuff:issue87450-take-two, r=davidtwcobors-0/+43
Bail on any found recursion when expanding opaque types Fixes #87450. More of a bandaid because it does not fix the exponential complexity of the type folding used for opaque type expansion.
2021-07-30Add regression test for issue #87450.Hans Kratz-0/+43
2021-07-30Use multispan suggestions more oftenEsteban Küber-33/+41
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-27Remove min_tait and full_tait stderr dangling filesSantiago Pastorino-346/+0
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-54/+195
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-192/+41
2021-07-23Rollup merge of #87383 - Alexendoo:impl_trait_in_bindings-tests, r=oli-obkYuki Okushi-0/+221
Add regression tests for the impl_trait_in_bindings ICEs Closes #54600, closes #54840, closes #58504, closes #58956, closes #70971, closes #79099, closes #84919, closes #86201, closes #86642, closes #87295 r? ``@oli-obk``
2021-07-22Add regression tests for the impl_trait_in_bindings ICEsAlex Macleod-0/+221
2021-07-22Add a regression testOli Scherer-0/+24
2021-07-22Make mir borrowck's use of opaque types independent of the typeck query's resultOli Scherer-26/+9
2021-07-20Get back the more precise suggestion spans of old regionckOli Scherer-4/+4
2021-07-19Improve impl trait disallowed context error textSantiago Pastorino-88/+88
2021-07-18Remove impl_trait_in_bindings feature flagSantiago Pastorino-111/+56
2021-07-18Remove impl_trait_in_bindings handling on inference error reportingSantiago Pastorino-77/+0
2021-07-18Remove impl trait bindings handling on const AST loweringSantiago Pastorino-32/+35
2021-07-17Remove OpaqueTyOrigin::BindingSantiago Pastorino-341/+8
2021-06-29Bless UI testsFabian Wolff-0/+2
2021-06-12Pretty print generator witness only in `-Zverbose` modeTomasz Miąsko-2/+2
In release build of deeply-nested-async benchmark the size of `no-opt.bc` file is reduced from 46MB to 62kB.
2021-05-30Auto merge of #83772 - jhpratt:revamp-step-trait, r=Mark-Simulacrumbors-2/+1
Make `Step` trait safe to implement This PR makes a few modifications to the `Step` trait that I believe better position it for stabilization in the short term. In particular, 1. `unsafe trait TrustedStep` is introduced, indicating that the implementation of `Step` for a given type upholds all stated invariants (which have remained unchanged). This is gated behind a new `trusted_step` feature, as stabilization is realistically blocked on min_specialization. 2. The `Step` trait is internally specialized on the `TrustedStep` trait, which avoids a serious performance regression. 3. `TrustedLen` is implemented for `T: TrustedStep` as the latter's invariants subsume the former's. 4. The `Step` trait is no longer `unsafe`, as the invariants must not be relied upon by unsafe code (unless the type implements `TrustedStep`). 5. `TrustedStep` is implemented for all types that implement `Step` in the standard library and compiler. 6. The `step_trait_ext` feature is merged into the `step_trait` feature. I was unable to find any reasoning for the features being split; the `_unchecked` methods need not necessarily be stabilized at the same time, but I think it is useful to have them under the same feature flag. All existing implementations of `Step` will be broken, as it is not possible to `unsafe impl` a safe trait. Given this trait only exists on nightly, I feel this breakage is acceptable. The blanket `impl<T: Step> TrustedLen for T` will likely cause some minor breakage, but this should be covered by the equivalent impl for `TrustedStep`. Hopefully these changes are sufficient to place `Step` in decent position for stabilization, which would allow user-defined types to be used with `a..b` syntax.
2021-05-26Unify feature flags as `step_trait`Jacob Pratt-1/+0
While stdlib implementations of the unchecked methods require unchecked math, there is no reason to gate it behind this for external users. The reasoning for a separate `step_trait_ext` feature is unclear, and as such has been merged as well.
2021-05-26bless compare-mode=nll outputNiko Matsakis-2/+2
2021-05-26stabilize member constraintsNiko Matsakis-33/+17
2021-05-26Make Range implementation safeJacob Pratt-1/+1
2021-05-16Add tracking issueJonas Schievink-0/+3
2021-05-16Allow `async {}` expressions in const contextsJonas Schievink-6/+15
2021-04-23Tweak suggestion outputEsteban Küber-0/+8
2021-04-08Suggest changing impl parameter types to match traitEsteban Küber-3/+8
This is particularly useful for cases where arbitrary self types are used, like in custom `Future`s.
2021-04-08Use more accurate spans for trait/impl method arg divergenceEsteban Küber-2/+2