about summary refs log tree commit diff
path: root/tests/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
2023-03-30Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-SimulacrumYuki Okushi-0/+0
compiletest: Don't allow tests with overlapping prefix names Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path, or otherwise clash with it while the two tests are trying to create/delete/modify the same directory. In practice, this manifested as a random error on macOS where two tests were trying to create/delete/create `rustdoc/primitive` and `rustdoc/primitive/no_std`, which resulted in an EINVAL (InvalidInput) error. This renames some of the offending tests, adds `compiletest-ignore-dir` to prevent compiletest from processing some files, and adds a check to prevent this from happening in the future. Fixes #109397
2023-03-29Bless some extra working tests under -Zlower-impl-trait-in-trait-to-assoc-tySantiago Pastorino-0/+2
2023-03-29Properly skip RPITITs from ModChild and give a name in AssocItemSantiago Pastorino-1/+1
2023-03-29Walk return-position impl trait in trait deeply in associated_item_def_idsMichael Goulet-5/+16
2023-03-25Rollup merge of #109545 - compiler-errors:rpitit-wf, r=eholkMatthias Krüger-11/+36
Deeply check well-formedness of return-position `impl Trait` in trait Walk the bounds of RPITITs to see if we find any more RPITITs 😸
2023-03-23Deeply check WF for RPITITsMichael Goulet-11/+36
2023-03-23Nested impl traits trigger opaque_hidden_inferred_bound too muchMichael Goulet-36/+0
2023-03-22Rename tests to ensure they don't have overlapping names.Eric Huss-0/+0
Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path.
2023-03-23Rollup merge of #109414 - spastorino:new-rpitit-16, r=compiler-errorsDylan DPC-3/+27
Do not consider synthesized RPITITs on missing items checks Without this patch for `tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs` we get ... ``` warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:4:12 | 4 | #![feature(return_position_impl_trait_in_trait)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information = note: `#[warn(incomplete_features)]` on by default error[E0046]: not all trait items implemented, missing: `foo`, `` --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:12:1 | 8 | fn foo(&self) -> impl Sized; | ---------------------------- | | | | | `` from trait | `foo` from trait ... 12 | impl MyTrait for i32 { | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `` in implementation error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0046`. ``` instead of ... ``` warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12 | LL | #![feature(return_position_impl_trait_in_trait)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information = note: `#[warn(incomplete_features)]` on by default error[E0046]: not all trait items implemented, missing: `foo` --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1 | LL | fn foo(&self) -> impl Sized; | ---------------------------- `foo` from trait ... LL | impl MyTrait for i32 { | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0046`. ``` r? `@compiler-errors`
2023-03-21Always encode RPITITsSantiago Pastorino-0/+2
2023-03-21Do not consider synthesized RPITITs on missing items checksSantiago Pastorino-3/+27
2023-03-21Rollup merge of #109240 - compiler-errors:dont-binder-twice, r=oli-obknils-0/+6
Walk un-shifted nested `impl Trait` in trait when setting up default trait method assumptions Fixes a double subtraction in some binder math in return-position `impl Trait` in trait handling code. Fixes #109239
2023-03-20Rollup merge of #109277 - spastorino:new-rpitit-14, r=compiler-errorsMatthias Krüger-1/+24
Fix generics_of for impl's RPITIT synthesized associated type The only useful commit is the last one. This makes `generics_of` for the impl side RPITIT copy from the trait's associated type and avoid the fn on the impl side which was previously wrongly used. This solution is better but we still need to fix resolution of the generated generics. r? ``@compiler-errors``
2023-03-20Walk un-shifted nested `impl Trait` in trait when setting up default trait ↵Michael Goulet-0/+6
method assumptions
2023-03-18Rollup merge of #109238 - spastorino:new-rpitit-12, r=compiler-errorsMatthias Krüger-1/+16
Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty This PR stops reporting errors due to different count of generics on the new synthesized associated types for RPITITs. Those were already reported when we compare the function on the triat with the function on the impl. r? ``@compiler-errors``
2023-03-17Fix generics_of for impl's RPITIT synthesized associated typeSantiago Pastorino-0/+8
2023-03-17Fix impl_trait_ty_to_ty substsSantiago Pastorino-1/+16
2023-03-17Add revisions for -Zlower-impl-trait-in-trait-to-assoc-ty fixed testsSantiago Pastorino-5/+51
2023-03-17Fix generics mismatch errors for RPITITs on ↵Santiago Pastorino-1/+16
-Zlower-impl-trait-in-trait-to-assoc-ty
2023-03-16Don't install default opaque projection predicates in RPITIT associated ↵Michael Goulet-3/+46
type's param-env
2023-03-16Install projection from RPITIT to default trait method opaque correctlyMichael Goulet-1/+14
2023-03-15Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-tySantiago Pastorino-7/+90
2023-03-14Rollup merge of #108923 - spastorino:new-rpitit-9, r=compiler-errorsMatthias Krüger-0/+2
Make fns from other crates with RPITIT work for -Zlower-impl-trait-in-trait-to-assoc-ty Only the last two commits are meaningful. r? `@compiler-errors`
2023-03-14Rollup merge of #108909 - spastorino:new-rpitit-7, r=compiler-errorsMatthias Krüger-9/+98
Fix object safety checks for new RPITITs This one goes on top of #108869 r? `@compiler-errors`
2023-03-14Rollup merge of #108880 - spastorino:new-rpitit-6, r=compiler-errorsMatthias Krüger-36/+91
Remove tests/ui/impl-trait/in-trait/new-lowering-strategy in favor of using revisions on existing tests r? `@compiler-errors` This one again sits on top of existing approved PRs and it still needs to add revisions to tests in `tests/ui/impl-trait/in-trait` as it only does so for async in traits.
2023-03-14Make fns from other crates with RPITIT workSantiago Pastorino-0/+2
2023-03-14Auto merge of #104833 - Swatinem:async-identity-future, r=compiler-errorsbors-13/+27
Remove `identity_future` indirection This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]`annotation. Fixes https://github.com/rust-lang/rust/issues/104826.
2023-03-12Fix object safety checks for new RPITITsSantiago Pastorino-6/+59
2023-03-12Filter out RPITITs in astconv when checking for missing associated typesSantiago Pastorino-3/+39
2023-03-12Run existing impl trait in traits tests using ↵Santiago Pastorino-8/+91
-Zlower-impl-trait-in-trait-to-assoc-ty
2023-03-12Remove tests/ui/impl-trait/in-trait/new-lowering-strategy in favor of using ↵Santiago Pastorino-28/+0
revisions on existing tests
2023-03-12Auto merge of #108700 - spastorino:new-rpitit-impl-side-2, r=compiler-errorsbors-0/+17
Make RPITITs simple cases work when using lower_impl_trait_in_trait_to_assoc_ty r? `@compiler-errors` It's probably best reviewed commit by commit.
2023-03-08Remove `identity_future` indirectionArpad Borsos-13/+27
This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]` annotation.
2023-03-07Rollup merge of #108583 - ↵Matthias Krüger-0/+25
compiler-errors:rpitit-default-method-with-nested-rpitits, r=spastorino Account for binders correctly when adding default RPITIT method assumption As of #108203, we install extra projection predicates into the param-env of a default trait method when it has return-position `impl Trait` (or is async). The implementation didn't account for the fact that it's walking into and out of binders, so we just need to shift all the debruijn indices accordingly when constructing the projection predicates. Fixes #108579 r? types
2023-03-06Add simple impl trait test for RPITITSantiago Pastorino-0/+17
2023-03-05Rollup merge of #108764 - cjgillot:dpm-adapt, r=compiler-errorsMatthias Krüger-0/+3
Tweaks to -Zdrop-tracking-mir Split from https://github.com/rust-lang/rust/pull/107421 3 commits: 1 diagnostic improvement and 2 ICEs.
2023-03-05drop_tracking_mir: diagnose recursive generator.Camille GILLOT-0/+3
2023-03-04Don't project to RPITIT that has no default valueMichael Goulet-0/+37
2023-03-03Rollup merge of #108292 - compiler-errors:opaque-captures-where, r=oli-obkMatthias Krüger-13/+38
Label opaque type for 'captures lifetime' error message Providing more information may help make this somewhat opaque (lol) error message a bit clearer.
2023-03-03Label opaque type for 'captures lifetime' error messageMichael Goulet-13/+38
2023-03-02Add simple trait testSantiago Pastorino-0/+11
2023-02-28Shift vars for default RPITIT methods correctlyMichael Goulet-0/+25
2023-02-28Descriptive error when users try to combine RPITIT/AFIT with specializationMichael Goulet-1/+10
2023-02-24Rollup merge of #108401 - notriddle:notriddle/diagnostics-article, ↵Dylan DPC-2/+2
r=compiler-errors diagnostics: remove inconsistent English article "this" from E0107 Consider [`tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`][issue-102768.stderr], the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in [`tests/ui/lint/dead-code/issue-85255.stderr`][issue-85255.stderr]. They don't have articles, so it seems unnecessary to have one here. [issue-102768.stderr]: https://github.com/rust-lang/rust/blob/07c993eba8b76eae497e98433ae075b00f01be10/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr [issue-85255.stderr]: https://github.com/rust-lang/rust/blob/07c993eba8b76eae497e98433ae075b00f01be10/tests/ui/lint/dead-code/issue-85255.stderr
2023-02-23diagnostics: remove inconsistent English article "this" from E0107Michael Howell-2/+2
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.
2023-02-23Rollup merge of #108063 - ↵Matthias Krüger-52/+52
compiler-errors:associated-type-bounds-in-bad-position, r=cjgillot Ban associated type bounds in bad positions We should not try to lower associated type bounds into TAITs in positions where `impl Trait` is not allowed (except for in `where` clauses, like `where T: Trait<Assoc: Bound>`). This is achieved by using the same `rustc_ast_lowering` machinery as impl-trait does to characterize positions as universal/existential/disallowed. Fixes #106077 Split out the first commit into #108066, since it's not really related.
2023-02-22pluralize stuffMichael Goulet-52/+52
2023-02-22Normalize line+col in normalize-tait-in-const testAlan Egerton-1/+2
2023-02-22Remove type-traversal trait aliasesAlan Egerton-1/+1
2023-02-22Convert a hard-warning about named static lifetimes into lint "unused_lifetimes"Zhi Qi-11/+0
Define the `named_static_lifetimes` lint This lint will replace the existing hard-warning. Replace the named static lifetime hard-warning with the new lint Update the UI tests for the `named_static_lifetimes` lint Remove the direct dependency on `rustc_lint_defs` fix build Signed-off-by: Zhi Qi <qizhi@pingcap.com> use "UNUSED_LIFETIMES" instead Signed-off-by: Zhi Qi <qizhi@pingcap.com> update 1 test and fix typo Signed-off-by: Zhi Qi <qizhi@pingcap.com> update tests Signed-off-by: Zhi Qi <qizhi@pingcap.com> fix tests: add extra blank line Signed-off-by: Zhi Qi <qizhi@pingcap.com>