about summary refs log tree commit diff
path: root/tests/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
2023-06-22Handle weak type aliases by immediately resolving them to their aliased typeOli Scherer-5/+0
2023-06-22Point to argument/return type instead of the whole function headerOli Scherer-8/+8
2023-06-21Liberate bound vars properly when suggesting missing AFITMichael Goulet-4/+12
2023-06-19Rollup merge of #112596 - compiler-errors:missing-sig-with-rpitit, r=b-naberMichael Goulet-0/+59
Suggest correct signature on missing fn returning RPITIT/AFIT Add `async` and unpeel the future's output type if the function is async Fixes #108195
2023-06-18Treat TAIT equation as always ambiguous in coherenceMichael Goulet-0/+45
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-30/+23
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-14Error on unconstrained lifetime in RPITITMichael Goulet-79/+135
2023-06-13Suggest correct signature on missing fn returning RPITIT/AFITMichael Goulet-0/+59
2023-06-11Don't suggest boxing an empty if/else armMichael Goulet-0/+25
2023-06-01Rollup merge of #111980 - compiler-errors:unmapped-substs, r=lcnrDylan DPC-76/+6
Preserve substs in opaques recorded in typeck results This means that we now prepopulate MIR with opaques with the right substs. The first commit is a hack that I think we discussed, having to do with `DefiningAnchor::Bubble` basically being equivalent to `DefiningAnchor::Error` in the new solver, so having to use `DefiningAnchor::Bind` instead, lol. r? `@lcnr`
2023-05-31Check that RPITs are compatible with the opaques inferred during HIR typeck tooMichael Goulet-76/+6
2023-05-27Check nested obligations during coercion unifyMichael Goulet-0/+2
2023-05-26Rollup merge of #111947 - obeis:issue-111943, r=compiler-errorsMatthias Krüger-0/+38
Add test for RPIT defined with different hidden types with different substs Close #111943
2023-05-26Add test for RPIT defined with different hidden types with different substsObei Sideg-0/+38
2023-05-25Don't print newlines in APITsMichael Goulet-0/+44
2023-05-18Remove return type sized check hack from hir typeckMichael Goulet-51/+5
2023-05-18Simplify suggestion when returning bare dyn traitMichael Goulet-90/+84
2023-05-16Use error term if missing associated item in new solverMichael Goulet-1/+15
2023-05-13improve error for `impl<..> impl Trait for Type`y21-0/+64
2023-05-13Rollup merge of #111451 - compiler-errors:note-cast-origin, r=b-naberDylan DPC-4/+2
Note user-facing types of coercion failure When coercing, for example, `Box<A>` into `Box<dyn B>`, make sure that any failure notes mention *those* specific types, rather than mentioning inner types, like "the cast from `A` to `dyn B`". I expect end-users are often confused when we skip layers of types and only mention the "innermost" part of a coercion, especially when other notes point at HIR, e.g. #111406.
2023-05-12Use the opaque_types_defined_by query to cheaply check for whether a hidden ↵Oli Scherer-0/+134
type may be registered for an opaque type
2023-05-12Note base types of coercionMichael Goulet-4/+2
2023-05-05Rollup merge of #111052 - nnethercote:fix-ice-test, r=NilstriebYuki Okushi-19/+5
Fix problems with backtraces in two ui tests. `default-backtrace-ice.rs` started started failing for me recently, because on my Ubuntu 23.04 system there are 100 stack frames, and the current stack filtering pattern doesn't match on a stack frame with a three digit number. `issue-86800.rs` can also be improved, backtrace-wise. r? `@Nilstrieb`
2023-05-05Don't print backtrace on ICEs in `issue-86800.rs`.Nicholas Nethercote-19/+5
Because it then just has to be filtered out. This change makes this test more like these other tests: - tests/ui/treat-err-as-bug/err.rs - tests/ui/treat-err-as-bug/delay_span_bug.rs - tests/ui/mir/validate/storage-live.rs - tests/ui/associated-inherent-types/bugs/ice-substitution.rs - tests/ui/layout/valid_range_oob.rs
2023-05-04Rollup merge of #111039 - compiler-errors:foreign-span-rpitit, r=tmiaskoMatthias Krüger-6/+30
Encode def span for foreign return-position `impl Trait` in trait Fixes #111031, yet another def-span encoding issue :/ Includes a smaller repro than the issue, but I can confirm it ICEs: ``` query stack during panic: #0 [def_span] looking up span for `rpitit::Foo::bar::{opaque#0}` #1 [object_safety_violations] determining object safety of trait `rpitit::Foo` #2 [check_is_object_safe] checking if trait `rpitit::Foo` is object safe #3 [typeck] type-checking `main` #4 [used_trait_imports] finding used_trait_imports `main` #5 [analysis] running analysis passes on this crate ``` Luckily since this only affects nightly, this desn't need to be backported.
2023-05-02Mark RPITIT and AFIT as no longer incompleteMichael Goulet-92/+4
2023-04-30Encode def span for foreign RPITITsMichael Goulet-6/+30
2023-04-25vars are ?Michael Goulet-2/+2
2023-04-21Auto merge of #96840 - cjgillot:query-feed, r=oli-obkbors-2/+2
Allow to feed a value in another query's cache and remove `WithOptConstParam` I used it to remove `WithOptConstParam` queries, as an example. The idea is that a query (here `typeck(function)`) can write into another query's cache (here `type_of(anon const)`). The dependency node for `type_of` would depend on all the current dependencies of `typeck`. There is still an issue with cycles: if `type_of(anon const)` is accessed before `typeck(function)`, we will still have the usual cycle. The way around this issue is to `ensure` that `typeck(function)` is called before accessing `type_of(anon const)`. When replayed, we may the following cases: - `typeck` is green, in that case `type_of` is green too, and all is right; - `type_of` is green, `typeck` may still be marked as red (it depends on strictly more things than `type_of`) -> we verify that the saved value and the re-computed value of `type_of` have the same hash; - `type_of` is red, then `typeck` is red -> it's the caller responsibility to ensure `typeck` is recomputed *before* `type_of`. As `anon consts` have their own `DefPathData`, it's not possible to have the def-id of the anon-const point to something outside the original function, but the general case may have to be resolved before using this device more broadly. There is an open question about loading from the on-disk cache. If `typeck` is loaded from the on-disk cache, the side-effect does not happen. The regular `type_of` implementation can go and fetch the correct value from the decoded `typeck` results, and the dep-graph will check that the hashes match, but I'm not sure we want to rely on this behaviour. I specifically allowed to feed the value to `type_of` from inside a call to `type_of`. In that case, the dep-graph will check that the fingerprints of both values match. This implementation is still very sensitive to cycles, and requires that we call `typeck(function)` before `typeck(anon const)`. The reason is that `typeck(anon const)` calls `type_of(anon const)`, which calls `typeck(function)`, which feeds `type_of(anon const)`, and needs to build the MIR so needs `typeck(anon const)`. The latter call would not cycle, since `type_of(anon const)` has been set, but I'd rather not remove the cycle check.
2023-04-21Auto merge of #110370 - c410-f3r:dqewdas, r=petrochenkovbors-0/+7
Move test files r? `@petrochenkov`
2023-04-20Move test filesCaio-0/+7
2023-04-20Give more descriptive names to queries.Camille GILLOT-2/+2
2023-04-16Account for variance in outlives verification.Camille GILLOT-21/+0
2023-04-16Add tests.Camille GILLOT-0/+72
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-14/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-14/+28
2023-04-12Split out a separate feature gate for impl trait in associated typesOli Scherer-78/+74
2023-04-06Remove index from BrAnonJack Huey-1/+1
2023-04-03Perform match checking on THIR.Camille GILLOT-0/+10
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