about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
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
2021-04-08Rollup merge of #83689 - estebank:cool-bears-hot-tip, r=davidtwcoDylan DPC-1/+5
Add more info for common trait resolution and async/await errors * Suggest `Pin::new`/`Box::new`/`Arc::new`/`Box::pin` in more cases * Point at `impl` and type defs introducing requirements on E0277
2021-04-07rebase and update testsEsteban Küber-1/+5
2021-04-07Rollup merge of #83954 - estebank:issue-83613, r=varkorDylan DPC-4/+4
Do not ICE when closure is involved in Trait Alias Impl Trait Fix #83613.
2021-04-06Remove trailing `:` from E0119 messageEsteban Küber-4/+4
2021-04-06forbid `impl Trait` in generic param defaultsSNCPlay42-59/+133
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-25/+21
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-04-02Rollup merge of #83673 - hi-rustin:rustin-patch-suggestion, r=estebankDylan DPC-8/+8
give full path of constraint in suggest_constraining_type_param close https://github.com/rust-lang/rust/issues/83513
2021-04-02Auto merge of #80828 - SNCPlay42:opaque-projections, r=estebankbors-16/+49
Fix expected/found order on impl trait projection mismatch error fixes #68561 This PR adds a new `ObligationCauseCode` used when checking the concrete type of an impl trait satisfies its bounds, and checks for that cause code in the existing test to see if a projection's normalized type should be the "expected" or "found" type. The second commit adds a `peel_derives` to that test, which appears to be necessary in some cases (see projection-mismatch-in-impl-where-clause.rs, which would still give expected/found in the wrong order otherwise). This caused some other changes in diagnostics not involving impl trait, but they look correct to me.
2021-03-31give full path of constraint in suggest_constraining_type_paramhi-rustin-8/+8
revert file bless with nll mode
2021-03-20Move some tests to more reasonable directories - 5Caio-0/+79
2021-03-16peel derives when checking normalized is expectedSNCPlay42-0/+31
2021-03-16fix expected/found order on impl trait projection mismatchSNCPlay42-16/+18
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-39/+396
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2021-03-12Make def_key and HIR parenting consistent.Camille GILLOT-1/+48
2021-02-06path trimming: ignore type aliasesDan Aloni-4/+4
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+501
Address comments Update limits